[Zlib-devel] TR: the win32\Makefile.msc diff
Török Edwin
edwintorok at gmail.com
Mon Mar 22 07:09:54 EDT 2010
On 03/22/2010 07:13 AM, John Bowler wrote:
> From: William A. Rowe Jr.
>> From: Enrico Weigelt
>>> But you can make the compiler fail if sizeof(..) doesnt match a
>> specific size, so use for a compile-test (in ./configure).
>> The compiler? Do you mean at run time,
>
> I believe the suggestion was to do an autoconf configure style run time test that uses the compiler to create an executable to test the actual size.
>
> Unfortunately it doesn't work in cross-compiled environments because the resultant runtime won't run on the system building zlib (the build host not the target host.) Anyway, it doesn't work because zlib 'configure' is not a GNU/autoconf configure.
>
IIRC autoconf does this by creating a switch with 2 cases:
switch (0) {case 0: case (sizeof(short) == $ac_size):;}
If you get $ac_size right it'll successfully compile, if not it'll fail
to compile (duplicate case value).
I think something like this should work:
switch (0) {
case 0:
case (sizeof(z_off64_t) == 8):;
}
If the sizeof is not 8, it'll fail to compile with a duplicate case value.
Best regards,
--Edwin
More information about the Zlib-devel
mailing list