diff --git a/include/misc.h b/include/misc.h index 1fea73ec3..0867746d2 100644 --- a/include/misc.h +++ b/include/misc.h @@ -261,14 +261,16 @@ version_compare(uint16_t a_major, uint16_t a_minor, #define SwapRestL(stuff) \ SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff)) -#ifdef __GNUC__ +#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) void __attribute__((error("wrong sized variable passed to swap"))) wrong_size(void); #else static inline void wrong_size(void) { } +#endif -static inline void __builtin_constant_p(int x) +#if !(defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C < 0x590))) +static inline int __builtin_constant_p(int x) { return 0; }