php-developer-list | 2002112

Re: [PHP-DEV] [PATCH] Changes to ext_skel for C++ From: Shane Caraveo (shane <email protected>)
Date: 11/29/02

J Smith wrote:
> Attached is a patch to ext_skel that adds an optional argument (--cpp) that
> will create a PHP extension in C++ rather than C. Also attached is
> skeleton.cpp, which basically mirrors ext/skeleton/skeleton.c with a few
> modifications for using C++. I could've just made some changes to
> skeleton.c and done some sed work in the ext_skel script, but I think it's
> clearer to have them separated into two files.
>
> The ext_skel patch is based on the current HEAD.
>
> Comments?
>
> J

skeleton.h also needs to be dealt with. If you do not, visual studio
will export symbols as c++ symbols and the extension will not work.
Simple solution is to have

#ifdef __cplusplus
extern "C" {
#endif

at the top of skeleton.h, and close it at the bottom.

Shane

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php