delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/10/31/10:01:15

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199910311352.HAA21216@pluto.xraylith.wisc.edu>
To: "Michael P." <migueldetrix AT forum DOT dk>
cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: parse error ? Am I the only one?
In-Reply-To: Your message of "Sun, 31 Oct 1999 15:06:11 +0100."
<19991031140735 DOT D53BFEC07F AT forum DOT dk>
Date: Sun, 31 Oct 1999 07:52:08 -0600
From: Mumit Khan <khan AT thor DOT xraylith DOT wisc DOT edu>

"Michael P." <migueldetrix AT forum DOT dk> writes:
> Hi all!
> 
> I have been compiling a test program for the C/FRONT interface to Navision 
> Financials. The code works fine when using both the MS Visual C++ and the 
> LCC-compiler.
> 
> But when trying to compile using egcs or cygwin, I get a parse error in some 
> typedef statements. What am I doing wrong?
> 
> This is the code causing the error:
> // Start
> 
> #ifdef _MSC_VER
> #define DBL_CDECL		  __cdecl
> #else 
> #define DBL_CDECL		  _cdecl
> #endif
> 
> typedef void	(DBL_CDECL *DBL_pFuncExceptionHandler)(DBL_S32 ErrorCode, 
> DBL_BOOL IsFatal);
> typedef void	(DBL_CDECL *DBL_pFuncMessageShowHandler)(DBL_U8* Message, DBL_U
> 32 
> MessageType, DBL_S32 ErrorCode);
> 
> // End
> 
> It would be a great help to me, if someone could help me. I prefer using the 
> egcs or cygwin.
> 

For GCC, there is a predefined macro, __cdecl, that gets translated to 
__attribute__((cdecl)) and marks the function to use one particular
return convention. Some compilers, notably Borland and obviously LCC,
predefine both _cdecl and __cdecl.

Here's the fix:

#if defined (_MSC_VER) || defined (__GNUC__)
#define DBL_CDECL		  __cdecl
#else 
#define DBL_CDECL		  _cdecl
#endif

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019