As others have pointed out, it is, but I think it would be better to simply
have the code there in the generated C++ source and not at all in the C
source. It would lead to less confusion imho.
I guess it should kind of be assumed that if someone is going the distance
to actually create an extension to PHP, they're probably going to know what
__cplusplus, extern "C" and all that stuff means, but on the other hand,
I've seen (and received) some pretty ridiculous questions on that sort of
stuff dealing with PHP extensions directly.
J
Stig S. Bakken wrote:
> Isn't __cplusplus defined for all C++ compilers?
>
> #ifdef __cplusplus
> extern "C" {
> #endif
>
> #ifdef __cplusplus
> }
> #endif
>
> This is pretty common in library header files at least.
>
> - Stig
>
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php