changeset 21325:64be7d374f86

Make OCTAVE_DEPRECATED macro compatible with older gcc * mk-octave-config-h.sh, oct-conf-post.in.h (OCTAVE_DEPRECATED): Apply msg argument only if compiling with a gcc version that accepts it.
author Mike Miller <mtmiller@octave.org>
date Tue, 23 Feb 2016 15:08:24 -0800
parents 5169d5993d77
children 9a49c83cb360
files build-aux/mk-octave-config-h.sh oct-conf-post.in.h
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/build-aux/mk-octave-config-h.sh	Tue Feb 23 13:10:19 2016 -0800
+++ b/build-aux/mk-octave-config-h.sh	Tue Feb 23 15:08:24 2016 -0800
@@ -95,7 +95,11 @@
 #include <stdint.h>
 
 #if defined (__GNUC__)
-#  define OCTAVE_DEPRECATED(msg) __attribute__ ((__deprecated__ (msg)))
+#  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+#    define OCTAVE_DEPRECATED(msg) __attribute__ ((__deprecated__ (msg)))
+#  else
+#    define OCTAVE_DEPRECATED(msg) __attribute__ ((__deprecated__))
+#  endif
 #  define OCTAVE_NORETURN __attribute__ ((__noreturn__))
 #  define OCTAVE_UNUSED __attribute__ ((__unused__))
 
--- a/oct-conf-post.in.h	Tue Feb 23 13:10:19 2016 -0800
+++ b/oct-conf-post.in.h	Tue Feb 23 15:08:24 2016 -0800
@@ -36,7 +36,11 @@
 
 #if defined (__GNUC__)
    /* The following attributes are used with gcc and clang compilers.  */
-#  define OCTAVE_DEPRECATED(msg) __attribute__ ((__deprecated__ (msg)))
+#  if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+#    define OCTAVE_DEPRECATED(msg) __attribute__ ((__deprecated__ (msg)))
+#  else
+#    define OCTAVE_DEPRECATED(msg) __attribute__ ((__deprecated__))
+#  endif
 #  define HAVE_OCTAVE_DEPRECATED_ATTR 1
 
 #  define OCTAVE_NORETURN __attribute__ ((__noreturn__))