On Jan 30, 2008 2:20 PM, Kai Tietz <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I noticed, that the builtin functions for mingw (at least for 64-bit
> Windows) are not correct in return type. See msdn
> http://msdn2.microsoft.com/en-us/library/xwy0k9bb.aspx.
> The return type for those targets (i?86-pc-mingw32 and x86_64-pc-mingw32)
> is a intptr_t, but a 'int' for other targets. For mingw 32-bit this does
> not hurt, but for the 64-bit variant it is a failure.
> So my question is: How should I express in builtins.def and
> builtin-types.def this target specific modifications?
It is not possible currently.  execl* are specified by POSIX as returning
int, so ...

> I see two different approaches for this:
> a) Add in builtin-types.h a '#if defined(TARGET_64BIT_MS_ABI) &&
> TARGET_64BIT_MS_ABI != 0' to add a specific function type and use in
> bultins.def this function type.
> b) Add in target mingw and new macro specifying the return type for
> builtins. Add to default.h the standard value and add in builtin-types.def
> the function type and use it in builtin.def

c) Supressing this builtin on mingw64

... should be the correct thing.

For example with (builtins.def)

#if defined(TARGET_64BIT_MS_ABI) && TARGET_64BIT_MS_ABI != 0'
#define DEF_EXT_LIB_BUILTIN_NO_MINGW(....)
#else
#define DEF_EXT_LIB_BUILTIN_NO_MINGW(....) DEF_EXT_LIB_BUILTIN(...)
#endif

and change the offending builtins to use DEF_EXT_LIB_BUILTIN_NO_MINGW

Richard.

Reply via email to