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

Jay jayk123 at hotmail.com
Mon Feb 11 23:03:22 CET 2008


That's also a good idea too.
 
Though I think maybe safer to say:
 
<*NT386:callingconvention push*><*NT386:callingconvention winapi*>
..bunch of decls ..
 
<*NT386:callingconvention pop*>
 > way, all EXTERNALs will look the same but you won't clutter up non-   > Win32 with ugly WINAPI. 
Tony, is /everything/ Win32 ugly? :)
 
The status of SQLHWND is less clear to me now, seems I have trouble with the basic find-in-files..
Even so -- it used like once, its type is almost the same, the Windef definition is now available, the headers are almost the same. I did notice the Win32 headers actually #ifdef:
 
#if defined(WIN32) || defined(OS2)typedef HWND                    SQLHWND;#elif defined (UNIX)typedef Widget                  SQLHWND;#else/* placehold for future O/S GUI window handle definition */typedef SQLPOINTER              SQLHWND;#endif
Might be nice to have a limited form of #if in Modula-3.
I understand -- don't want to have to parse headers over and over.
Maybe only if on TARGET and nothing else?
Slippery slope.
 
So far ODBC is the main place I've seen this and I'm just about over it.
The status of OpenGL here isn't clear, seems maybe the opposite -- __stdcall on NT386, __cdecl on NT386GNU.
 
 - Jay



> CC: m3devel at elegosoft.com> From: hosking at cs.purdue.edu> Subject: Re: [M3devel] <*external winapi*> silently ignored on all platforms?> Date: Mon, 11 Feb 2008 11:26:50 -0500> To: jayk123 at hotmail.com> > 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.> 
_________________________________________________________________
Need to know the score, the latest news, or you need your Hotmail®-get your "fix".
http://www.msnmobilefix.com/Default.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080211/9c94dac2/attachment-0002.html>


More information about the M3devel mailing list