Re: Compiling under Borland C Builder / No BEGIN_EXTERN_C?

From: Date: Wed, 14 Feb 2001 05:44:26 +0000
Subject: Re: Compiling under Borland C Builder / No BEGIN_EXTERN_C?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-46533@lists.php.net to get a copy of this message
There is no good reason the BEGIN_EXTERN_C() haven't been included. We'd welcome a patch. Check out the other places we do put these to get an idea where they should be. In any case, one thing I've wanted to do for a long time is get PHP to compile with the freeware Borland C++ compiler. However, as it doesn't read .dsp it would have been lots of work. Any chance you can export makefiles from the Builder once things work for you and share them with us? If it works nicely you could be the maintainer :) It would allow people who don't have Visual C++ to compile PHP 4 on Windows. Thanks, Andi At 06:46 PM 2/13/2001 -0500, Bryan Mayland wrote:
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 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.dev (#46533) next »