[M3devel] <*external winapi*> silently ignored on all platforms?

Tony Hosking hosking at cs.purdue.edu
Mon Feb 11 17:26:50 CET 2008


Why not simply default EXTERNAL on Win32 to WINAPI instead?  That  
way, all EXTERNALs will look the same but you won't clutter up non- 
Win32 with ugly WINAPI.

On Feb 11, 2008, at 5:13 AM, Jay wrote:

> I know this won't be popular but...
>
> over in m3-db\odbc\src, there is POSIX and WIN32, and they are  
> ALMOST identical.
>
> The differences are
>
> the UNUSED type SQLHWND is ADDRESS or HWND
> This should just be removed.
>
> In Win32 all the <*external*> pragmas have WINAPI.
> In Posix, they lack it.
>
> For this and other reasons, I suggest that all CM3 frontends accept  
> but silently
> ignore the Win32/x86 calling conventions in <*external*> pragmas,
> similar to what the non-x86 Windows compilers do.
>
> The other reasons would be the "FARPROC" warning that I already  
> cleared up otherwise.
>
> And anything else minor that comes up.
>
> I know this won't be popular but I REALLY REALLY REALLY believe is  
> the right thing.
> It is a small safe change that will allow a little more Modula-3  
> source portability.
>
> A similar suggestion would be to change the default calling  
> convention in Modula-3,
> it would very possibly reduce code size, but is very very very much  
> a breaking
> change so probably can never happen.
> Better probably would be to a) add a switch for this b) extend  
> the .m3exports
> or whatnot files to indicate what switch was used.
>
> A "blanket pragma" might also be good, so that the various *.i3  
> files can
> say just to assume __stdcall for the rest of the file instead of  
> annotating each functions.
>
>  - Jay
>
>
> Need to know the score, the latest news, or you need your Hotmail®- 
> get your "fix". Check it out.




More information about the M3devel mailing list