Re: C headers lack extern "C" {} wrapping



On 2/22/02 11:31 PM, "Sam Couter" <scouter@bigpond.net.au> wrote:

> None of the C headers in ORBit2 (except those generated by the IDL
> compiler) have the 'extern "C" {}' wrapping. This means that the
> functions declared in those header files aren't accessible from C++
> code.
> 
> Will anyone protest if I add the following lines to each header listed
> in a _HEADERS primary target in the appropriate Makefile.am? That should
> get all of the installed headers, which as far as I know are the only
> ones which need this.
> 
> #ifdef __cplusplus
> extern "C"
> {
> #endif        /* __cplusplus */
> 
> [ ... header contents here ... ]
> 
> #ifdef __cplusplus
> }
> #endif        /* __cplusplus */

Since ORBit2 uses glib, it's better to use G_BEGIN_DECLS/G_END_DECLS.

    -- Darin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]