Export <slot> from GOOPS
[bpt/guile.git] / libguile / c-tokenize.lex
index 8859629..03fe989 100644 (file)
@@ -1,3 +1,14 @@
+%top{
+/* Include <config.h> before anything else because Gnulib headers such
+   as <stdio.h> rely on it.
+
+   However, when cross-compiling, don't include <config.h> because it
+   contains information about the host, not about the build.  */
+#ifndef CROSS_COMPILING
+# include <config.h>
+#endif
+}
+
 %option noyywrap
 %option nounput
 %pointer
@@ -14,13 +25,15 @@ FLOQUAL             (f|F|l|L)
 INTQUAL                (l|L|ll|LL|lL|Ll|u|U)
 
 %{
-    
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-int yylex(void);
-  
+/* Prevent compilation of static input() function in generated scanner
+   code.  This function is never actually used, and GCC 4.3 will emit
+   an error for that. */
+#define YY_NO_INPUT
+
 int filter_snarfage = 0;
 int print = 1; 
 
@@ -53,7 +66,7 @@ int cookie_was_last = 0;
 
 ({SPACE}*\n*{SPACE}*)+                     { OUT(eol); }
 
-#                                          { OUT(hash); IS_NOT_COOKIE; }
+#.*\n                                      { OUT(hash); IS_NOT_COOKIE; }
 
 {LETTER}({LETTER}|{DIGIT})*                { OUT_T (id); IS_NOT_COOKIE; }