Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Makefile.shared
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ ifndef PLATFORM
ifneq (,$(findstring -freebsd,$(TARGETMACHINE)))
PLATFORM=BSD
endif
ifneq (,$(findstring -netbsd,$(TARGETMACHINE)))
PLATFORM=BSD
endif
ifneq (,$(findstring -mingw32,$(TARGETMACHINE)))
PLATFORM=WINDOWS
endif
Expand Down Expand Up @@ -96,7 +99,10 @@ ifeq ($(RENDERTYPE),SDL)
ifneq (,$(shell $(PKGCONFIG) --atleast-version=3.4 gtk+-3.0 && echo yes))
HAVE_GTK=1
GTKCONFIG_CFLAGS=-DHAVE_GTK $(shell $(PKGCONFIG) --cflags gtk+-3.0)
GTKCONFIG_LIBS=$(shell $(PKGCONFIG) --libs gtk+-3.0) -ldl
GTKCONFIG_LIBS=$(shell $(PKGCONFIG) --libs gtk+-3.0)
ifeq ($(PLATFORM),LINUX)
BUILDLDFLAGS+= -ldl
endif
else
HAVE_GTK=0
endif
Expand Down
9 changes: 6 additions & 3 deletions include/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
#ifndef _DARWIN_C_SOURCE
# define _DARWIN_C_SOURCE 1
#endif
#ifdef __NetBSD__
# define _NETBSD_SOURCE 1 // https://gnats.netbsd.org/60227
#endif

#if defined(_MSC_VER)
#define _CRT_DECLARE_NONSTDC_NAMES 0
Expand Down Expand Up @@ -120,9 +123,9 @@ typedef unsigned __int64 uint64_t;
# define B_LITTLE_ENDIAN 0
# define B_BIG_ENDIAN 1
# endif
# define B_SWAP64(x) __bswap64(x)
# define B_SWAP32(x) __bswap32(x)
# define B_SWAP16(x) __bswap16(x)
# define B_SWAP64(x) bswap64(x)
# define B_SWAP32(x) bswap32(x)
# define B_SWAP16(x) bswap16(x)

#elif defined(__APPLE__)
# if defined(__LITTLE_ENDIAN__)
Expand Down
2 changes: 1 addition & 1 deletion src/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ char *strlwr(char *s)
{
char *t = s;
if (!s) return s;
while (*t) { *t = tolower(*t); t++; }
while (*t) { *t = tolower((unsigned char)*t); t++; }
return s;
}

Expand Down
2 changes: 2 additions & 0 deletions src/mmulti.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,11 @@ static int lookuphost(const char *name, struct sockaddr *host, int warnifmany)
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_ADDRCONFIG;
hints.ai_family = domain;
#ifdef AI_V4MAPPED
if (domain == PF_INET6) {
hints.ai_flags |= AI_V4MAPPED;
}
#endif
hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP;

Expand Down