| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: make.h,v 1.160 2020/10/19 23:43:55 rillig Exp $ */ | | 1 | /* $NetBSD: make.h,v 1.161 2020/10/23 17:59:25 rillig Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1988, 1989, 1990, 1993 | | 4 | * Copyright (c) 1988, 1989, 1990, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Adam de Boor. | | 8 | * Adam de Boor. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -134,26 +134,32 @@ | | | @@ -134,26 +134,32 @@ |
134 | * A boolean type is defined as an integer, not an enum, for historic reasons. | | 134 | * A boolean type is defined as an integer, not an enum, for historic reasons. |
135 | * The only allowed values are the constants TRUE and FALSE (1 and 0). | | 135 | * The only allowed values are the constants TRUE and FALSE (1 and 0). |
136 | */ | | 136 | */ |
137 | | | 137 | |
138 | #ifdef USE_DOUBLE_BOOLEAN | | 138 | #ifdef USE_DOUBLE_BOOLEAN |
139 | /* During development, to find type mismatches in function declarations. */ | | 139 | /* During development, to find type mismatches in function declarations. */ |
140 | typedef double Boolean; | | 140 | typedef double Boolean; |
141 | #elif defined(USE_UCHAR_BOOLEAN) | | 141 | #elif defined(USE_UCHAR_BOOLEAN) |
142 | /* During development, to find code that depends on the exact value of TRUE or | | 142 | /* During development, to find code that depends on the exact value of TRUE or |
143 | * that stores other values in Boolean variables. */ | | 143 | * that stores other values in Boolean variables. */ |
144 | typedef unsigned char Boolean; | | 144 | typedef unsigned char Boolean; |
145 | #define TRUE ((unsigned char)0xFF) | | 145 | #define TRUE ((unsigned char)0xFF) |
146 | #define FALSE ((unsigned char)0x00) | | 146 | #define FALSE ((unsigned char)0x00) |
| | | 147 | #elif defined(USE_CHAR_BOOLEAN) |
| | | 148 | /* During development, to find code that uses a boolean as array index, via |
| | | 149 | * -Wchar-subscripts. */ |
| | | 150 | typedef char Boolean; |
| | | 151 | #define TRUE ((char)-1) |
| | | 152 | #define FALSE ((char)0x00) |
147 | #elif defined(USE_ENUM_BOOLEAN) | | 153 | #elif defined(USE_ENUM_BOOLEAN) |
148 | typedef enum Boolean { FALSE, TRUE } Boolean; | | 154 | typedef enum Boolean { FALSE, TRUE } Boolean; |
149 | #else | | 155 | #else |
150 | typedef int Boolean; | | 156 | typedef int Boolean; |
151 | #endif | | 157 | #endif |
152 | #ifndef TRUE | | 158 | #ifndef TRUE |
153 | #define TRUE 1 | | 159 | #define TRUE 1 |
154 | #endif | | 160 | #endif |
155 | #ifndef FALSE | | 161 | #ifndef FALSE |
156 | #define FALSE 0 | | 162 | #define FALSE 0 |
157 | #endif | | 163 | #endif |
158 | | | 164 | |
159 | #include "lst.h" | | 165 | #include "lst.h" |