Hello,

A sparc solaris user reported a _Bool-related problem to gnuplot tracker.

Long story short: stdbool.h is absent, _Bool is defined in C, but not
in C++. Current header file in gnuplot sources which is used both in C
and C++ goes like

# if ! HAVE__BOOL
#  ifdef __cplusplus
typedef bool _Bool;
#  else
typedef unsigned char _Bool;
#  endif
# endif

But there is a problem. If
    AC_HEADER_STDBOOL
is called with C compiler, it would figure out that _Bool is defined
and thus skip defining _Bool in C++. If the macro is called with C++
compiler, it would figure out that _Bool is undefined and try to
define it for C as well. In either case compilation fails.

My question is: what is the proper way to test for existence of _Bool
in C and C++ separately? Something like this should work in the header
file:

# ifdef __cplusplus
#  if !HAVE__BOOL_IN_CXX
typedef bool _Bool;
#  endif
# else
#  if !HAVE__BOOL_IN_C
typedef unsigned char _Bool;
#  endif
# endif

but I don't know what would be the proper way to get HAVE__BOOL_IN_CXX
& HAVE__BOOL_IN_C without completely (re)defining AC_HEADER_STDBOOL
macro.

Thank you,
    Mojca

_______________________________________________
Autoconf mailing list
Autoconf@gnu.org
https://lists.gnu.org/mailman/listinfo/autoconf

Reply via email to