From 8dca8f0e69c2e697b45bc747e3dccb27bbb6a326 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Wed, 3 Jan 2001 18:06:10 +0000 Subject: [PATCH] Make socket support compile under Solaris 8 with the Sun WorkShop compiler. PR: 8468 --- ext/sockets/sockets.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 6db0c5d2c1..70dc2dcbf1 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -26,9 +26,14 @@ /* This hopefully will fix some compile errors on other platforms -- * the usage of msg_control/msg_controllen are X/Open Extended attributes, - * or so it seems, by reading HP/UX 10.20 manual pages. */ + * or so it seems, by reading HP/UX 10.20 manual pages. + * + * The second two defines are for Solaris 8 with the Sun WorkShop compiler. + */ #define _XOPEN_SOURCE_EXTENDED +#define _XPG4_2 +#define __EXTENSIONS__ #include "ext/standard/info.h" #include "php_sockets.h" @@ -66,6 +71,12 @@ php_sockets_globals sockets_globals; #endif #endif +/* Solaris 8 doesn't appear to define SUN_LEN in */ +#ifndef SUN_LEN +#define SUN_LEN(su) \ + (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) +#endif + /* Use the read() wrapper, stopping at '\n', '\r', or '\0'. */ #define PHP_NORMAL_READ 0x0001 /* Use the read() wrapper, but read until the entire buffer is filled. */ -- 2.50.1