Subject: | ToolBox.h boolean compilation issue |
Hi,
Version: Date-Calc-6.3
Perl: 5.18.4 x86_64
Platform: Fedora 21
Compiler: gcc version 4.9.2 20150212 (Red Hat 4.9.2-6) (GCC)
Error:
$ make
gcc -c -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DVERSION=\"6.3\" -DXS_VERSION=\"6.3\" -fPIC "-I/usr/lib64/perl5/CORE" Calc.c
In file included from /usr/lib64/perl5/CORE/handy.h:73:0,
from /usr/lib64/perl5/CORE/perl.h:2513,
from Calc.xs:15:
ToolBox.h:92:24: error: expected identifier before numeric constant
typedef enum { false = FALSE, true = TRUE } boolean;
^
Makefile:394: recipe for target 'Calc.o' failed
make: *** [Calc.o] Error 1
Suggested Fix:
diff --git a/deps/Date-Calc/ToolBox.h b/deps/Date-Calc/ToolBox.h
index 08b2cee..0e48518 100644
--- a/deps/Date-Calc/ToolBox.h
+++ b/deps/Date-Calc/ToolBox.h
@@ -89,6 +89,12 @@ typedef Z_longword *Z_longwordptr;
#ifdef MACOS_TRADITIONAL
#define boolean Boolean
#else
+ #ifdef true
+ #undef true
+ #endif
+ #ifdef false
+ #undef false
+ #endif
typedef enum { false = FALSE, true = TRUE } boolean;
#endif
#endif