Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:905 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38229 invoked by uid 1007); 14 Apr 2003 16:26:35 -0000 Message-ID: <20030414162635.38228.qmail@pb1.pair.com> To: internals@lists.php.net Reply-To: jay@php.net Mail-Copies-To: jay@php.net Date: Mon, 14 Apr 2003 12:26:33 -0400 References: <20030412125758.GA5060@mail.host.sk> <20030414142344.28249.qmail@pb1.pair.com> <1050336627.1114.129.camel@salem.intra.nobolt.net> Lines: 37 User-Agent: KNode/0.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Posted-By: 216.94.11.234 Subject: Re: [PHP-DEV] Re: Linking problem with extension written in C++ From: jay@php.net (Jay Smith) It kind of seems messy to wrap everything in extern "C". It would probably be better to weed out the individual API functions that need to be extern C'd. I'll try and seek out the offending functions. There aren't too many of them AFAIK... J Per Lundberg wrote: > On Mon, 2003-04-14 at 16:19, Jay Smith wrote: >> There are a few header files that you have to include with extern "C" so >> their names get mangled properly into C++. Try wrapping php.h, php_ini.h >> and info.h in extern "C" and see how that goes. > > How come we don't have extern C wrapped in #ifdef __cplusplus in these > files already, so they can just be included straight away? Like this: > > #ifdef __cplusplus > extern "C" { > #endif > > // yadda yadda > > #ifdef __cplusplus > }; > #endif > > -- > Best regards, > > Per Lundberg / Capio ApS > Phone: +46-18-4186040 > Fax: +46-18-4186049 > Web: http://www.nobolt.com