delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/02/14:41:45

From: johne AT parallax DOT co DOT uk (John Eccleston)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: C++ and Assembler
Date: Fri, 02 May 97 13:23:18 GMT
Organization: Parallax Solutions Ltd
Message-ID: <862579279.761930@red.parallax.co.uk>
References: <E9B6tt DOT 1qy DOT C DOT amo AT bath DOT ac DOT uk>
NNTP-Posting-Host: red.parallax.co.uk
Cache-Post-Path: red.parallax.co.uk!unknown AT parsnip DOT parallax DOT co DOT uk
Lines: 44
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

David Hampson wrote:
[Snip]
>
>If I put MyFunc(short,short) in C, and then _MyFunc in Asm, how do I make 
>it compile correctly under C and C++? (How do I make C++ look for a 
>function called _MyFunc rather than _MyFunc_Fss?)
>

Hi David,

Where you declare your function prototypes try putting the following
around them

-----> Cut here <-----
#ifdef __cplusplus
extern "C" {
#endif

/* Function prototypes go here */
void MyFunc(short, short);

#ifdef __cplusplus
}
#endif
-----> Cut here <-----

This will tell the C++ compiler to treat the functions using the C naming
convention.

Hope that helps

John

________________________________________________________________
Parallax Solutions Ltd.   Tel.: 01203 514522
Stonecourt,               Fax.: 01203 514401
Siskin Drive,             Web : http://www.parallax.co.uk/~johne
Coventry CV3 4FJ          Mail: johne AT parallax DOT co DOT uk
________________________________________________________________
                         Remember:
 There is no such thing as computer error, it's 100% YOUR fault
________________________________________________________________


- Raw text -


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