While porting zlib.h to HLA i've met the following problem (both 1.43 and 1.51 linux versions are buggy):

the procedure is declared like this:
    inflateInit_( zstrm, "1.1.4", [B]@size[/B]( zstream ));

here's the code generated by windows version of HLA (1.47):
pushd	0x38

push offset L19_str__hla_
push eax
push eax
lea eax, [ebp-60] ;/* zstrm */
mov dword ptr [esp+4], eax

call inflateInit_ /* inflateInit_ */
(I've left a blank line where `pop eax' was supposed to be.)
Posted on 2003-07-02 07:55:30 by clone-d
The bug is even worse, the code is actually being emitted (I suppose) and then it is stripped;
Following code should be workaround for the above problem
pushd	0x38

push offset L19_str__hla_
lea eax, [ebp-60] ;/* zstrm */
call inflateInit_ /* inflateInit_ */
explicit push(eax) disappeared!!!
You better fix it, Randy ;)

--
clone-d.
Posted on 2003-07-02 08:58:29 by clone-d

The bug is even worse, the code is actually being emitted (I suppose) and then it is stripped;
Following code should be workaround for the above problem
pushd	0x38

push offset L19_str__hla_
lea eax, [ebp-60] ;/* zstrm */
call inflateInit_ /* inflateInit_ */
explicit push(eax) disappeared!!!
You better fix it, Randy ;)

--
clone-d.


Oh, I will!
This is an artifact of the @cdecl parameter passing code.
The way HLA handles this has always been problematic under Linux (this is due to the cr/lf vs lf line endings between the two OSes).

In the very short term, the workaround I'll offer is to manually push the parameters here and then call the function directly (using the CALL instruction).

Cheers,
Randy Hyde
Posted on 2003-07-02 10:16:58 by rhyde
The code generation problems and the fileio.close
problem (Linux) have been corrected in HLA v1.52
which is now up on Webster. See the v1.52 announcement
for details.
Cheers,
Randy Hyde
Posted on 2003-07-05 14:35:15 by rhyde