A number of small build fixes found while looking at mingw support.
[m6w6/libmemcached] / libmemcached / csl / scanner.l
index e9957408fa27d9f1ac4e0cedf8c8de98356b23c5..e35008a8da37f768e1f5c62206b84738a6098f33 100644 (file)
 #pragma GCC diagnostic ignored "-Wunused-parameter"
 #pragma GCC diagnostic ignored "-Wmissing-declarations"
 #pragma GCC diagnostic ignored "-Wunused-result"
-#pragma GCC diagnostic ignored "-Wshorten-64-to-32"
 #pragma GCC diagnostic ignored "-Wmissing-noreturn"
 #endif
 
+#ifdef __clang__
+#pragma GCC diagnostic ignored "-Wshorten-64-to-32"
+#endif
+
+#ifndef __INTEL_COMPILER
+#ifndef __clang__
+#pragma GCC diagnostic ignored "-Wlogical-op"
+#endif
+#endif
+
 #define YY_EXTRA_TYPE Context*
 
 }
 
 
 %{
-#include <cstdlib>
-#include <cstring>
-
 #define PARAM yyget_extra(yyscanner)
 
 #define get_lex_chars(buffer, result, max_size, context) \
 
 "--SERVER="                          { yyextra->begin= yytext; yyextra->set_server(); return yyextra->previous_token= SERVER; }
 
-"--SOCKET="                          { yyextra->begin= yytext; return yyextra->previous_token= SOCKET; }
+"--SOCKET="                          { yyextra->begin= yytext; return yyextra->previous_token= CSL_SOCKET; }
 
 "--BINARY-PROTOCOL"                    { yyextra->begin= yytext; return yyextra->previous_token= BINARY_PROTOCOL; }
 "--BUFFER-REQUESTS"                    { yyextra->begin= yytext; return yyextra->previous_token= BUFFER_REQUESTS; }
@@ -163,10 +169,10 @@ RESET           { yyextra->begin= yytext; return yyextra->previous_token= RESET;
 DEBUG           { yyextra->begin= yytext; return yyextra->previous_token= PARSER_DEBUG; }
 SERVERS           { yyextra->begin= yytext; return yyextra->previous_token= SERVERS; }
 END           { yyextra->begin= yytext; return yyextra->previous_token= END; }
-ERROR           { yyextra->begin= yytext; return yyextra->previous_token= ERROR; }
+CSL_ERROR           { yyextra->begin= yytext; return yyextra->previous_token= CSL_ERROR; }
 
-TRUE           { return yyextra->previous_token= TRUE; }
-FALSE           { return yyextra->previous_token= FALSE; }
+TRUE           { return yyextra->previous_token= CSL_TRUE; }
+FALSE           { return yyextra->previous_token= CSL_FALSE; }
 
 
 "--"[[:alnum:]]*   {