diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index 0fa7dd00e870..14136464835d 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.264 2021/07/31 09:30:17 rillig Exp $ */ +/* $NetBSD: make.h,v 1.265 2021/09/12 09:51:14 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -142,18 +142,25 @@ #if __STDC_VERSION__ >= 199901L || defined(lint) || defined(USE_C99_BOOLEAN) #include +#elif defined(__bool_true_false_are_defined) +/* + * All files of make must be compiled with the same definition of bool. + * Since one of the files includes , that means the header is + * available on this platform. Recompile everything with -DUSE_C99_BOOLEAN. + */ +#error " is included in pre-C99 mode" +#elif defined(bool) || defined(true) || defined(false) +/* + * In pre-C99 mode, make does not expect that bool is already defined. + * You need to ensure that all translation units use the same definition for + * bool. + */ +#error "bool/true/false is defined in pre-C99 mode" #else -#ifndef bool -typedef unsigned int Boolean; -#define bool Boolean -#endif -#ifndef true +typedef unsigned char bool; #define true 1 -#endif -#ifndef false #define false 0 #endif -#endif #include "lst.h" #include "enum.h" diff --git a/usr.bin/make/test-variants.sh b/usr.bin/make/test-variants.sh index 5668aa2016a0..8477f142bea3 100644 --- a/usr.bin/make/test-variants.sh +++ b/usr.bin/make/test-variants.sh @@ -1,5 +1,5 @@ #! /bin/sh -# $NetBSD: test-variants.sh,v 1.10 2021/04/03 11:08:40 rillig Exp $ +# $NetBSD: test-variants.sh,v 1.11 2021/09/12 09:51:14 rillig Exp $ # # Build several variants of make and run the tests on them. # @@ -22,7 +22,7 @@ testcase() { env -i PATH="$PATH" USETOOLS="no" "$@" \ sh -ce "make -s cleandir" \ && env -i PATH="$PATH" USETOOLS="no" "$@" \ - sh -ce "make -ks all" \ + sh -ce "make -ks -j6 dependall" \ && size *.o make \ && env -i PATH="$PATH" USETOOLS="no" MALLOC_OPTIONS="JA" \ _MKMSG_TEST=":" "$@" \ @@ -120,10 +120,16 @@ testcase USER_CFLAGS="-O0 -ggdb" # Ensure that every inline function is declared as MAKE_ATTR_UNUSED. testcase USER_CPPFLAGS="-Dinline=" +# Is expected to fail with " is included in pre-C99 mode". testcase USER_CFLAGS="-std=c90" USER_CPPFLAGS="-Dinline=" +# This workaround is necessary on NetBSD 9.99 since main.c includes +# , which includes even in pre-C99 mode. +testcase USER_CFLAGS="-std=c90" USER_CPPFLAGS="-Dinline= -DUSE_C99_BOOLEAN" + #testcase USER_CFLAGS="-std=c90 -pedantic" USER_CPPFLAGS="-Dinline=" +# Is expected to fail with " is included in pre-C99 mode". testcase USER_CFLAGS="-ansi" USER_CPPFLAGS="-Dinline=" # config.h does not allow overriding these features