🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14742

Re: How to Define "Extern" Function in C++ Builder

#14742
From: Ted Lyngmo
Date: Mon, 04 Aug 2003 12:29
34 lines
2035 bytes
Remy Lebeau (TeamB) wrote:
 > "Umar" wrote:
 >> Extern "C"
 >> {
 >>     all the commands to read input written in this area
 >> }
 >>
 >
 > What exactly are you trying to accomplish?  That cnippet does not make any
 > sense.  You cannot extern a block of code, only entire functions.

Well, if you have a set of C functions, their header file can contain 
something like this to avoid C++ mangling the function names.

#ifdef __cplusplus
extern "C" {
#endif

void hsort( void *base, size_t nelem, size_t width, int (*fcmp)(const void *, 
const void *) );
void bsort( void *base, size_t nelem, size_t width, int (*fcmp)(const void *, 
const void *) );

#ifdef __cplusplus
}
#endif


Kind regards,
Ted Lyngmo

-- 
Replace MY_FIRST_NAME in my email address with my first name to send a private
email to me.
Technical Details
Message-ID: <3F2E5196.5080309@lyncon.se>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f1db2db$1@newsgroups.borland.com> <3f1dbea7$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,6fe63ea9ffe8bf86
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-04 05:40:03 PST
Message-ID: <3F2E5196.5080309@lyncon.se>
Date: Mon, 04 Aug 2003 14:29:10 +0200
From: Ted Lyngmo <MY_FIRST_NAME@lyncon.se>
Organization: Lyncon - Computer & Music consulting
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1
X-Accept-Language: sv,en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: How to Define "Extern" Function in C++ Builder
References: <3f1db2db$1@newsgroups.borland.com> <3f1dbea7$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 217.215.147.98
X-Trace: newsgroups.borland.com 1060000158 217.215.147.98 (4 Aug 2003 05:29:18 -0700)
Lines: 35
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-05!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail