]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability fix for OpenSolaris.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 10 Aug 2010 15:37:53 +0000 (17:37 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 10 Aug 2010 15:37:53 +0000 (17:37 +0200)
compat/compat.h
compat/os/solaris.h
configure.in
src/ip/Address.h

index 6f668775cddab65d46403882f9391ac4f5727969..0830219dfb55464924c90c093d63695557c2b509 100644 (file)
 /******************************************************/
 #include "compat/osdetect.h"
 
+/* ugly hack. But we need to set this REALLY soon in the header */
+#if _SQUID_SOLARIS_
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 1
+#endif
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED 1
+#endif
+#endif
+
+
 
 /*****************************************************/
 /* FDSETSIZE is messy and needs to be done before    */
index e90c0139f52df39bcc8e3614766fc966dc68553f..307e1c0fa1da696410f423bf3a06faa83ea0fcb8 100644 (file)
@@ -8,6 +8,27 @@
 
 #if _SQUID_SOLARIS_
 
+
+/*
+ * ugly hack. System headers require wcsstr, but don't define it.
+ */ 
+#include <wchar.h>
+#ifdef wcsstr
+#undef wcsstr
+#endif /* wcsstr */
+#define wcsstr wcswcs
+
+/*
+ * we need some standard-based extensions
+ */
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 1
+#endif
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED 1
+#endif
+
+
 /*
  * On Solaris 9 x86, gcc may includes a "fixed" set of old system
  * include files that is incompatible with the updated Solaris
index 410a9a786805f7ae299ed77385dcd98ead50184d..d78f9759565db2b6d2d50dbee9fc582a8162328d 100644 (file)
@@ -73,6 +73,10 @@ AC_PATH_PROG(AR, ar, $FALSE)
 AR_R="$AR r"
 AC_SUBST(AR_R)
 
+# this needs to be before any test is run, to have more standard
+# functions available on some Unix sysems (e.g. Solaris)
+AC_USE_SYSTEM_EXTENSIONS
+
 AC_ARG_ENABLE(strict-error-checking,
   AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
                  with all possible static compiler error-checks enabled.
@@ -127,8 +131,6 @@ fi
 SQUID_CC_GUESS_VARIANT
 SQUID_CC_GUESS_OPTIONS
 
-
-
 dnl find out the exe extension for this platform.
 dnl If it is not empty, use it for CGI as well.
 AC_EXEEXT
@@ -2151,7 +2153,8 @@ AC_CHECK_HEADERS( \
   stdint.h \
   inttypes.h \
   db.h \
-  db_185.h
+  db_185.h \
+  wchar.h
 )
 
 CHECK_STRUCT_PAM_CONV
index 37c07179680941f87017f21553ade1f78e357669..c42dfd4b5be6a602022b888b4ce2c1c53dcb9c8a 100644 (file)
@@ -44,6 +44,9 @@
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
 #ifdef _SQUID_MSWIN_
 #include <ws2tcpip.h>
 #endif