# HG changeset patch # User David A. Holland # Date 1434094099 14400 # Node ID 4c3375895c6ec701880952d7b37672d44b617d3b # Parent f7814226906ca00d936693b64d9214c352599cbf Don't use unless __STDC__ is large enough. Works around Solaris's broken environment. diff -r f7814226906c -r 4c3375895c6e CHANGES --- a/CHANGES Fri Jun 12 03:21:36 2015 -0400 +++ b/CHANGES Fri Jun 12 03:28:19 2015 -0400 @@ -1,4 +1,6 @@ pending + - Don't rely on existing, as (predictably) it doesn't + work on Solaris. - Typo fix in man page from Jason McIntyre; and change "Usage" to "usage" in usage for pedantic reasons, from Igor Sobrado. - Accept "-" as either input or output file name to mean stdin or diff -r f7814226906c -r 4c3375895c6e bool.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bool.h Fri Jun 12 03:28:19 2015 -0400 @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2015 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by David A. Holland. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef BOOL_H +#define BOOL_H + +#if __STDC__ > 199901 +#include +#else +typedef int bool; +#define true 1 +#define false 0 +#endif + +#endif /* BOOL_H */ diff -r f7814226906c -r 4c3375895c6e directive.c --- a/directive.c Fri Jun 12 03:21:36 2015 -0400 +++ b/directive.c Fri Jun 12 03:28:19 2015 -0400 @@ -28,12 +28,12 @@ */ #include -#include #include #include #include #include +#include "bool.h" #include "utils.h" #include "mode.h" #include "place.h" diff -r f7814226906c -r 4c3375895c6e eval.h --- a/eval.h Fri Jun 12 03:21:36 2015 -0400 +++ b/eval.h Fri Jun 12 03:28:19 2015 -0400 @@ -27,6 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include +#include "bool.h" bool eval(struct place *p, char *expr); diff -r f7814226906c -r 4c3375895c6e files.c --- a/files.c Fri Jun 12 03:21:36 2015 -0400 +++ b/files.c Fri Jun 12 03:28:19 2015 -0400 @@ -27,7 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include @@ -35,6 +34,7 @@ #include #include +#include "bool.h" #include "array.h" #include "mode.h" #include "place.h" diff -r f7814226906c -r 4c3375895c6e macro.h --- a/macro.h Fri Jun 12 03:21:36 2015 -0400 +++ b/macro.h Fri Jun 12 03:28:19 2015 -0400 @@ -27,8 +27,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include +#include "bool.h" struct place; diff -r f7814226906c -r 4c3375895c6e main.c --- a/main.c Fri Jun 12 03:21:36 2015 -0400 +++ b/main.c Fri Jun 12 03:28:19 2015 -0400 @@ -27,13 +27,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include #include #include +#include "bool.h" #include "version.h" #include "config.h" #include "utils.h" diff -r f7814226906c -r 4c3375895c6e mode.h --- a/mode.h Fri Jun 12 03:21:36 2015 -0400 +++ b/mode.h Fri Jun 12 03:28:19 2015 -0400 @@ -27,7 +27,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include +#include "bool.h" struct mode { bool werror; diff -r f7814226906c -r 4c3375895c6e place.h --- a/place.h Fri Jun 12 03:21:36 2015 -0400 +++ b/place.h Fri Jun 12 03:28:19 2015 -0400 @@ -30,7 +30,7 @@ #ifndef PLACE_H #define PLACE_H -#include +#include "bool.h" enum places { P_NOWHERE, diff -r f7814226906c -r 4c3375895c6e utils.h --- a/utils.h Fri Jun 12 03:21:36 2015 -0400 +++ b/utils.h Fri Jun 12 03:28:19 2015 -0400 @@ -27,8 +27,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include #include +#include "bool.h" struct place;