diff src/dmlib.h @ 2586:9807ae37ad69

Require stdbool.h, we require C11 now.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 08 Dec 2022 15:59:22 +0200
parents ef6c826c5b7a
children 0f351e291319
line wrap: on
line diff
--- a/src/dmlib.h	Thu Dec 08 15:56:36 2022 +0200
+++ b/src/dmlib.h	Thu Dec 08 15:59:22 2022 +0200
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include <inttypes.h>
+#include <stdbool.h>
 #include <string.h>
 
 
@@ -190,21 +191,6 @@
 #define DMRES_RES_FILE         "res.txt"   // Resource data file
 
 
-/* Define a boolean type
- */
-#if !defined(FALSE) && !defined(TRUE) && !defined(BOOL)
-typedef enum { FALSE = 0, TRUE = 1 } BOOL;
-#endif
-
-#ifndef BOOL
-#  ifdef bool
-#    define BOOL bool
-#  else
-#    define BOOL int
-#  endif
-#endif
-
-
 /* Math constants
  */
 #define DM_PI                  3.14159265358f
@@ -474,7 +460,7 @@
 
 char *     dm_strrcasecmp(char *str, const char *needle);
 
-BOOL       dmGetIntVal(const char *str, unsigned int *value, BOOL *neg);
+bool       dmGetIntVal(const char *str, unsigned int *value, bool *neg);
 
 
 /* Mutexes
@@ -483,7 +469,7 @@
 
 typedef struct
 {
-    BOOL used;
+    bool used;
     Uint32 id;
     int state;
 } DMMutexLock;