Skip to content

Commit d75702b

Browse files
committed
utils: remove ifdefs for some ancient or obscure compilers
If someone needs this, they can let us know... Signed-off-by: Ran Benita <[email protected]>
1 parent 4601b20 commit d75702b

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/utils.h

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -267,42 +267,39 @@ open_file(const char *path);
267267

268268
/* Compiler Attributes */
269269

270-
#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__)
270+
#if defined(__GNUC__) && !defined(__CYGWIN__)
271271
# define XKB_EXPORT __attribute__((visibility("default")))
272-
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
273-
# define XKB_EXPORT __global
274-
#else /* not gcc >= 4 and not Sun Studio >= 8 */
272+
#else
275273
# define XKB_EXPORT
276274
#endif
277275

278276
#if defined(__MINGW32__)
279277
# define ATTR_PRINTF(x,y) __attribute__((__format__(__MINGW_PRINTF_FORMAT, x, y)))
280-
#elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203)
278+
#elif defined(__GNUC__)
281279
# define ATTR_PRINTF(x,y) __attribute__((__format__(__printf__, x, y)))
282-
#else /* not gcc >= 2.3 */
280+
#else
283281
# define ATTR_PRINTF(x,y)
284282
#endif
285283

286-
#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \
287-
|| (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
284+
#if defined(__GNUC__)
288285
# define ATTR_NORETURN __attribute__((__noreturn__))
289286
#else
290287
# define ATTR_NORETURN
291288
#endif /* GNUC */
292289

293-
#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 296)
290+
#if defined(__GNUC__)
294291
#define ATTR_MALLOC __attribute__((__malloc__))
295292
#else
296293
#define ATTR_MALLOC
297294
#endif
298295

299-
#if defined(__GNUC__) && (__GNUC__ >= 4)
296+
#if defined(__GNUC__)
300297
# define ATTR_NULL_SENTINEL __attribute__((__sentinel__))
301298
#else
302299
# define ATTR_NULL_SENTINEL
303-
#endif /* GNUC >= 4 */
300+
#endif
304301

305-
#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 295)
302+
#if defined(__GNUC__)
306303
#define ATTR_PACKED __attribute__((__packed__))
307304
#else
308305
#define ATTR_PACKED

0 commit comments

Comments
 (0)