mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-30 16:01:46 +00:00
- 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.
This commit is contained in:
parent
b2207b250f
commit
81f9b20bfb
2 changed files with 12 additions and 3 deletions
3
Makefile
3
Makefile
|
@ -311,7 +311,8 @@ ifeq ($(PLATFORM),darwin)
|
||||||
BASE_CFLAGS = -Wall -Wimplicit -Wstrict-prototypes
|
BASE_CFLAGS = -Wall -Wimplicit -Wstrict-prototypes
|
||||||
|
|
||||||
ifeq ($(ARCH),ppc)
|
ifeq ($(ARCH),ppc)
|
||||||
OPTIMIZE += -faltivec -O3
|
BASE_CFLAGS += -faltivec
|
||||||
|
OPTIMIZE += -O3
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),i386)
|
ifeq ($(ARCH),i386)
|
||||||
OPTIMIZE += -march=prescott -mfpmath=sse
|
OPTIMIZE += -march=prescott -mfpmath=sse
|
||||||
|
|
|
@ -266,12 +266,20 @@ Sys_StringToSockaddr
|
||||||
static qboolean Sys_StringToSockaddr(const char *s, struct sockaddr *sadr, int sadr_len, sa_family_t family)
|
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 hints, *res = NULL, *search;
|
||||||
|
struct addrinfo *hintsp;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
memset(sadr, '\0', sizeof(*sadr));
|
memset(sadr, '\0', sizeof(*sadr));
|
||||||
memset(&hints, '\0', sizeof(hints));
|
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);
|
retval = getaddrinfo(s, NULL, &hints, &res);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue