--- rxvt-unicode/src/rxvtutil.h 2006/06/23 14:31:38 1.27 +++ rxvt-unicode/src/rxvtutil.h 2007/11/20 17:44:44 1.30 @@ -11,21 +11,17 @@ #define PP_STRINGIFY_(a) #a #define PP_STRINGIFY(a) PP_STRINGIFY_(a) -// actually, some gcc-3.x versions work, too -#define HAVE_GCC_BUILTINS (__GNUC__ >= 4) +#define HAVE_GCC_BUILTINS (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ == 4)) -#ifndef __attribute__ -# if __GNUC__ -# if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2) -# define __attribute__(x) -# endif -# endif -# define __attribute__(x) +#if __GNUC__ >= 3 +# define rxvt_attribute(x) __attribute__(x) +#else +# define rxvt_attribute(x) #endif -#define NORETURN __attribute__ ((noreturn)) -#define UNUSED __attribute__ ((unused)) -#define CONST __attribute__ ((const)) +#define NORETURN rxvt_attribute ((noreturn)) +#define UNUSED rxvt_attribute ((unused)) +#define CONST rxvt_attribute ((const)) // increases code size unless -fno-enforce-eh-specs #if __GNUC__ @@ -70,8 +66,8 @@ // some bit functions, xft fuck me plenty #if HAVE_GCC_BUILTINS -static inline int ctz (unsigned int x) CONST { return __builtin_ctz (x); } -static inline int popcount (unsigned int x) CONST { return __builtin_popcount (x); } +static inline int ctz (unsigned int x) { return __builtin_ctz (x); } +static inline int popcount (unsigned int x) { return __builtin_popcount (x); } #else // count trailing zero bits and count # of one bits int ctz (unsigned int x) CONST; @@ -93,7 +89,7 @@ }; /* simplevec taken (and heavily modified), from: - * + * * MICO --- a free CORBA implementation * Copyright (C) 1997-98 Kay Roemer & Arno Puder */