aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-05-17 10:46:41 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-05-17 10:46:41 +0000
commitea59b8486a5049be06260c655c6e863276a45deb (patch)
tree82ddec34211fc45449cae9d195eb894ccc859a1e
parent8549e51a13a4fb674f9d65139c2f433c7def13ca (diff)
downloadioquake3-aero-ea59b8486a5049be06260c655c6e863276a45deb.tar.gz
ioquake3-aero-ea59b8486a5049be06260c655c6e863276a45deb.zip
- Workaround for buggy MacOSX getaddrinfo() implementation that doesn't accept AF_UNSPEC parameter in hints structure. Thanks icculus for reporting.
- Add -faltivec flag for debug builds. git-svn-id: svn://svn.icculus.org/quake3/trunk@1344 edf5b092-35ff-0310-97b2-ce42778d08ea
-rw-r--r--Makefile3
-rw-r--r--code/qcommon/net_ip.c12
2 files changed, 12 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index f1005e3..e124f25 100644
--- a/Makefile
+++ b/Makefile
@@ -311,7 +311,8 @@ ifeq ($(PLATFORM),darwin)
BASE_CFLAGS = -Wall -Wimplicit -Wstrict-prototypes
ifeq ($(ARCH),ppc)
- OPTIMIZE += -faltivec -O3
+ BASE_CFLAGS += -faltivec
+ OPTIMIZE += -O3
endif
ifeq ($(ARCH),i386)
OPTIMIZE += -march=prescott -mfpmath=sse
diff --git a/code/qcommon/net_ip.c b/code/qcommon/net_ip.c
index a2960c4..cb2094e 100644
--- a/code/qcommon/net_ip.c
+++ b/code/qcommon/net_ip.c
@@ -266,12 +266,20 @@ Sys_StringToSockaddr
static qboolean Sys_StringToSockaddr(const char *s, struct sockaddr *sadr, int sadr_len, sa_family_t family)
{
struct addrinfo hints, *res = NULL, *search;
+ struct addrinfo *hintsp;
int retval;
memset(sadr, '\0', sizeof(*sadr));
memset(&hints, '\0', sizeof(hints));
-
- hints.ai_family = family;
+
+ // workaround for buggy MacOSX getaddrinfo implementation that doesn't handle AF_UNSPEC in hints correctly.
+ if(family == AF_UNSPEC)
+ hintsp = NULL;
+ else
+ {
+ hintsp = &hints;
+ hintsp->ai_family = family;
+ }
retval = getaddrinfo(s, NULL, &hints, &res);