[Top][All Lists]
[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: |
Fri, 7 Dec 2012 11:15:14 +0100 |
2012/12/6 Akim Demaille <address@hidden>:
>
> Le 6 déc. 2012 à 17:27, Théophile Ranquet <address@hidden> a écrit :
>
>> 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.
>
> You are right: according to their documentation, it will always be. You
> may even simplify the SUBMINOR part and consider it defined.
>
Oh, so are we now considering the following?
commit 9318e335c809a832078e8efad4054cbb456ad1da
Author: Theophile Ranquet <address@hidden>
Date: Fri Dec 7 12:13:38 2012 +0100
cpp: simplify the Flex version checking macro
* src/flex-scanner,h (FLEX_VERSION): Consider YY_FLEX_SUBMINOR_VERSION
defined.
diff --git a/src/flex-scanner.h b/src/flex-scanner.h
index dbb01db..c854c29 100644
--- a/src/flex-scanner.h
+++ b/src/flex-scanner.h
@@ -22,16 +22,10 @@
#endif
/* Flex full version as a number. */
-#ifdef YY_FLEX_SUBMINOR_VERSION
-# define FLEX_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)
-#endif
/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */
# if FLEX_VERSION <= 2005031