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: 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 Precedence: bulk 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 ________________________________________________________________