Commit Graph

155 Commits

Author SHA1 Message Date
Peter Dimov
3de20eb340
Merge pull request #38 from tanzislam/fix-macro-use-with-template-parameters
Fix BOOST_STATIC_ASSERT with template arguments
2019-10-25 14:06:07 -07:00
Tanzinul Islam
7f9a618b8c Fix BOOST_STATIC_ASSERT with template arguments
a2025a932 introduced a `BOOST_STATIC_ASSERT`-check with a template argument list. This causes a compilation error in a pre-C++11 compiler without support for variadic arguments (i.e. if `BOOST_NO_CXX11_VARIADIC_MACROS` is set).

For example:
    $ echo '#include <boost/endian/buffers.hpp>' > test.cpp
    $ g++ -c -std=c++03 -DBOOST_NO_CXX11_VARIADIC_MACROS -I/path/to/boost test.cpp

results in:

```
In file included from /path/to/boost/boost/endian/detail/endian_store.hpp:9,
                 from /path/to/boost/boost/endian/buffers.hpp:30,
                 from test.cpp:1:
/path/to/boost/boost/endian/detail/endian_reverse.hpp:111:76: error: macro "BOOST_STATIC_ASSERT" passed 2 arguments, but takes just 1
  111 |     BOOST_STATIC_ASSERT( is_integral<T>::value && !is_same<T, bool>::value );
      |                                                                            ^
In file included from /path/to/boost/boost/endian/detail/endian_reverse.hpp:13,
                 from /path/to/boost/boost/endian/detail/endian_store.hpp:9,
                 from /path/to/boost/boost/endian/buffers.hpp:30,
                 from test.cpp:1:
/path/to/boost/boost/static_assert.hpp:157: note: macro "BOOST_STATIC_ASSERT" defined here
  157 | #     define BOOST_STATIC_ASSERT( B ) \
      |
```
2019-10-25 15:18:24 +01:00
Peter Dimov
c64f7c3372 Add <boost/endian.hpp> 2019-10-22 19:41:49 +03:00
Peter Dimov
fbc198e75d Add __int128 support to endian_reverse 2019-10-20 21:28:38 +03:00
Peter Dimov
59097ada36 Change data() to return unsigned char*; add non-const versions 2019-10-15 18:58:48 +03:00
Peter Dimov
b015a164f8 Add floating point typedefs to arithmetic.hpp; rename double64 to float64 in buffers.hpp 2019-10-15 02:26:58 +03:00
Peter Dimov
e6136ddf27 Add floating point buffer typedefs 2019-10-15 01:54:26 +03:00
Peter Dimov
4054afda70 Add convenience store functions 2019-10-12 19:21:19 +03:00
Peter Dimov
22d0d7bcd1 Add convenience load functions 2019-10-12 18:50:59 +03:00
Peter Dimov
a4bc0f1a44 Make endian_reverse constexpr when possible 2019-10-11 19:43:02 +03:00
Peter Dimov
cc28f5d658 Add BOOST_CONSTEXPR to endian_reverse functions 2019-10-11 18:49:06 +03:00
Peter Dimov
e68d8f939c static_assert the requirements of endian_load and endian_store 2019-05-01 00:13:22 +03:00
Peter Dimov
79c3add907 Support any expanding loads in endian_load 2019-04-30 23:53:39 +03:00
Peter Dimov
8df14956d4 Support any truncating store in endian_store 2019-04-30 20:39:17 +03:00
Peter Dimov
d40a3ac3f4 Switch the parameter order of endian_store 2019-04-30 05:13:47 +03:00
Peter Dimov
f0f8e398d6 conversion.hpp: remove unused detail functions, static-assert that types are EndianReversible 2019-04-29 01:32:07 +03:00
Peter Dimov
b29b3dfc10 Move all deprecated names to endian.hpp; add deprecated_test.cpp to test/Jamfile 2019-04-29 00:36:21 +03:00
Peter Dimov
ff59429171 Remove obsolete std_pair.hpp 2019-04-28 16:30:51 +03:00
Peter Dimov
630e09942b Remove endian/detail/cover_operators.hpp 2019-04-28 00:58:29 +03:00
Peter Dimov
cd8fbbdbcb Remove use of cover_operators in arithmetic.hpp 2019-04-28 00:52:36 +03:00
Peter Dimov
9efbcd7c7b Simplify endian_arithmetic 2019-04-27 22:46:32 +03:00
Peter Dimov
43d21860a4 Do not #pragma pack(1) before including headers 2019-04-27 22:37:40 +03:00
Peter Dimov
6b5792647c Simplify endian_buffer specializations 2019-04-27 20:11:41 +03:00
Peter Dimov
f77a318c37 Remove BOOST_ENDIAN_LOG 2019-04-27 19:28:49 +03:00
Peter Dimov
8e3eccaa14 Do not include conversion.hpp from endian_load, endian_store.hpp 2019-04-27 19:15:28 +03:00
Peter Dimov
e58970b167 Remove endian/detail/lightweight_test.hpp 2019-04-27 02:32:24 +03:00
Peter Dimov
26b0170a6e Fix typo in conversion.hpp 2019-04-27 01:47:28 +03:00
Peter Dimov
a2025a9320 Refactor endian_reverse into its own header, make it work for long and long long 2019-04-26 20:24:27 +03:00
Peter Dimov
146c1af963 Merge branch 'develop' into feature/endian-load-store 2019-03-20 17:30:05 +02:00
Peter Dimov
01146c9558 Add char and char16_t overloads of endian_reverse 2019-03-19 01:06:53 +02:00
Peter Dimov
2bd479044b Add spirit_conflict_test.cpp (refs #33) 2019-03-13 02:12:48 +02:00
Peter Dimov
de33887009 Identify and static-assert the requirements of endian_load/endian_store 2019-03-13 01:44:29 +02:00
Peter Dimov
95178e3cfb Add endian_store, use it in buffers.hpp 2019-03-12 20:21:11 +02:00
Peter Dimov
019fb85ea9 Add endian_load, use it in buffers.hpp 2019-03-12 19:42:35 +02:00
Peter Dimov
e08864d648 Fix msvc warnings 2019-02-19 01:13:31 +02:00
Peter Dimov
dafb9b1795 Use unsigned char in store_{big,little} 2018-12-06 20:44:42 +02:00
Peter Dimov
96c2e6dacb Cosmetic fixes 2018-12-06 20:34:15 +02:00
Peter Dimov
9f67f19d35 Merge branch 'unaligned-big-endian' of https://github.com/wijagels/endian into feature/pr-31 2018-12-06 19:57:58 +02:00
Peter Dimov
bde5937912 A header named _pop should presumably pop instead of push 2018-09-15 03:40:33 +03:00
Peter Dimov
e5753d13e2 Remove unused header 2018-09-15 03:38:52 +03:00
Peter Dimov
2837f3b9c5 g++ 4.5 and earlier do not support unrestricted unions 2018-09-11 20:18:13 +03:00
Peter Dimov
07ec535600 boost/predef/detail/endian_compat.h is deprecated; switch to boost/predef/other/endian.h 2018-09-11 18:54:54 +03:00
William Jagels
327b501169 Take advantage of unaligned load/store for big endian 2018-03-24 20:41:40 -04:00
Peter Dimov
e93f6a2270 Fix unaligned loads and stores 2017-12-23 18:40:09 +02:00
Peter Dimov
134b225378 Shifting a negative number is an -fsanitize=undefined violation, use the unsigned type 2017-12-22 16:24:21 +02:00
Peter Dimov
34542134be
Merge pull request #23 from arvidn/remove-trailing-whitespace
[cleanup] remove trailing whitespace from source code files
2017-12-21 17:42:03 +02:00
arvidn
4b4123a0fa [cleanup] remove trailing whitespace from source code files 2017-11-04 13:07:54 +01:00
Beman
754a4144ec Clear signed/unsigned warnings 2016-08-09 16:49:20 -04:00
Ben Wiederhake
b51593c766 Fix typos in documentation/comments
Credits go to the authors of codespell.
2016-04-03 19:13:04 +02:00
Ben Wiederhake
d1865063ad Fix typos in documentation
Found and fixed while reading documentation
2016-04-03 19:12:49 +02:00