bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] cpp: make the check of Flex version portable


From: Théophile Ranquet
Subject: Re: [PATCH] cpp: make the check of Flex version portable
Date: Thu, 6 Dec 2012 17:27:34 +0100

The following minor and stylistic changes might be a nice addition, if
we are to consider that YY_FLEX_MINOR_VERSION will always be defined.

commit a0ae2d1bdd18ec2174bd849362c9b4238af40713
Author: Theophile Ranquet <address@hidden>
Date:   Thu Dec 6 13:21:36 2012 +0100

    cpp: improve the Flex version checking macro

    * src/flex-scanner.h (FLEX_VERSION): Here.

diff --git a/src/flex-scanner.h b/src/flex-scanner.h
index 028082e..dbb01db 100644
--- a/src/flex-scanner.h
+++ b/src/flex-scanner.h
@@ -21,18 +21,18 @@
 # error "FLEX_PREFIX not defined"
 #endif

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]