summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2014-05-01 02:24:35 +1000
committerDarren Tucker <dtucker@zip.com.au>2014-05-01 02:24:35 +1000
commitf028460d0b2e5a584355321015cde69bf6fd933e (patch)
treed8e5d436741d71782dedf498317b52ce5888ed70
parentb628cc4c3e4a842bab5e4584d18c2bc5fa4d0edf (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--ChangeLog4
-rw-r--r--defines.h12
2 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 541db38c4..7bff5fba7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
120140430
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
120140420 520140420
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
diff --git a/defines.h b/defines.h
index 41861fbba..928bd9b01 100644
--- a/defines.h
+++ b/defines.h
@@ -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 */