Skip Menu |

This queue is for tickets about the Date-Calc CPAN distribution.

Report information
The Basics
Id: 102157
Status: open
Priority: 0/
Queue: Date-Calc

People
Owner: Nobody in particular
Requestors: michael.rash [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 6.3
Fixed in: (no value)



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
On Mon Feb 16 15:21:14 2015, MRASH wrote: Show quoted text
> 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
Somehow this patch does not apply to Date::Calc version 6.3. The relevant piece of code in version 6.3 is: #undef FALSE #define FALSE (0!=0) #undef TRUE #define TRUE (0==0) #ifdef __cplusplus typedef bool boolean; #else #ifdef MACOS_TRADITIONAL #define boolean Boolean #elif PERL_DARWIN #define boolean bool #else typedef int boolean; #ifndef I_STDBOOL enum { false, true }; #endif #endif #endif