diff --git a/autogen/config.in b/autogen/config.in
index 8852686c360..8a8799db1cf 100644
--- a/autogen/config.in
+++ b/autogen/config.in
@@ -1522,7 +1522,9 @@ along with GNU Emacs. If not, see . */
.
_GL_INLINE_HEADER_END contains useful stuff to put
in the same include file, after uses of _GL_INLINE. */
-#if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__
+#if (__GNUC__ \
+ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+ : 199901L <= __STDC_VERSION__)
# define _GL_INLINE inline
# define _GL_EXTERN_INLINE extern inline
#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
@@ -1539,7 +1541,7 @@ along with GNU Emacs. If not, see . */
#endif
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
-# if __GNUC_STDC_INLINE__
+# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
# define _GL_INLINE_HEADER_CONST_PRAGMA
# else
# define _GL_INLINE_HEADER_CONST_PRAGMA \