cpp: improve the Flex version checking macro

* src/flex-scanner.h (FLEX_VERSION): Here.
This commit is contained in:
Theophile Ranquet
2012-12-06 13:21:36 +01:00
parent dbda560400
commit c49e2f1535

View File

@@ -21,18 +21,18 @@
# error "FLEX_PREFIX not defined" # error "FLEX_PREFIX not defined"
#endif #endif
/* Whether this version of Flex is (strictly) greater than /* Flex full version as a number. */
Major.Minor.Subminor. */
#ifdef YY_FLEX_SUBMINOR_VERSION #ifdef YY_FLEX_SUBMINOR_VERSION
# define FLEX_VERSION \ # define FLEX_VERSION \
(YY_FLEX_MAJOR_VERSION) * 1000000 \ ((YY_FLEX_MAJOR_VERSION) * 1000000 \
+ (YY_FLEX_MINOR_VERSION) * 1000 \ + (YY_FLEX_MINOR_VERSION) * 1000 \
+ (YY_FLEX_SUBMINOR_VERSION) + (YY_FLEX_SUBMINOR_VERSION))
#else #else
# define FLEX_VERSION \ # define FLEX_VERSION \
(YY_FLEX_MAJOR_VERSION) * 1000000 \ ((YY_FLEX_MAJOR_VERSION) * 1000000 \
+ (YY_FLEX_MINOR_VERSION) * 1000 + (YY_FLEX_MINOR_VERSION) * 1000)
#endif #endif
/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */ /* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */
# if FLEX_VERSION <= 2005031 # if FLEX_VERSION <= 2005031
int FLEX_PREFIX (get_lineno) (void); int FLEX_PREFIX (get_lineno) (void);