🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java
Article #46

Re: Borland/Native methods query...

#46
From: Hanpeter van Vliet
Date: Mon, 13 Nov 1995 20:43
37 lines
2280 bytes
Pete Becker wrote:
> 
> In article <30A69CE9.3E40@mit.edu>, mesozoic@mit.edu says...
> 
<snip>

> >In the "HelloWorld" native example from Sun, the first few compile errors are:
> >
> >Error:..\..\JAVA\INCLUDE\WIN32\TYPEDEFS.H 34:,expected
> >Error:..\..\JAVA\INCLUDE\WIN32\TYPEDEFS.H 35:Multiple declaration for '__int64'
> >Error:..\..\JAVA\INCLUDE\WIN32\TYPEDEFS.H 79:'int64_t' cannot start a parameter declaration
> >Error:..\..\JAVA\INCLUDE\WIN32\TYPEDEFS.H 80:Declaration syntax error
> >& etc...
> >
> >Sorry if I'm too clueless.. I know in the future that Sun & Borland are planning to work
> >together more closely :-)
> 
> What you've stumbled on is the nasty little secret that Microsoft's header
> files for WIN32 won't compile with any other compiler, because they rely on
> Microsoft's non-standard language extensions (better known as compiler bugs).
> In general, you should use the WIN32 headers that come with the compiler you're
> using, not the ones that come from Microsoft (unless, of course, you're using
> Microsoft's compiler).

Utter nonsense!

It's Java's own typedefs_md.h header file that tries to take advantage of a
MSVC feature (namely 64 bit integers). These can be got using the __int64
keyword - two leading underscores to avoid the ANSI namespace.

You'll have to substitute your own, Borland compatible, definition for the
int64_t type before you can continue. If Borland does not have a comparable
feature you could even substitute "double" for __int64 (e.g. using the
"-D__int64=double" compiler switch). Of course that would mean that you cannot
use Java "long"s in your native interfaces.

-- hanpeter
Technical Details
Message-ID: <30A7ADE6.5ADF@inter.nl.net>
Path: arc1-ca.pugleaf.net!EU.net!sun4nl!news
References: <30A6891B.59C3@mit.edu> <30A69CE9.3E40@mit.edu> <488161$k05@druid.borland.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.java,comp.lang.c++
Path: arc1-ca.pugleaf.net!EU.net!sun4nl!news
From: Hanpeter van Vliet <hvvliet@inter.nl.net>
Subject: Re: Borland/Native methods query...
X-Nntp-Posting-Host: amf99-14.amersfoort.nl.net
Content-Type: text/plain; charset=us-ascii
Message-ID: <30A7ADE6.5ADF@inter.nl.net>
Sender: news@inter.NL.net (News at news)
Content-Transfer-Encoding: 7bit
Organization: Programmers' Lib
References: <30A6891B.59C3@mit.edu> <30A69CE9.3E40@mit.edu> <488161$k05@druid.borland.com>
Mime-Version: 1.0
Date: Mon, 13 Nov 1995 20:43:18 GMT
X-Mailer: Mozilla 2.0b2 (Windows; I; 32bit)