Subversion Repositories eduke32

Compare Revisions

Regard whitespace Rev 5036 → Rev 5037

/polymer/eduke32/Makefile
291,6 → 291,10
LIBS += -lFLAC -lvorbisfile -lvorbis -logg
endif
 
ifeq ($(PLATFORM),BSD)
LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lexecinfo
endif
 
ifeq ($(PLATFORM),DARWIN)
# LIBDIRS += -L$(AUDIOLIB_ROOT)/third-party/Apple/lib
 
/polymer/eduke32/Makefile.common
102,39 → 102,39
# the outside world. This allows cross-compilation by overriding
# CC and giving us PLATFORM specifically.
#
ifndef HOST
ifndef HOSTPLATFORM
uname:=$(strip $(shell uname -s))
HOST=UNKNOWN
HOSTPLATFORM=UNKNOWN
ifeq ($(findstring Linux,$(uname)),Linux)
HOST=LINUX
HOSTPLATFORM=LINUX
endif
ifeq ($(findstring BSD,$(uname)),BSD)
HOST=BSD
HOSTPLATFORM=BSD
endif
ifeq ($(findstring MINGW,$(uname)),MINGW)
HOST=WINDOWS
HOSTPLATFORM=WINDOWS
endif
ifeq ($(findstring Darwin,$(uname)),Darwin)
HOST=DARWIN
HOSTPLATFORM=DARWIN
endif
ifeq ($(findstring BeOS,$(uname)),BeOS)
HOST=BEOS
HOSTPLATFORM=BEOS
endif
ifeq ($(findstring skyos,$(uname)),skyos)
HOST=SKYOS
HOSTPLATFORM=SKYOS
endif
ifeq ($(findstring QNX,$(uname)),QNX)
HOST=QNX
HOSTPLATFORM=QNX
endif
ifeq ($(findstring SunOS,$(uname)),SunOS)
HOST=SUNOS
HOSTPLATFORM=SUNOS
endif
ifeq ($(findstring syllable,$(uname)),syllable)
HOST=SYLLABLE
HOSTPLATFORM=SYLLABLE
endif
endif
ifndef PLATFORM
PLATFORM=$(HOST)
PLATFORM=$(HOSTPLATFORM)
endif
 
ifndef SUBPLATFORM
298,7 → 298,7
W_STRICT_OVERFLOW := -Wno-strict-overflow
endif
 
ifeq ($(HOST),WINDOWS)
ifeq ($(HOSTPLATFORM),WINDOWS)
# MSYS2 lets you create files named NUL but has a /dev/null. Go figure.
ifeq (,$(wildcard /dev/null))
DONT_PRINT = > NUL 2>&1
786,7 → 786,7
COMMONFLAGS += -fno-pic
endif
ifeq ($(PLATFORM),BSD)
COMPILERFLAGS+= -I/usr/X11R6/include
COMPILERFLAGS+= -I/usr/local/include
 
RENDERTYPE=SDL
MIXERTYPE=SDL
995,7 → 995,9
 
ifneq ($(PLATFORM),WINDOWS)
ifneq ($(PLATFORM),WII)
ifneq ($(PLATFORM),BSD)
LIBS+= -ldl
endif
ifneq ($(PLATFORM),DARWIN)
LIBS+= -pthread
endif
/polymer/eduke32/build/include/a.h
28,7 → 28,7
 
#if !defined(NOASM) && (defined(_MSC_VER) || (defined(__GNUC__) && defined(__i386__)))
 
#if defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__SYLLABLE__)
#if defined __linux || defined __APPLE__ || defined EDUKE32_BSD || defined __SYLLABLE__
#define __cdecl
#endif
 
/polymer/eduke32/build/include/compat.h
69,7 → 69,7
#define max(x,y) ((x) > (y) ? (x) : (y))
#endif
 
#ifndef __APPLE__
#if !defined __APPLE__ && (!defined EDUKE32_BSD || !__STDC__)
# include <malloc.h>
#endif
 
91,6 → 91,10
# endif
#endif
 
#if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __bsdi__ || defined __DragonFly__
# define EDUKE32_BSD
#endif
 
#if defined __ANDROID__ || defined EDUKE32_IOS
# define EDUKE32_TOUCH_DEVICES
# define EDUKE32_GLES
264,7 → 268,7
# define B_SWAP32(x) __swap32(x)
# define B_SWAP16(x) __swap16(x)
 
#elif defined(__FreeBSD__) || defined(__NetBSD__)
#elif defined EDUKE32_BSD
# include <sys/endian.h>
# if _BYTE_ORDER == _LITTLE_ENDIAN
# define B_LITTLE_ENDIAN 1
860,7 → 864,7
{
#ifdef _WIN32
void *ptr = _aligned_malloc(size, alignment);
#elif defined __APPLE__
#elif defined __APPLE__ || defined EDUKE32_BSD
void *ptr = NULL;
posix_memalign(&ptr, alignment, size);
#else
/polymer/eduke32/build/src/baselayer.c
156,7 → 156,7
#if defined _WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#elif defined __linux || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __APPLE__
#elif defined __linux || defined EDUKE32_BSD || defined __APPLE__
# include <sys/mman.h>
#endif
 
181,7 → 181,7
initprintf("VirtualProtect() error! Crashing in 3... 2... 1...\n");
return 1;
}
# elif defined __linux || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __APPLE__
# elif defined __linux || defined EDUKE32_BSD || defined __APPLE__
int32_t pagesize;
size_t dep_begin_page;
pagesize = sysconf(_SC_PAGE_SIZE);
/polymer/eduke32/build/src/compat.c
27,10 → 27,11
# include <dirent.h>
#endif
 
#if defined(__linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#if defined __linux || defined EDUKE32_BSD
# include <libgen.h> // for dirname()
#endif
#if defined(__FreeBSD__)
#if defined __FreeBSD__
# include <limits.h> // for PATH_MAX
# include <sys/sysctl.h> // for sysctl() to get path to executable
#endif
 
304,8 → 305,20
 
#elif defined EDUKE32_OSX
dir = osx_getappdir();
#elif defined(__linux) || defined(__NetBSD__) || defined(__OpenBSD__)
#elif defined __FreeBSD__
// the sysctl should also work when /proc/ is not mounted (which seems to
// be common on FreeBSD), so use it..
char buf[PATH_MAX] = {0};
int name[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
size_t len = sizeof(buf)-1;
int ret = sysctl(name, sizeof(name)/sizeof(name[0]), buf, &len, NULL, 0);
if(ret == 0 && buf[0] != '\0') {
// again, remove executable name with dirname()
// on FreeBSD dirname() seems to use some internal buffer
dir = strdup(dirname(buf));
}
#elif defined __linux || defined EDUKE32_BSD
char buf[PATH_MAX] = {0};
char buf2[PATH_MAX] = {0};
# ifdef __linux
Bsnprintf(buf, sizeof(buf), "/proc/%d/exe", getpid());
319,18 → 332,6
// on FreeBSD it seems to use some internal buffer instead.. anyway, just strdup()
dir = Bstrdup(dirname(buf2));
}
#elif defined(__FreeBSD__)
// the sysctl should also work when /proc/ is not mounted (which seems to
// be common on FreeBSD), so use it..
char buf[PATH_MAX] = {0};
int name[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
size_t len = sizeof(buf)-1;
int ret = sysctl(name, sizeof(name)/sizeof(name[0]), buf, &len, NULL, 0);
if(ret == 0 && buf[0] != '\0') {
// again, remove executable name with dirname()
// on FreeBSD dirname() seems to use some internal buffer
dir = strdup(dirname(buf));
}
#endif
 
return dir;
/polymer/eduke32/source/common.c
599,7 → 599,7
}
}
 
#if defined EDUKE32_OSX || defined __linux__ || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__
#if defined EDUKE32_OSX || defined __linux__ || defined EDUKE32_BSD
static void G_AddSteamPaths(const char *basepath)
{
char buf[BMAX_PATH];
803,7 → 803,7
 
void G_AddSearchPaths(void)
{
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#if defined __linux__ || defined EDUKE32_BSD
char buf[BMAX_PATH];
char *homepath = Bgethomedir();