This is the mail archive of the
gsl-discuss@sourceware.cygnus.com
mailing list for the GSL project.
Re: C++ support
- To: pliszka at higgs dot ucdavis dot edu
- Subject: Re: C++ support
- From: Thomas Walter <walter at pctc dot chemie dot uni-erlangen dot de>
- Date: Tue, 23 Nov 1999 15:43:28 +0100
- CC: gsl-discuss at sourceware dot cygnus dot com
- References: <Pine.LNX.4.10.9911221726140.14555-100000@higgs.ucdavis.edu>
>>>>> "Jacek" == Jacek Pliszka <pliszka@higgs.ucdavis.edu> writes:
Jacek> Hi!
Jacek> Is there any way the GSL will support C++?
Jacek> It should be fairly simple. Just adding:
Jacek> #ifdef __cplusplus
Jacek> #define __extern_C extern "C"
Jacek> #else
Jacek> #define __extern_C
Jacek> #endif
Jacek> in the gsl_errno.h which is included everywhere
Jacek> and then declaring all functions as
Jacek> __extern_C
Better and common practice is to protect each header which is enough.
Add
#ifdef __cplusplus
extern "C" {
#endif
at header start and
#ifdef __cplusplus
}
#endif
at header end
And you are done.
Bye
Thomas
--
SUSHI? Nein, Danke. Ich esse keine Köder.
----------------------------------------------
Dipl. Phys. Thomas Walter
Inst. f. Physiklische Chemie II
Egerlandstr. 3 Tel.: ++9131-85 27326 / 27330
91058 Erlangen, Germany email: walter@pctc.chemie.uni-erlangen.de