Flex >= 2.5.35 declares it's own functions properly now, so omit our defs for it.
authorMarko Kreen <markokr@gmail.com>
Tue, 16 Mar 2010 20:54:41 +0000 (22:54 +0200)
committerMarko Kreen <markokr@gmail.com>
Tue, 16 Mar 2010 21:01:19 +0000 (23:01 +0200)
That also avoid the signature confict on macos 10.6 which seems to have changed
the signatures from original ones.

src/scanner.l

index 4b83a3e915907e7a05d4e4c38d566e795dd40ad7..b53684aab8aaa14cbe5599530670b701f8e334c0 100644 (file)
 extern PGDLLIMPORT bool standard_conforming_strings;
 #endif
 
+/*
+ * Calculare numeric flex version.
+ */
+#if !defined(YY_FLEX_MAJOR_VERSION) || !defined(YY_FLEX_MINOR_VERSION)
+#error Flex required
+#endif
+#ifndef YY_FLEX_SUBMINOR_VERSION
+#define YY_FLEX_SUBMINOR_VERSION 0
+#endif
+#define FLXVER ((YY_FLEX_MAJOR_VERSION*1000 + YY_FLEX_MINOR_VERSION)*1000 + YY_FLEX_SUBMINOR_VERSION)
+
 /* shut down crappy flex warnings */
+#if FLXVER < 2005035
 int yyget_lineno(void);
 int yyget_leng(void);
 FILE *yyget_in(void);
@@ -44,6 +56,7 @@ void plproxy_yyset_out(FILE *);
 int plproxy_yyget_debug(void);
 void plproxy_yyset_debug(int);
 int plproxy_yylex_destroy(void);
+#endif
 
 /* point to parser value */
 #define yylval plproxy_yylval
@@ -62,17 +75,6 @@ int plproxy_yylex_destroy(void);
 #define free(p) do { if (p) pfree(p); } while (0)
 
 
-/*
- * Calculare numeric flex version.
- */
-#if !defined(YY_FLEX_MAJOR_VERSION) || !defined(YY_FLEX_MINOR_VERSION)
-#error Flex required
-#endif
-#ifndef YY_FLEX_SUBMINOR_VERSION
-#define YY_FLEX_SUBMINOR_VERSION 0
-#endif
-#define FLXVER ((YY_FLEX_MAJOR_VERSION*1000 + YY_FLEX_MINOR_VERSION)*1000 + YY_FLEX_SUBMINOR_VERSION)
-
 void plproxy_yylex_startup(void)
 {
        /* there may be stale pointers around, drop them */