]> granicus.if.org Git - php/commitdiff
Make socket support compile under Solaris 8 with the Sun WorkShop compiler.
authorJon Parise <jon@php.net>
Wed, 3 Jan 2001 18:06:10 +0000 (18:06 +0000)
committerJon Parise <jon@php.net>
Wed, 3 Jan 2001 18:06:10 +0000 (18:06 +0000)
PR: 8468

ext/sockets/sockets.c

index 6db0c5d2c186192dabb64f3c572294ea8d8a3dcb..70dc2dcbf1301a7162651dfd1a4d61a2a301f95b 100644 (file)
 
 /* 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 <sys/un.h> */
+#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. */