comparison mercurial/util.h @ 24823:3550ccbafca2 stable

util.h: also sniff for C99 before trying to use stdbool.h (issue4605) stdbool.h isn't required until C99. Sigh.
author Augie Fackler <augie@google.com>
date Mon, 20 Apr 2015 14:47:51 -0400
parents 1c533e23ce95
children 8e9f8d2a2c0c
comparison
equal deleted inserted replaced
24822:8678b1eafbcf 24823:3550ccbafca2
216 NORMCASE_OTHER = 0 216 NORMCASE_OTHER = 0
217 }; 217 };
218 218
219 #define MIN(a, b) (((a)<(b))?(a):(b)) 219 #define MIN(a, b) (((a)<(b))?(a):(b))
220 /* VC9 doesn't include bool and lacks stdbool.h based on my searching */ 220 /* VC9 doesn't include bool and lacks stdbool.h based on my searching */
221 #ifdef _MSC_VER 221 #ifdef _MSC_VER || __STDC_VERSION__ < 199901L
222 #define true 1 222 #define true 1
223 #define false 0 223 #define false 0
224 typedef unsigned char bool; 224 typedef unsigned char bool;
225 #else 225 #else
226 #include <stdbool.h> 226 #include <stdbool.h>