diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-03-01 13:57:40 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-03-01 13:57:40 -0800 |
commit | 1fb908c0dbf5bdde4d4aaaf78b48b6520d52de4c (patch) | |
tree | f4850a76f97b9bdfa7885f56bba70e2285a045c4 /aclocal.m4 | |
parent | 16a856cd851858f80b1ef407d77f92df309e5909 (diff) | |
download | nasm-1fb908c0dbf5bdde4d4aaaf78b48b6520d52de4c.tar.gz nasm-1fb908c0dbf5bdde4d4aaaf78b48b6520d52de4c.tar.bz2 nasm-1fb908c0dbf5bdde4d4aaaf78b48b6520d52de4c.zip |
autoconf: detect the broken bool in OpenWatcom 1.8
OpenWatcom 1.8 has a C99 mode, which implements _Bool and
<stdbool.h>. Unfortunately the implementation is broken, and doesn't
let _Bool be implicitly converted to integer (as required by the C99
spec). Detect this case in autoconf.
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -13,3 +13,27 @@ AC_DEFUN(PA_ADD_CFLAGS, AC_MSG_RESULT([no]) CFLAGS="$pa_add_cflags__old_cflags")]) +dnl -------------------------------------------------------------------------- +dnl PA_WORKING_STDBOOL +dnl +dnl See if we have a working <stdbool.h> and bool support; in particular, +dnl OpenWatcom 1.8 has a broken _Bool type that we don't want to use. +dnl -------------------------------------------------------------------------- +AC_DEFUN(PA_WORKING_BOOL, +[AC_MSG_CHECKING([if $CC has a working bool type]) + AC_COMPILE_IFELSE( + [ +#ifndef __cplusplus +#include <stdbool.h> +#endif +int foo(bool x, int y) +{ + return x+y; +} + ], + [AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_WORKING_BOOL, 1, + [Define to 1 if your compiler has a correct implementation of bool])], + [AC_MSG_RESULT([no])]) +]) + |