Compiling under Borland C Builder / No BEGIN_EXTERN_C?
| From: | Bryan Mayland | Date: | Tue, 13 Feb 2001 23:46:43 +0000 |
| Subject: | Compiling under Borland C Builder / No BEGIN_EXTERN_C? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-46528@lists.php.net to get a copy of this message | ||
I've been working on a project which requires me to write a zend extension
(http://capnbry.dyndns.org/phpub/), I've been using Visual Studio to do the work so far as this
is
targeted for the Win32 platform. I recently decided to move to Borland C++ Builder after I got fed
up with the VC++ IDE. I had to tweak a couple of things in the header files to get it compiling,
but the changes were minor (available upon request). The problem I came into was on the link,
unresolved symbol errors on functions exported from php4ts.dll. Digging in I realized that the
problem was because /some/ of the names of the functions I was importing (via ZEND_API, PHP_API,
etc) were getting mangled because they were not enclosed in the BEGIN_EXTERN_C() / END_EXTERN_C()
macros. Is this intentional, or is it just because no one has ever tried to use the headers from
inside a .cpp file?
Some of the functions of intrest are:
main/php_main.h:
php_request_startup()
...
php_handle_auth_data()
ext/standard/php_output.h
php_output_startup()
..
php_get_output_start_lineno()
I've modified the header files to block the __declspec(dllimport) functions with BEGIN /
END_EXTERN_C. If there is no reason to *not* have these in, may I submit a patch to allow the
headers to be included in C++Builder and other C++ build environments?
My C is rusty, so flame me if I'm wrong,
Bry