]> Savannah Git Hosting - gnulib.git/commitdiff
stdbool: Mostly revert last patch.
authorBruno Haible <bruno@clisp.org>
Sun, 25 Sep 2022 14:38:19 +0000 (16:38 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 25 Sep 2022 14:38:19 +0000 (16:38 +0200)
* m4/c-bool.m4 (gl_C_BOOL): If stdbool.h does not exist, just err out.
* modules/stdbool (Files): Remove m4/stdbool.m4.

ChangeLog
m4/c-bool.m4
modules/stdbool

index 1c54eabb49e3d4a6b42e083a246c6ffe0da1a99b..24553445f6e24cb780c474bd3db8f9e1bbf3338d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,16 @@
+2022-09-25  Bruno Haible  <bruno@clisp.org>
+
+       stdbool: Mostly revert last patch.
+       * m4/c-bool.m4 (gl_C_BOOL): If stdbool.h does not exist, just err out.
+       * modules/stdbool (Files): Remove m4/stdbool.m4.
+
 2022-09-24  Bruno Haible  <bruno@clisp.org>
 
        stdbool: Don't #include a gnulib-generated stdbool.h from config.h.
        * m4/c-bool.m4 (gl_C_BOOL): Check for stdbool.h and for _Bool. If
        stdbool.h does not exist, don't #include <stdbool.h> but instead put the
        substitute code into config.h.
+       * modules/stdbool (Files): Add m4/stdbool.m4.
 
 2022-09-24  Bruno Haible  <bruno@clisp.org>
 
index 129981d2f7e709d6e9e38aa3a6804d74ff7cd6a8..bb109b7796868134323647f8e268c95418cc809f 100644 (file)
@@ -23,8 +23,6 @@ AC_DEFUN([gl_C_BOOL],
   fi
 
   AC_CHECK_HEADERS_ONCE([stdbool.h])
-  AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
-  AC_DEFINE_UNQUOTED([HAVE__BOOL],[$HAVE__BOOL])
 
   dnl The "zz" puts this toward config.h's end, to avoid potential
   dnl collisions with other definitions.
@@ -39,39 +37,11 @@ AC_DEFUN([gl_C_BOOL],
 #  if HAVE_STDBOOL_H
 #   include <stdbool.h>
 #  else
-    /* Substitute.  Keep consistent with gnulib/lib/stdbool.in.h.  */
-#   ifndef _GL_STDBOOL_H
-#    define _GL_STDBOOL_H
-#    ifdef __cplusplus
-#     if !defined _MSC_VER
-#      define _Bool bool
-#      define bool bool
-#     endif
-#    else
-#     if !defined __GNUC__
-#      define _Bool signed char
-#     else
-#      if !HAVE__BOOL
-typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
-#      endif
-#     endif
-#     define bool _Bool
-#    endif
-#    ifdef __cplusplus
-#     if !defined _MSC_VER
-#      define false false
-#      define true true
-#     endif
-#     if defined __SUNPRO_CC && true != 1
-#      undef true
-#      define true (!false)
-#     endif
-#    else
-#     define false 0
-#     define true 1
-#    endif
-#    define __bool_true_false_are_defined 1
-#   endif /* _GL_STDBOOL_H */
+#   if defined __SUNPRO_C
+#    error "<stdbool.h> is not usable with this configuration. To make it usable, add -D_STDC_C99= to $CC."
+#   else
+#    error "<stdbool.h> does not exist on this platform. Use gnulib module 'stdbool-c99' instead of gnulib module 'stdbool'."
+#   endif
 #  endif
 # endif
 # if !true
index 664df5e0f8f00aa18c9e7d1d53627bfd98c8b49d..2e771a23369385cf4378d8e18302cc4023561bdb 100644 (file)
@@ -3,7 +3,6 @@ A bool that is like C23.
 
 Files:
 m4/c-bool.m4
-m4/stdbool.m4
 
 Depends-on:
 c99