This is the mail archive of the gsl-discuss@sourceware.cygnus.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: C++ support


>>>>> "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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]