Re: [PATCH] Changes to ext_skel for C++
| From: | J Smith | Date: | Fri, 29 Nov 2002 20:46:19 +0000 |
| Subject: | Re: [PATCH] Changes to ext_skel for C++ | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-91940@lists.php.net to get a copy of this message | ||
Is this a problem with VS.net or something? I've never done that with any of
my C++ extensions and they've all worked fine on VC++ 6.
If it is a problem, though, I'll make the changes.
J
Shane Caraveo wrote:
> 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