Skip Menu |

This queue is for tickets about the Math-Random-MT CPAN distribution.

Report information
The Basics
Id: 36021
Status: resolved
Priority: 0/
Queue: Math-Random-MT

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

Bug Information
Severity: Important
Broken in: 1.07
Fixed in: (no value)



Subject: Build failure Win32 with 3 line patch
Under Perl 5.8.8 on WinXP Math::Random::MT fails to build. There is an example of this failure in the 1.07 version tester results. The failure occurs because uint32_t is undefined. This is simply resolved by defining it in mt.h if it is not already defined..... *** mt.old.h 2008-05-20 11:16:26.812500000 +1000 --- mt.h 2008-05-20 11:18:10.625000000 +1000 *************** *** 13,18 **** --- 13,22 ---- #include <sys/types.h> #endif + #ifndef uint32_t + #define uint32_t unsigned int + #endif + #ifndef _MATH_MT_H_ #define _MATH_MT_H_
From: jfreeman [...] cpan.org
On Mon May 19 21:29:41 2008, JFREEMAN wrote: Show quoted text
> Under Perl 5.8.8 on WinXP Math::Random::MT fails to build. There is
an Show quoted text
> example of this failure in the 1.07 version tester results. The
failure Show quoted text
> occurs because uint32_t is undefined. This is simply resolved by > defining it in mt.h if it is not already defined..... > > *** mt.old.h 2008-05-20 11:16:26.812500000 +1000 > --- mt.h 2008-05-20 11:18:10.625000000 +1000 > *************** > *** 13,18 **** > --- 13,22 ---- > #include <sys/types.h> > #endif > > + #ifndef uint32_t > + #define uint32_t unsigned int > + #endif > + > #ifndef _MATH_MT_H_ > #define _MATH_MT_H_
This was the minimalist, off the top of my head approach. We should always have an unsigned int, *probably* 32 bits wide. The actual typdef or a uint32_t is typedef unsigned long int uint32_t so #ifndef uint32_t #define uint32_t unsigned long int #endif is probably better. It works either way on 32 bit Win32.
Appears to affect OS X as well: cc -c -arch i386 -arch ppc -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp - fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include -O3 - DVERSION=\"1.07\" -DXS_VERSION=\"1.07\" "-I/System/Library/Perl/5.8.8/darwin-thread- multi-2level/CORE" _mt.c In file included from _mt.c:7: mt.h:23: error: syntax error before ‘uint32_t’ mt.h:23: warning: no semicolon at end of struct or union mt.h:25: error: syntax error before ‘}’ token ...
I am pretty sure this was fixed some time ago. And I crushed some other Window (nmake) specific bugs last week. Math::Random::MT version 1.14 appears to build properly on all platforms. Closing...