VirtualBox

Changeset 25821 in vbox for trunk/include


Ignore:
Timestamp:
Jan 14, 2010 8:26:10 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56598
Message:

iprt/cdefs.h: builtin_constant_p for RT_BSWAP_* with gcc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cdefs.h

    r25748 r25821  
    12461246# define RT_BSWAP_U64(u64)  RT_BSWAP_U64_C(u64)
    12471247#elif defined(__GNUC__)
    1248 /** @todo use __builtin_constant_p? */
    1249 # define RT_BSWAP_U64(u64)  ASMByteSwapU64(u64)
     1248# define RT_BSWAP_U64(u64)  (__builtin_constant_p((u64)) \
     1249                            ? RT_BSWAP_U64_C(u64) : ASMByteSwapU64(u64))
    12501250#else
    12511251# define RT_BSWAP_U64(u64)  ASMByteSwapU64(u64)
     
    12571257# define RT_BSWAP_U32(u32)  RT_BSWAP_U32_C(u32)
    12581258#elif defined(__GNUC__)
    1259 /** @todo use __builtin_constant_p? */
    1260 # define RT_BSWAP_U32(u32)  ASMByteSwapU32(u32)
     1259# define RT_BSWAP_U32(u32)  (__builtin_constant_p((u32)) \
     1260                            ? RT_BSWAP_U32_C(u32) : ASMByteSwapU32(u32))
    12611261#else
    12621262# define RT_BSWAP_U32(u32)  ASMByteSwapU32(u32)
     
    12681268# define RT_BSWAP_U16(u16)  RT_BSWAP_U16_C(u16)
    12691269#elif defined(__GNUC__)
    1270 /** @todo use __builtin_constant_p? */
    1271 # define RT_BSWAP_U16(u16)  ASMByteSwapU16(u16)
     1270# define RT_BSWAP_U16(u16)  (__builtin_constant_p((u16)) \
     1271                            ? RT_BSWAP_U16_C(u16) : ASMByteSwapU16(u16))
    12721272#else
    12731273# define RT_BSWAP_U16(u16)  ASMByteSwapU16(u16)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette