Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Time-HiRes CPAN distribution.

Report information
The Basics
Id:
21118
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
jdhedden [...] cpan.org
Cc:
AdminCc:



Subject: IV_1E7LL undeclared under Cygwin Perl 5.8.8
'make' produces the following error under Perl 5.8.8 on Cygwin: gcc -c -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -Wdeclaration-after-statement -DUSEIMPORTLIB -O3 -pipe -funit-at-a-time -mtune=pentium4m -march=pentium4 -mfpmath=sse -mieee-fp -mmmx -msse -msse2 -DVERSION=\"1.88\" -DXS_VERSION=\"1.88\" "-I/usr/lib/perl5/5.8/cygwin/CORE" -DTIME_HIRES_NANOSLEEP -DTIME_HIRES_CLOCK_GETTIME -DTIME_HIRES_CLOCK_GETRES -DTIME_HIRES_CLOCK -DHAS_W32API_WINDOWS_H -DATLEASTFIVEOHOHFIVE HiRes.c In file included from HiRes.xs:18: ppport.h:2979:1: warning: "PERL_UNUSED_DECL" redefined In file included from HiRes.xs:16: /usr/lib/perl5/5.8/cygwin/CORE/perl.h:168:1: warning: this is the location of the previous definition HiRes.xs: In function `_gettimeofday': HiRes.xs:164: error: `IV_1E7LL' undeclared (first use in this function) HiRes.xs:164: error: (Each undeclared identifier is reported only once HiRes.xs:164: error: for each function it appears in.) HiRes.xs:178: error: `IV_1E6LL' undeclared (first use in this function) make: *** [HiRes.o] Error 1
Show quoted text
> gcc --version
gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
Subject: Re: [rt.cpan.org #21118] IV_1E7LL undeclared under Cygwin Perl 5.8.8
Date: Tue, 22 Aug 2006 16:04:34 +0300
To: bug-Time-HiRes@rt.cpan.org
From: Jarkko Hietaniemi <jhi@iki.fi>
Jerry D. Hedden via RT wrote:
Show quoted text
> Tue Aug 22 08:22:19 2006: Request 21118 was acted upon. > Transaction: Ticket created by JDHEDDEN > Queue: Time-HiRes > Subject: IV_1E7LL undeclared under Cygwin Perl 5.8.8 > Broken in: 1.88 > Severity: Critical > Owner: Nobody > Requestors: JDHEDDEN@cpan.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=21118 > > > > 'make' produces the following error under Perl 5.8.8 on Cygwin:
Hmmm, I see. The Const64() must already append the L. Please try hand patching as below and retrying, and let me know how it goes. --- Time-HiRes-1.88/HiRes.xs 2006-08-21 16:24:40.000000000 +0300 +++ HiRes.xs 2006-08-22 16:00:14.000000000 +0300 @@ -37,9 +37,9 @@ } #endif -#define IV_1E6 1000000L -#define IV_1E7 10000000L -#define IV_1E9 1000000000L +#define IV_1E6 1000000 +#define IV_1E7 10000000 +#define IV_1E9 1000000000 #define NV_1E6 1000000.0 #define NV_1E7 10000000.0 #define NV_1E9 1000000000.0
Show quoted text
> gcc -c -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe > -Wdeclaration-after-statement -DUSEIMPORTLIB -O3 -pipe -funit-at-a-time > -mtune=pentium4m -march=pentium4 -mfpmath=sse -mieee-fp -mmmx -msse > -msse2 -DVERSION=\"1.88\" -DXS_VERSION=\"1.88\" > "-I/usr/lib/perl5/5.8/cygwin/CORE" -DTIME_HIRES_NANOSLEEP > -DTIME_HIRES_CLOCK_GETTIME -DTIME_HIRES_CLOCK_GETRES -DTIME_HIRES_CLOCK > -DHAS_W32API_WINDOWS_H -DATLEASTFIVEOHOHFIVE HiRes.c > In file included from HiRes.xs:18: > ppport.h:2979:1: warning: "PERL_UNUSED_DECL" redefined > In file included from HiRes.xs:16: > /usr/lib/perl5/5.8/cygwin/CORE/perl.h:168:1: warning: this is the > location of the previous definition > HiRes.xs: In function `_gettimeofday': > HiRes.xs:164: error: `IV_1E7LL' undeclared (first use in this function) > HiRes.xs:164: error: (Each undeclared identifier is reported only once > HiRes.xs:164: error: for each function it appears in.) > HiRes.xs:178: error: `IV_1E6LL' undeclared (first use in this function) > make: *** [HiRes.o] Error 1 >
>> gcc --version
> gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125) > >
Subject: RE: [rt.cpan.org #21118] IV_1E7LL undeclared under Cygwin Perl 5.8.8
Date: Tue, 22 Aug 2006 06:18:42 -0700
To: bug-Time-HiRes@rt.cpan.org
From: "Jerry D. Hedden" <jdhedden@cpan.org>
That didn't work. The same error occurs. What's happening is the preprocessor is taking the string IV_1E7 and putting LL onto it and then trying to lookup the symbol IV_1E7LL which it then can't find.
Show quoted text
> -------- Original Message -------- > Subject: Re: [rt.cpan.org #21118] IV_1E7LL undeclared under Cygwin Perl > 5.8.8 > From: "jhi@iki.fi via RT" <bug-Time-HiRes@rt.cpan.org> > Date: Tue, August 22, 2006 9:04 am > To: JDHEDDEN@cpan.org > > <URL: http://rt.cpan.org/Ticket/Display.html?id=21118 > > > Jerry D. Hedden via RT wrote:
> > Tue Aug 22 08:22:19 2006: Request 21118 was acted upon. > > Transaction: Ticket created by JDHEDDEN > > Queue: Time-HiRes > > Subject: IV_1E7LL undeclared under Cygwin Perl 5.8.8 > > Broken in: 1.88 > > Severity: Critical > > Owner: Nobody > > Requestors: JDHEDDEN@cpan.org > > Status: new > > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=21118 > > > > > > > 'make' produces the following error under Perl 5.8.8 on Cygwin:
> > Hmmm, I see. The Const64() must already append the L. > Please try hand patching as below and retrying, and let > me know how it goes. > > --- Time-HiRes-1.88/HiRes.xs 2006-08-21 16:24:40.000000000 +0300 > +++ HiRes.xs 2006-08-22 16:00:14.000000000 +0300 > @@ -37,9 +37,9 @@ > } > #endif > > -#define IV_1E6 1000000L > -#define IV_1E7 10000000L > -#define IV_1E9 1000000000L > +#define IV_1E6 1000000 > +#define IV_1E7 10000000 > +#define IV_1E9 1000000000 > #define NV_1E6 1000000.0 > #define NV_1E7 10000000.0 > #define NV_1E9 1000000000.0 > >
> > gcc -c -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe > > -Wdeclaration-after-statement -DUSEIMPORTLIB -O3 -pipe -funit-at-a-time > > -mtune=pentium4m -march=pentium4 -mfpmath=sse -mieee-fp -mmmx -msse > > -msse2 -DVERSION=\"1.88\" -DXS_VERSION=\"1.88\" > > "-I/usr/lib/perl5/5.8/cygwin/CORE" -DTIME_HIRES_NANOSLEEP > > -DTIME_HIRES_CLOCK_GETTIME -DTIME_HIRES_CLOCK_GETRES -DTIME_HIRES_CLOCK > > -DHAS_W32API_WINDOWS_H -DATLEASTFIVEOHOHFIVE HiRes.c > > In file included from HiRes.xs:18: > > ppport.h:2979:1: warning: "PERL_UNUSED_DECL" redefined > > In file included from HiRes.xs:16: > > /usr/lib/perl5/5.8/cygwin/CORE/perl.h:168:1: warning: this is the > > location of the previous definition > > HiRes.xs: In function `_gettimeofday': > > HiRes.xs:164: error: `IV_1E7LL' undeclared (first use in this function) > > HiRes.xs:164: error: (Each undeclared identifier is reported only once > > HiRes.xs:164: error: for each function it appears in.) > > HiRes.xs:178: error: `IV_1E6LL' undeclared (first use in this function) > > make: *** [HiRes.o] Error 1 > >
> >> gcc --version
> > gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125) > > > >
Subject: Re: [rt.cpan.org #21118] IV_1E7LL undeclared under Cygwin Perl 5.8.8
Date: Tue, 22 Aug 2006 16:31:07 +0300
To: bug-Time-HiRes@rt.cpan.org
From: Jarkko Hietaniemi <jhi@iki.fi>
Jerry D. Hedden via RT wrote:
Show quoted text
> Queue: Time-HiRes > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=21118 > > > That didn't work. The same error occurs. What's happening is the > preprocessor is taking the string IV_1E7 and putting LL onto it and > then trying to lookup the symbol IV_1E7LL which it then can't find.
Grumble. I hate the C preprocessor. How about the attached patch?
--- Time-HiRes-1.88/HiRes.xs 2006-08-21 16:24:40.000000000 +0300 +++ HiRes.xs 2006-08-22 16:29:11.000000000 +0300 @@ -37,9 +37,22 @@ } #endif -#define IV_1E6 1000000L -#define IV_1E7 10000000L -#define IV_1E9 1000000000L +#define IV_1E6 1000000 +#define IV_1E7 10000000 +#define IV_1E9 1000000000 + +#ifdef Const64 +# ifdef __GNUC__ +# define IV_1E6LL 1000000LL /* Needed because of Const64() ##-appends LL (or i64). */ +# define IV_1E7LL 10000000LL +# define IV_1E9LL 1000000000LL +# else +# define IV_1E6i64 1000000i64 +# define IV_1E7i64 10000000i64 +# define IV_1E9i64 1000000000i64 +# endif +#endif + #define NV_1E6 1000000.0 #define NV_1E7 10000000.0 #define NV_1E9 1000000000.0
Subject: Re: [rt.cpan.org #21118] IV_1E7LL undeclared under Cygwin Perl 5.8.8
Date: Tue, 22 Aug 2006 18:38:51 +0300
To: bug-Time-HiRes@rt.cpan.org
From: Jarkko Hietaniemi <jhi@iki.fi>
(ping about my second patch attempt)
From: JDHEDDEN@cpan.org
On Tue Aug 22 09:31:06 2006, jhi@iki.fi wrote:
Show quoted text
> Jerry D. Hedden via RT wrote:
> > Queue: Time-HiRes > > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=21118 > > > > > That didn't work. The same error occurs. What's happening is the > > preprocessor is taking the string IV_1E7 and putting LL onto it and > > then trying to lookup the symbol IV_1E7LL which it then can't find.
> > Grumble. I hate the C preprocessor. How about the attached patch?
At first glance, I thought it would work, but it didn't: gcc -c -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -Wdeclaration-after-statement -DUSEIMPORTLIB -O3 -pipe -funit-at-a-time -mtune=pentium4m -march=pentium4 -mfpmath=sse -mieee-fp -mmmx -msse -msse2 -DVERSION=\"1.88\" -DXS_VERSION=\"1.88\" "-I/usr/lib/perl5/5.8/cygwin/CORE" -DTIME_HIRES_NANOSLEEP -DTIME_HIRES_CLOCK_GETTIME -DTIME_HIRES_CLOCK_GETRES -DTIME_HIRES_CLOCK -DHAS_W32API_WINDOWS_H -DATLEASTFIVEOHOHFIVE HiRes.c In file included from HiRes.xs:18: ppport.h:2979:1: warning: "PERL_UNUSED_DECL" redefined In file included from HiRes.xs:16: /usr/lib/perl5/5.8/cygwin/CORE/perl.h:168:1: warning: this is the location of the previous definition HiRes.xs: In function `_gettimeofday': HiRes.xs:177: error: `IV_1E7LL' undeclared (first use in this function) HiRes.xs:177: error: (Each undeclared identifier is reported only once HiRes.xs:177: error: for each function it appears in.) HiRes.xs:191: error: `IV_1E6LL' undeclared (first use in this function) make: *** [HiRes.o] Error 1 Then I figured out why. Const64 isn't declared until further down in the file. Attached is a patch that does work.
diff -urN Time-HiRes-1.88/HiRes.xs Time-HiRes-patched/HiRes.xs --- Time-HiRes-1.88/HiRes.xs 2006-08-21 09:24:40.000000000 -0400 +++ Time-HiRes-patched/HiRes.xs 2006-08-22 12:55:38.000000000 -0400 @@ -37,13 +37,6 @@ } #endif -#define IV_1E6 1000000L -#define IV_1E7 10000000L -#define IV_1E9 1000000000L -#define NV_1E6 1000000.0 -#define NV_1E7 10000000.0 -#define NV_1E9 1000000000.0 - #ifndef PerlProc_pause # define PerlProc_pause() Pause() #endif @@ -122,6 +115,26 @@ #endif #define EPOCH_BIAS Const64(116444736000000000) +#define IV_1E6 1000000 +#define IV_1E7 10000000 +#define IV_1E9 1000000000 + +#ifdef Const64 +# ifdef __GNUC__ +# define IV_1E6LL 1000000LL /* Needed because of Const64() ##-appends LL (or i64). */ +# define IV_1E7LL 10000000LL +# define IV_1E9LL 1000000000LL +# else +# define IV_1E6i64 1000000i64 +# define IV_1E7i64 10000000i64 +# define IV_1E9i64 1000000000i64 +# endif +#endif + +#define NV_1E6 1000000.0 +#define NV_1E7 10000000.0 +#define NV_1E9 1000000000.0 + /* NOTE: This does not compute the timezone info (doing so can be expensive, * and appears to be unsupported even by glibc) */
Subject: Re: [rt.cpan.org #21118] IV_1E7LL undeclared under Cygwin Perl 5.8.8
Date: Tue, 22 Aug 2006 20:05:02 +0300
To: bug-Time-HiRes@rt.cpan.org
From: Jarkko Hietaniemi <jhi@iki.fi>
Thanks! I made a further change since the IV_1E* need to be visible also to other platforms, how about the attached HiRes.xs?

Message body is not shown because it is too large.

Subject: RE: [rt.cpan.org #21118] IV_1E7LL undeclared under Cygwin Perl 5.8.8
Date: Tue, 22 Aug 2006 10:17:02 -0700
To: bug-Time-HiRes@rt.cpan.org
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Yes, your new HiRes.xs works.
Subject: Re: [rt.cpan.org #21118] IV_1E7LL undeclared under Cygwin Perl 5.8.8
Date: Tue, 22 Aug 2006 20:27:39 +0300
To: bug-Time-HiRes@rt.cpan.org
From: Jarkko Hietaniemi <jhi@iki.fi>
Jerry D. Hedden via RT wrote:
Show quoted text
> Queue: Time-HiRes > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=21118 > > > Yes, your new HiRes.xs works.
Time-HiRes-1.90 on its way to CPAN, thanks!


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.