- Win32 has no strings.h
[cparser] / lexer.c
diff --git a/lexer.c b/lexer.c
index fbed584..4efc5bb 100644 (file)
--- a/lexer.c
+++ b/lexer.c
 #include <stdbool.h>
 #include <ctype.h>
 
+#ifndef _WIN32
+#include <strings.h>
+#endif
+
 //#define DEBUG_CHARS
 #define MAX_PUTBACK 3
 #define BUF_SIZE    1024
 
 #if defined(_WIN32) || defined(__CYGWIN__)
 /* No strtold on windows and no replacement yet */
-#define strtold(s, e) strtod(s, e)
+#define strtold(s, e)     strtod(s, e)
+#define strcasecmp(a, b)  stricmp(a, b)
 #endif
 
 typedef unsigned int utf32;
@@ -633,7 +638,8 @@ static void parse_floating_suffix(void)
  * A replacement for strtoull. Only those parts needed for
  * our parser are implemented.
  */
-static unsigned long long parse_int_string(const char *s, const char **endptr, int base) {
+static unsigned long long parse_int_string(const char *s, const char **endptr, int base)
+{
        unsigned long long v = 0;
 
        switch (base) {
@@ -1578,7 +1584,8 @@ typedef enum stdc_pragma_value_kind_t {
 /**
  * Parse a pragma directive.
  */
-static void parse_pragma(void) {
+static void parse_pragma(void)
+{
        bool unknown_pragma = true;
 
        next_pp_token();