Hi Xavi,

On 2010 Feb 11, at 05:20, Xavi wrote:

> Hi Viktor,
> 
>> You've introduced a new permanently set macro called HB_OS_WIN64_32,
>> redefined a Harbour type (which should be avoided by all means)
> 
> Is to work with win64 implementation in win32 with minimal changes.
> If the system is win32, not be used HB_U64 used HB_U32 to compile only 
> win_dll.c

That can work, but it means we don't support int64/double 
parameters and int64/double/float/char return values anymore.

Currently we do, so maybe it'd be good to take care of it.

We should also support both cdecl and stdcall versions.

You check what happens by looking at asm output for this source (gcc):
---
_stdcall int hello1( int a, int b ) { return 30; }
_stdcall long hello2( long a, long b ) { return 30; }
_stdcall short hello3( short a, short b ) { return 30; }
_stdcall unsigned char hello4( unsigned char a, unsigned char b ) { return 30; }
_stdcall double hello5( double a, double b ) { return 30; }
_stdcall long long hello6( long long a, long long b ) { return 30; }
_stdcall float hello7( float a, float b ) { return 30; }

_cdecl int hello1c( int a, int b ) { return 30; }
_cdecl long hello2c( long a, long b ) { return 30; }
_cdecl short hello3c( short a, short b ) { return 30; }
_cdecl unsigned char hello4c( unsigned char a, unsigned char b ) { return 30; }
_cdecl double hello5c( double a, double b ) { return 30; }
_cdecl long long hello6c( long long a, long long b ) { return 30; }
_cdecl float hello7c( float a, float b ) { return 30; }

void main( void )
{
   hello1( 100, 200 ); hello1c( 100, 200 );
   hello2( 100, 200 ); hello2c( 100, 200 );
   hello3( 100, 200 ); hello3c( 100, 200 );
   hello4( 100, 200 ); hello4c( 100, 200 );
   hello5( 100, 200 ); hello5c( 100, 200 );
   hello6( 100, 200 ); hello6c( 100, 200 );
}
---

>> and shifted parameter offset by one for reference types,
> 
> It's a bad typo in win64. Try testdll.prg with MinGW in Win32, use CC_FLAGS .-
> -Wall -Wextra -march=i586 -mtune=pentiumpro -O3 -fomit-frame-pointer

Oh it's possible and thank you. I've committed the fix.

Brgds,
Viktor

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to