From 3615b3d2502f7b9ab02afb85b0148ddd64e6ead5 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Wed, 14 Dec 2005 03:01:38 +0000 Subject: [PATCH] Fix build on Solaris 10. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1577 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 10 ++++++++++ configure.in | 1 + ircd/ircd_crypt_native.c | 2 +- ircd/os_generic.c | 16 ++++++++++++++-- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1738f0..b9fc05a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-12-13 Michael Poole + + * configure.in: Define a macro when compiling on Solaris. + + * ircd/ircd_crypt_native.c (_XOPEN_SOURCE): Turn down to 500 so + that Solaris doesn't complain that SUSv3 requires C99. + + * ircd/os_generic.c (_XOPEN_SOURCE): Likewise, but leave it at 600 + on non-Solaris platforms so that IPv6 stays supported. + 2005-12-13 Michael Poole * ircd/m_join.c (ms_join): Prevent net rides allowed by moving the diff --git a/configure.in b/configure.in index e893d33..1ddff77 100644 --- a/configure.in +++ b/configure.in @@ -171,6 +171,7 @@ case "$host" in else unet_poll_syscall=no fi + AC_DEFINE([IRCU_SOLARIS], 1, [Define if building on Solaris]) ;; *-sunos*) diff --git a/ircd/ircd_crypt_native.c b/ircd/ircd_crypt_native.c index fe267c5..c6b1c58 100644 --- a/ircd/ircd_crypt_native.c +++ b/ircd/ircd_crypt_native.c @@ -25,7 +25,7 @@ * function (typically a DES encryption routine, but can be anything nowadays). * */ -#define _XOPEN_SOURCE 600 +#define _XOPEN_SOURCE 500 #include "config.h" #include "ircd_crypt.h" diff --git a/ircd/os_generic.c b/ircd/os_generic.c index 42817a7..ff56fce 100644 --- a/ircd/os_generic.c +++ b/ircd/os_generic.c @@ -22,8 +22,20 @@ */ #include "config.h" -#define _XOPEN_SOURCE 600 /**< make limits.h #define IOV_MAX */ -#define __EXTENSIONS__ 1 /**< make Solaris netinet/in.h know IPv6 */ +#ifdef IRCU_SOLARIS +/* Solaris requires C99 support for SUSv3, but C99 support breaks other + * parts of the build. So fall back to SUSv2, but request IPv6 support + * by defining __EXTENSIONS__. + */ +#define _XOPEN_SOURCE 500 +#define __EXTENSIONS__ 1 +#else +/* FreeBSD 6.0 requires SUSv3 to support IPv6. Apparently some other + * OS requires SUSv3 to define IOV_MAX, but its identity is lost for + * the time being. + */ +#define _XOPEN_SOURCE 600 +#endif #include "ircd_osdep.h" #include "msgq.h" -- 2.20.1