TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
From: Randy Brukardt <[log in to unmask]>
Date: Tue, 1 Dec 1998 12:11:48 -0600
Reply-To: Randy Brukardt <[log in to unmask]>
Parts/Attachments: text/plain (27 lines)
>Is there a good reason for windows libraries to not use C convention?
>Or is it just an accident of Microsoft history?

Yes, the code is substantially smaller and a bit faster on Intel processors.
The StdCall convention lets the called routine remove the parameters
(which is part of the RET instruction on a Intel processor, and thus
essentially free) rather than making the caller do it (which costs time
and instructions). C compilers have to use the latter convention because
the language allows variable parameter lists.

>Although the Stdcall convention is not in the RM, is it available
>with the same name with most Ada compilers on Windows?

When we started Claw, we expected this to be a problem. So we planned
on a preprocessor to insert the convention name. Eventually we found
out that the only compiler not using the convention name StdCall was
Janus/Ada (our compiler).  [For compatibility with our 16-bit Windows
compiler, we had called the convention "Windows"]. So we aliased
"Windows" and "StdCall", and Claw never got a preprocessor.

So, it is pretty safe to use "StdCall" on Windows implementations; one
that came out now without it would get run out of town pretty quick...

                        Randy Brukardt
                        Director of Technical Operations
                        R.R. Software, Inc.