wimlib.h: define bool for old MSVC versions
authorEric Biggers <ebiggers3@gmail.com>
Sun, 27 Nov 2016 23:24:38 +0000 (15:24 -0800)
committerEric Biggers <ebiggers3@gmail.com>
Mon, 28 Nov 2016 02:35:31 +0000 (18:35 -0800)
It's also unnecessary to define bool in C++ mode.

include/wimlib.h

index d22eb58..944c48c 100644 (file)
 
 #include <stdio.h>
 #include <stddef.h>
-#include <stdbool.h>
+#ifndef __cplusplus
+#  if defined(_MSC_VER) && _MSC_VER < 1800 /* VS pre-2013? */
+     typedef unsigned char bool;
+#  else
+#    include <stdbool.h>
+#  endif
+#endif
 #include <stdint.h>
 #include <time.h>