Differences From Artifact [9ad949e286]:
- File
src/macros.h
— part of check-in
[61369b9d26]
at
2014-03-19 18:05:42
on branch trunk
— macros.h: Never define static_assert to assert
static_asserts can be used in places where asserts won't work and take
two parameters, while asserts only take one. (user: js, size: 10165) [annotate] [blame] [check-ins using]
To Artifact [8621e81b30]:
- File src/macros.h — part of check-in [2729104cf6] at 2014-05-05 02:13:37 on branch trunk — Check for and use __builtin_bswap{16,32,64} (user: js, size: 10372) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
195 196 197 198 199 200 201 | (i & UINT64_C(0x000000000000FF00)) << 40 | (i & UINT64_C(0x00000000000000FF)) << 56; } static OF_INLINE uint16_t OF_CONST_FUNC OF_BSWAP16_NONCONST(uint16_t i) { | > > | | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | (i & UINT64_C(0x000000000000FF00)) << 40 | (i & UINT64_C(0x00000000000000FF)) << 56; } static OF_INLINE uint16_t OF_CONST_FUNC OF_BSWAP16_NONCONST(uint16_t i) { #if defined(OF_HAVE_BUILTIN_BSWAP16) return __builtin_bswap16(i); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ ( "xchgb %h0, %b0" : "=Q"(i) : "0"(i) ); #elif defined(OF_PPC_ASM) __asm__ ( |
︙ | ︙ | |||
223 224 225 226 227 228 229 | #endif return i; } static OF_INLINE uint32_t OF_CONST_FUNC OF_BSWAP32_NONCONST(uint32_t i) { | > > | | 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | #endif return i; } static OF_INLINE uint32_t OF_CONST_FUNC OF_BSWAP32_NONCONST(uint32_t i) { #if defined(OF_HAVE_BUILTIN_BSWAP32) return __builtin_bswap32(i); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) __asm__ ( "bswap %0" : "=q"(i) : "0"(i) ); #elif defined(OF_PPC_ASM) __asm__ ( |
︙ | ︙ | |||
253 254 255 256 257 258 259 | #endif return i; } static OF_INLINE uint64_t OF_CONST_FUNC OF_BSWAP64_NONCONST(uint64_t i) { | > > | | 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | #endif return i; } static OF_INLINE uint64_t OF_CONST_FUNC OF_BSWAP64_NONCONST(uint64_t i) { #if defined(OF_HAVE_BUILTIN_BSWAP64) return __builtin_bswap64(i); #elif defined(OF_X86_64_ASM) __asm__ ( "bswap %0" : "=r"(i) : "0"(i) ); #elif defined(OF_X86_ASM) __asm__ ( |
︙ | ︙ |