TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Proportional 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]>
Date: Wed, 2 Dec 1998 00:02:10 +0100
Reply-To: Jerry van Dijk <[log in to unmask]>
From: Jerry van Dijk <[log in to unmask]>
Content-Transfer-Encoding: 7bit
In-Reply-To: <[log in to unmask]> from "Geoff Bull" at Dec 1, 98 09:26:27 pm
Content-Type: text/plain; charset=US-ASCII
MIME-Version: 1.0
Parts/Attachments: text/plain (44 lines)
> The problem is with Java calls to native code.
> On most platforms these calls use the C convention.
> However on Windows, the Stdcall convention is used.

Yep, that is one of the reasons why I did a NT specific
GLUT binding.

> Thus users of my binding need a different pragma
> on windows to other platforms.
> How can this be done without changing the code,
> or having two versions of it?

You cannot. Courtesy of MS...

> Is there a good reason for windows libraries to not use
> C convention?

Basically there are two types of library calls on NT. The
standard C library (which uses the C convention) and the
Win32 API library (which uses the StdCall convention).
The StdCall convention really is the Pascal convention.
On Intel processors this is slightly more efficient,
especially for 'call-back' functions. In old Windows v2.x
times, this mattered.

It is safe to assume that (except for a couple of oddball
functions) all callback functions need StdCall.

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

I think it can be called a de-facto standard. Probably
has something to do with its usage by the Intermetrics
Win32Api binding... :-)

> First I have to solve this Stdcall issue and do some
> more testing.

I'm afraid that windows users will have to learn to live
with it...

Jerry.

ATOM RSS1 RSS2