[AWS] AWS fixes for windows x64

Pascal Obry pascal at obry.net
Thu Dec 10 09:09:14 CET 2009


Wiljan,

> I still forgot another patch in zlib.
> I found that zlib actually comes directly from the zlib distribution.
> To make zlib work I have made the patch as shown below.

This is not the proper fix in fact.

> I do however not have a good explanation why it it needed.
> If this fix is not present, the size of the ada record is different then the one in the C code on x64
> and zlib will check on that in the C code.
> This fixes that problem.
> Not sure this is somehow a compiler problem.

This one was tough! It was a problem with the way the Z_Stream record size
was computed.

The proper fix was (in zlib-thin.adb):

-   Z_Stream_Size : constant Int := Z_Stream'Size / System.Storage_Unit;
+   Z_Stream_Size : constant Int := Z_Stream'Object_Size / System.Storage_Unit;

Object_Size is GNAT specific. This fact is that we do not want to get
the size of the type but the size of an object of this type. The later
depends on the actual alignment use I suppose. It would have also
worked to take 'Size on a declared object.

   Zs : Z_Stream;

   Zs'Size.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595


More information about the AWS mailing list