From b10d04210dd4452f88e90bec381abb54e89a0c1b Mon Sep 17 00:00:00 2001
From: Akim Demaille <akim@lrde.epita.fr>
Date: Wed, 9 May 2012 10:35:42 +0200
Subject: [PATCH] config.h: avoid -Wundef warnings.

* m4/gnulib-common.m4 (isoc99_inline, _Noreturn): Check that
__STDC_VERSION__ is defined before using its value.
---
 ChangeLog           |    6 ++++++
 m4/gnulib-common.m4 |    7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ba38632..bcc707b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-09  Akim Demaille  <akim@lrde.epita.fr>
+
+	config.h: avoid -Wundef warnings.
+	* m4/gnulib-common.m4 (isoc99_inline, _Noreturn): Check that
+	__STDC_VERSION__ is defined before using its value.
+
 2012-05-08  Bruno Haible  <bruno@clisp.org>
 
 	execute, spawn-pipe: Escape '*' characters in arguments on Windows.
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index ab3c43d..aa27a07 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -14,7 +14,7 @@ AC_DEFUN([gl_COMMON], [
 AC_DEFUN([gl_COMMON_BODY], [
   AH_VERBATIM([_Noreturn],
 [/* The _Noreturn keyword of C11.  */
-#if !defined _Noreturn && __STDC_VERSION__ < 201112
+#if !defined _Noreturn && defined __STDC_VERSION__ && __STDC_VERSION__ < 201112
 # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
       || 0x5110 <= __SUNPRO_C)
 #  define _Noreturn __attribute__ ((__noreturn__))
@@ -32,7 +32,10 @@ AC_DEFUN([gl_COMMON_BODY], [
    __APPLE__ && __MACH__ test for MacOS X.
    __APPLE_CC__ tests for the Apple compiler and its version.
    __STDC_VERSION__ tests for the C99 mode.  */
-#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
+#if (!defined __GNUC_STDC_INLINE__ \
+     && defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 \
+     && !defined __cplusplus \
+     && defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
 # define __GNUC_STDC_INLINE__ 1
 #endif])
   AH_VERBATIM([unused_parameter],
-- 
1.7.10.1

