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

Olaf Wagner wagner at elegosoft.com
Mon Feb 11 12:30:37 CET 2008


Quoting Jay <jayk123 at hotmail.com>:

> 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 HWNDThis 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 silentlyignore 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.

If I understand you correctly, you'd like to declare the external
procedures as WINAPI in general and let all backends except the
Windows one ignore it. We should not call it WINAPI then, I think;
what about SYSAPI as a general abstraction?

> 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 breakingchange so probably can never   
> happen.Better probably would be to a) add a switch for this b)   
> extend the .m3exportsor whatnot files to indicate what switch was   
> used.

We shouldn't change the default calling conventions. That is, we should
check very very carefully if there are negative effects of doing this
and how we cope with them.
Until this has been done, we shouldn't change the default calling
conventions :-)

> A "blanket pragma" might also be good, so that the various *.i3   
> files cansay just to assume __stdcall for the rest of the file   
> instead of annotating each functions.

You're talking about a pragma default for all declarations in a
file, aren't you? I wouldn't object to that, but it would
probably need some compiler extensions, wouldn't it?

Olaf
-- 
Olaf Wagner -- elego Software Solutions GmbH
                Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96  mobile: +49 177 2345 869  fax: +49 30 23 45 86 95
    http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194




More information about the M3devel mailing list