… | |
… | |
110 | =item ECB_CPP11, ECB_CPP14, ECB_CPP17 |
110 | =item ECB_CPP11, ECB_CPP14, ECB_CPP17 |
111 | |
111 | |
112 | True if the implementation claims to be compliant to C++11/C++14/C++17 |
112 | True if the implementation claims to be compliant to C++11/C++14/C++17 |
113 | (ISO/IEC 14882:2011, :2014, :2017) or any later version. |
113 | (ISO/IEC 14882:2011, :2014, :2017) or any later version. |
114 | |
114 | |
|
|
115 | =item ECB_OPTIMIZE_SIZE |
|
|
116 | |
|
|
117 | Is C<1> when the compiler optimizes for size, C<0> otherwise. This symbol |
|
|
118 | can also be defined before including F<ecb.h>, in which case it will be |
|
|
119 | unchanged. |
|
|
120 | |
115 | =item ECB_GCC_VERSION (major, minor) |
121 | =item ECB_GCC_VERSION (major, minor) |
116 | |
122 | |
117 | Expands to a true value (suitable for testing in by the preprocessor) |
123 | Expands to a true value (suitable for testing in by the preprocessor) |
118 | if the compiler used is GNU C and the version is the given version, or |
124 | if the compiler used is GNU C and the version is the given version, or |
119 | higher. |
125 | higher. |
… | |
… | |
408 | |
414 | |
409 | =head2 OPTIMISATION HINTS |
415 | =head2 OPTIMISATION HINTS |
410 | |
416 | |
411 | =over 4 |
417 | =over 4 |
412 | |
418 | |
413 | =item ECB_OPTIMIZE_SIZE |
|
|
414 | |
|
|
415 | Is C<1> when the compiler optimizes for size, C<0> otherwise. This symbol |
|
|
416 | can also be defined before including F<ecb.h>, in which case it will be |
|
|
417 | unchanged. |
|
|
418 | |
|
|
419 | =item bool ecb_is_constant (expr) |
419 | =item bool ecb_is_constant (expr) |
420 | |
420 | |
421 | Returns true iff the expression can be deduced to be a compile-time |
421 | Returns true iff the expression can be deduced to be a compile-time |
422 | constant, and false otherwise. |
422 | constant, and false otherwise. |
423 | |
423 | |
… | |
… | |
756 | =item uint_fast64_t ecb_le_u64_to_host (uint_fast64_t v) |
756 | =item uint_fast64_t ecb_le_u64_to_host (uint_fast64_t v) |
757 | |
757 | |
758 | Convert an unsigned 16, 32 or 64 bit value from big or little endian to host byte order. |
758 | Convert an unsigned 16, 32 or 64 bit value from big or little endian to host byte order. |
759 | |
759 | |
760 | The naming convention is C<ecb_>(C<be>|C<le>)C<_u>C<16|32|64>C<_to_host>, |
760 | The naming convention is C<ecb_>(C<be>|C<le>)C<_u>C<16|32|64>C<_to_host>, |
761 | where be and le stand for big endian and little endian, respectively. |
761 | where C<be> and C<le> stand for big endian and little endian, respectively. |
762 | |
762 | |
763 | =item uint_fast16_t ecb_host_to_be_u16 (uint_fast16_t v) |
763 | =item uint_fast16_t ecb_host_to_be_u16 (uint_fast16_t v) |
764 | |
764 | |
765 | =item uint_fast32_t ecb_host_to_be_u32 (uint_fast32_t v) |
765 | =item uint_fast32_t ecb_host_to_be_u32 (uint_fast32_t v) |
766 | |
766 | |
… | |
… | |
854 | |
854 | |
855 | In C++ the following additional template functions are supported: |
855 | In C++ the following additional template functions are supported: |
856 | |
856 | |
857 | =over 4 |
857 | =over 4 |
858 | |
858 | |
859 | =item T ecb_peek (const void *ptr) |
859 | =item T ecb_peek<T> (const void *ptr) |
860 | |
860 | |
861 | =item T ecb_peek_be (const void *ptr) |
861 | =item T ecb_peek_be<T> (const void *ptr) |
862 | |
862 | |
863 | =item T ecb_peek_le (const void *ptr) |
863 | =item T ecb_peek_le<T> (const void *ptr) |
864 | |
864 | |
865 | =item T ecb_peek_u (const void *ptr) |
865 | =item T ecb_peek_u<T> (const void *ptr) |
866 | |
866 | |
867 | =item T ecb_peek_be_u (const void *ptr) |
867 | =item T ecb_peek_be_u<T> (const void *ptr) |
868 | |
868 | |
869 | =item T ecb_peek_le_u (const void *ptr) |
869 | =item T ecb_peek_le_u<T> (const void *ptr) |
870 | |
870 | |
871 | Similarly to their C counterparts, these functions load an unsigned 8, 16, |
871 | Similarly to their C counterparts, these functions load an unsigned 8, 16, |
872 | 32 or 64 bit value from memory, with optional conversion from big/little |
872 | 32 or 64 bit value from memory, with optional conversion from big/little |
873 | endian. |
873 | endian. |
874 | |
874 | |
875 | Since the type cannot be deduced, it has top be specified explicitly, e.g. |
875 | Since the type cannot be deduced, it has to be specified explicitly, e.g. |
876 | |
876 | |
877 | uint_fast16_t v = ecb_peek<uint16_t> (ptr); |
877 | uint_fast16_t v = ecb_peek<uint16_t> (ptr); |
878 | |
878 | |
879 | C<T> must be one of C<uint8_t>, C<uint16_t>, C<uint32_t> or C<uint64_t>. |
879 | C<T> must be one of C<uint8_t>, C<uint16_t>, C<uint32_t> or C<uint64_t>. |
880 | |
880 | |