diff options
author | Darren Tucker <dtucker@zip.com.au> | 2014-05-01 02:24:35 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2014-05-01 02:24:35 +1000 |
commit | f028460d0b2e5a584355321015cde69bf6fd933e (patch) | |
tree | d8e5d436741d71782dedf498317b52ce5888ed70 | |
parent | b628cc4c3e4a842bab5e4584d18c2bc5fa4d0edf (diff) |
- (dtucker) [defines.h] Define __GNUC_PREREQ__ macro if we don't already
have it. Only attempt to use __attribute__(__bounded__) for gcc.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | defines.h | 12 |
2 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,7 @@ | |||
1 | 20140430 | ||
2 | - (dtucker) [defines.h] Define __GNUC_PREREQ__ macro if we don't already | ||
3 | have it. Only attempt to use __attribute__(__bounded__) for gcc. | ||
4 | |||
1 | 20140420 | 5 | 20140420 |
2 | - OpenBSD CVS Sync | 6 | - OpenBSD CVS Sync |
3 | - djm@cvs.openbsd.org 2014/03/03 22:22:30 | 7 | - djm@cvs.openbsd.org 2014/03/03 22:22:30 |
@@ -25,7 +25,7 @@ | |||
25 | #ifndef _DEFINES_H | 25 | #ifndef _DEFINES_H |
26 | #define _DEFINES_H | 26 | #define _DEFINES_H |
27 | 27 | ||
28 | /* $Id: defines.h,v 1.177 2014/04/20 03:21:23 djm Exp $ */ | 28 | /* $Id: defines.h,v 1.178 2014/04/30 16:24:35 dtucker Exp $ */ |
29 | 29 | ||
30 | 30 | ||
31 | /* Constants */ | 31 | /* Constants */ |
@@ -826,9 +826,17 @@ struct winsize { | |||
826 | # define arc4random_stir() | 826 | # define arc4random_stir() |
827 | #endif | 827 | #endif |
828 | 828 | ||
829 | /* Macro to test if we're using a specific version of gcc or later. */ | ||
830 | #if defined(__GNUC__) && !defined(__GNUC_PREREQ__) | ||
831 | #define __GNUC_PREREQ__(ma, mi) \ | ||
832 | ((__GNUC__ > (ma)) || (__GNUC__ == (ma) && __GNUC_MINOR__ >= (mi))) | ||
833 | #else | ||
834 | #define __GNUC_PREREQ__(ma, mi) 0 | ||
835 | #endif | ||
836 | |||
829 | /* __bounded macro */ | 837 | /* __bounded macro */ |
830 | #ifndef __bounded | 838 | #ifndef __bounded |
831 | # if __GNUC_PREREQ__(3,3) && !defined(__clang__) | 839 | # if defined(__GNUC__) && __GNUC_PREREQ__(3,3) && !defined(__clang__) |
832 | # define __bounded(args) __attribute__ ((__bounded__ args )) | 840 | # define __bounded(args) __attribute__ ((__bounded__ args )) |
833 | # else | 841 | # else |
834 | # define __bounded(args) /* delete */ | 842 | # define __bounded(args) /* delete */ |