If you look at their socket.h, they have a macro condition in the XPG4 compatibility 
section that
renames all the socket functions to __xnet_whatever. The condition either calls 
#pragma  redefine extname, or #define. #define was
bad in this situation becuase PHP_FUNCTION(socket) would become 
PHP_FUNCTION(__xnet_socket).

What #pragma redefine extname does, is change the name reference after compilation.
So , all references to socket,listen, bind, etc in socket.o, get renamed to the 
corresponding __xnet_
xopen functions.

-Jason




----- Original Message -----
From: "Andi Gutmans" <[EMAIL PROTECTED]>
To: "Jason Greene" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, April 11, 2001 5:21 PM
Subject: Re: [PHP-CVS] cvs: php4 /ext/sockets sockets.c


> Just curious. What does their pragma do?
>
> Andi
>
> At 03:16 AM 4/10/2001 +0000, Jason Greene wrote:
> >jason           Mon Apr  9 20:16:06 2001 EDT
> >
> >   Modified files:
> >     /php4/ext/sockets   sockets.c
> >   Log:
> >   Fix for PR #9729, 9664, 9656, 8667.
> >   All compilers on Solaris should build this extension correctly now.
> >   It turns out the SUN CC, by default, enables a define that enables the
> > use of
> >   #pragma redefine extname in sun header files. This is why cc would work,
> >   and gcc wouldn't.
> >
> >   -Jason
> >
> >
> >Index: php4/ext/sockets/sockets.c
> >diff -u php4/ext/sockets/sockets.c:1.33 php4/ext/sockets/sockets.c:1.34
> >--- php4/ext/sockets/sockets.c:1.33     Thu Mar 22 05:16:58 2001
> >+++ php4/ext/sockets/sockets.c  Mon Apr  9 20:16:05 2001
> >@@ -17,7 +17,7 @@
> >     +----------------------------------------------------------------------+
> >   */
> >
> >-/* $Id: sockets.c,v 1.33 2001/03/22 13:16:58 sniper Exp $ */
> >+/* $Id: sockets.c,v 1.34 2001/04/10 03:16:05 jason Exp $ */
> >
> >  #include "php.h"
> >
> >@@ -34,6 +34,10 @@
> >  #define _XOPEN_SOURCE_EXTENDED
> >  #define _XPG4_2
> >  #define __EXTENSIONS__
> >+
> >+#ifndef __PRAGMA_REDEFINE_EXTNAME
> >+#define __PRAGMA_REDEFINE_EXTNAME
> >+#endif
> >
> >  #include "ext/standard/info.h"
> >  #include "php_sockets.h"
> >
> >
> >
> >--
> >PHP CVS Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to