mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-12-13 05:31:29 +00:00
* FreeBSD fixes/updates from Andreas Kohn
This commit is contained in:
parent
6ceb4a64e4
commit
4bc5c29115
8 changed files with 81 additions and 28 deletions
|
@ -476,7 +476,7 @@ void *Hunk_AllocDebug( int size, ha_pref preference, char *label, char *file, in
|
||||||
void *Hunk_Alloc( int size, ha_pref preference );
|
void *Hunk_Alloc( int size, ha_pref preference );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#if defined(__GNUC__)
|
||||||
// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=371
|
// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=371
|
||||||
// custom Snd_Memset implementation for glibc memset bug workaround
|
// custom Snd_Memset implementation for glibc memset bug workaround
|
||||||
void Snd_Memset (void* dest, const int val, const size_t count);
|
void Snd_Memset (void* dest, const int val, const size_t count);
|
||||||
|
|
|
@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#include "../game/q_shared.h"
|
#include "../game/q_shared.h"
|
||||||
#include "qcommon.h"
|
#include "qcommon.h"
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#if defined __linux__ || defined MACOS_X
|
#if defined __linux__ || defined MACOS_X || defined __FreeBSD__
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#else
|
#else
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ void VM_Compile( vm_t *vm, vmHeader_t *header ) {
|
||||||
case OP_CVFI:
|
case OP_CVFI:
|
||||||
#ifndef FTOL_PTR // WHENHELLISFROZENOVER // bk001213 - was used in 1.17
|
#ifndef FTOL_PTR // WHENHELLISFROZENOVER // bk001213 - was used in 1.17
|
||||||
// not IEEE complient, but simple and fast
|
// not IEEE complient, but simple and fast
|
||||||
EmitString( "D9 07" ); // fld dword ptr [edi]
|
EmitString( "D9 07" ); // fld dword ptr [edi]
|
||||||
EmitString( "DB 1F" ); // fistp dword ptr [edi]
|
EmitString( "DB 1F" ); // fistp dword ptr [edi]
|
||||||
#else // FTOL_PTR
|
#else // FTOL_PTR
|
||||||
// call the library conversion function
|
// call the library conversion function
|
||||||
|
|
|
@ -48,7 +48,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
#include "macosx_glimp.h"
|
#include "macosx_glimp.h"
|
||||||
|
|
||||||
#elif defined( __linux__ )
|
#elif defined( __linux__ ) || defined(__FreeBSD__)
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include <GL/glx.h>
|
#include <GL/glx.h>
|
||||||
|
@ -57,14 +57,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#include <GL/fxmesa.h>
|
#include <GL/fxmesa.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif defined( __FreeBSD__ ) // rb010123
|
|
||||||
|
|
||||||
#include <GL/gl.h>
|
|
||||||
#include <GL/glx.h>
|
|
||||||
#if defined(__FX__)
|
|
||||||
#include <GL/fxmesa.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <gl.h>
|
#include <gl.h>
|
||||||
|
|
|
@ -228,6 +228,34 @@ void Sys_PumpEvents( void );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//======================= FreeBSD DEFINES =====================
|
||||||
|
/* Adapted from game/q_shared.h */
|
||||||
|
#ifdef __FreeBSD__ // rb010123
|
||||||
|
|
||||||
|
#define stricmp strcasecmp
|
||||||
|
|
||||||
|
#define MAC_STATIC
|
||||||
|
#define ID_INLINE inline
|
||||||
|
|
||||||
|
#ifdef __i386__
|
||||||
|
#define CPUSTRING "freebsd-i386"
|
||||||
|
#elif defined __axp__
|
||||||
|
#define CPUSTRING "freebsd-alpha"
|
||||||
|
#else
|
||||||
|
#define CPUSTRING "freebsd-other"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define PATH_SEP '/'
|
||||||
|
|
||||||
|
#ifdef Q3_STATIC
|
||||||
|
#define GAME_HARD_LINKED
|
||||||
|
#define CGAME_HARD_LINKED
|
||||||
|
#define UI_HARD_LINKED
|
||||||
|
#define BOTLIB_HARD_LINKED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
//=============================================================
|
//=============================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -216,6 +216,37 @@ void Sys_PumpEvents( void );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//======================= FreeBSD DEFINES =================================
|
||||||
|
|
||||||
|
// the mac compiler can't handle >32k of locals, so we
|
||||||
|
// just waste space and make big arrays static...
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
|
||||||
|
// bk001205 - from Makefile
|
||||||
|
#define stricmp strcasecmp
|
||||||
|
|
||||||
|
#define MAC_STATIC // bk: FIXME
|
||||||
|
|
||||||
|
#ifdef __i386__
|
||||||
|
#define CPUSTRING "freebsd-i386"
|
||||||
|
#elif defined __axp__
|
||||||
|
#define CPUSTRING "freebsd-alpha"
|
||||||
|
#else
|
||||||
|
#define CPUSTRING "freebsd-other"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define PATH_SEP '/'
|
||||||
|
|
||||||
|
// bk001205 - try
|
||||||
|
#ifdef Q3_STATIC
|
||||||
|
#define GAME_HARD_LINKED
|
||||||
|
#define CGAME_HARD_LINKED
|
||||||
|
#define UI_HARD_LINKED
|
||||||
|
#define BOTLIB_HARD_LINKED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
//=============================================================
|
//=============================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -317,15 +317,15 @@ ifeq ($(PLATFORM),freebsd)
|
||||||
DEBUG_CFLAGS=$(BASE_CFLAGS) -g -Wall -Werror
|
DEBUG_CFLAGS=$(BASE_CFLAGS) -g -Wall -Werror
|
||||||
|
|
||||||
ifeq ($(ARCH),axp)
|
ifeq ($(ARCH),axp)
|
||||||
CC=pgcc
|
CC=gcc
|
||||||
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -ffast-math -funroll-loops \
|
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -ffast-math -funroll-loops \
|
||||||
-fomit-frame-pointer -fexpensive-optimizations
|
-fomit-frame-pointer -fexpensive-optimizations
|
||||||
else
|
else
|
||||||
CC=pgcc
|
CC=gcc
|
||||||
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -mtune=pentiumpro \
|
RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -mtune=pentiumpro \
|
||||||
-march=pentium -fomit-frame-pointer -pipe -ffast-math \
|
-march=pentium -fomit-frame-pointer -pipe -ffast-math \
|
||||||
-malign-loops=2 -malign-jumps=2 -malign-functions=2 \
|
-falign-loops=2 -falign-jumps=2 -falign-functions=2 \
|
||||||
-fno-strict-aliasing - fstrength-reduce
|
-fno-strict-aliasing -fstrength-reduce
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIBEXT=a
|
LIBEXT=a
|
||||||
|
@ -411,12 +411,6 @@ else # ifeq IRIX
|
||||||
ARFLAGS=ar rv
|
ARFLAGS=ar rv
|
||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
|
|
||||||
ifeq ($(PLATFORM),freebsd)
|
|
||||||
LDFLAGS=-lm
|
|
||||||
else
|
|
||||||
LDFLAGS=-ldl -lm
|
|
||||||
endif # ifeq freebsd
|
|
||||||
|
|
||||||
TARGETS=\
|
TARGETS=\
|
||||||
$(B)/$(PLATFORM)q3ded
|
$(B)/$(PLATFORM)q3ded
|
||||||
|
|
||||||
|
@ -641,6 +635,9 @@ endif
|
||||||
|
|
||||||
#platform specific objects
|
#platform specific objects
|
||||||
ifeq ($(PLATFORM),freebsd)
|
ifeq ($(PLATFORM),freebsd)
|
||||||
|
ifeq ($(ARCH),axp)
|
||||||
|
Q3POBJ=
|
||||||
|
else
|
||||||
Q3POBJ=\
|
Q3POBJ=\
|
||||||
$(B)/client/unix_main.o \
|
$(B)/client/unix_main.o \
|
||||||
$(B)/client/unix_net.o \
|
$(B)/client/unix_net.o \
|
||||||
|
@ -653,9 +650,14 @@ ifeq ($(PLATFORM),freebsd)
|
||||||
$(B)/client/linux_snd.o \
|
$(B)/client/linux_snd.o \
|
||||||
$(B)/client/sdl_snd.o \
|
$(B)/client/sdl_snd.o \
|
||||||
$(B)/client/snd_mixa.o \
|
$(B)/client/snd_mixa.o \
|
||||||
$(B)/client/matha.o \
|
$(B)/client/matha.o
|
||||||
$(B)/client/ftol.o \
|
|
||||||
$(B)/client/snapvector.o
|
ifeq ($(ARCH),i386)
|
||||||
|
Q3POBJ += $(B)/client/ftola.o $(B)/client/snapvectora.o
|
||||||
|
Q3POBJ_SMP += $(B)/client/ftola.o $(B)/client/snapvectora.o
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif # FreeBSD-axp
|
||||||
else
|
else
|
||||||
ifeq ($(PLATFORM),irix)
|
ifeq ($(PLATFORM),irix)
|
||||||
Q3POBJ=\
|
Q3POBJ=\
|
||||||
|
@ -880,7 +882,7 @@ $(B)/client/irix_glimp.o : $(UDIR)/irix_glimp.c; $(DO_CC)
|
||||||
$(B)/client/irix_glimp_smp.o : $(UDIR)/irix_glimp.c; $(DO_SMP_CC)
|
$(B)/client/irix_glimp_smp.o : $(UDIR)/irix_glimp.c; $(DO_SMP_CC)
|
||||||
$(B)/client/irix_snd.o : $(UDIR)/irix_snd.c; $(DO_CC)
|
$(B)/client/irix_snd.o : $(UDIR)/irix_snd.c; $(DO_CC)
|
||||||
$(B)/client/irix_input.o : $(UDIR)/irix_input.c; $(DO_CC)
|
$(B)/client/irix_input.o : $(UDIR)/irix_input.c; $(DO_CC)
|
||||||
$(B)/client/linux_signals.o : $(UDIR)/linux_signals.c; $(DO_CC)
|
$(B)/client/linux_signals.o : $(UDIR)/linux_signals.c; $(DO_CC) $(GL_CFLAGS)
|
||||||
$(B)/client/linux_common.o : $(UDIR)/linux_common.c; $(DO_CC)
|
$(B)/client/linux_common.o : $(UDIR)/linux_common.c; $(DO_CC)
|
||||||
$(B)/client/linux_glimp.o : $(UDIR)/linux_glimp.c; $(DO_CC) $(GL_CFLAGS)
|
$(B)/client/linux_glimp.o : $(UDIR)/linux_glimp.c; $(DO_CC) $(GL_CFLAGS)
|
||||||
$(B)/client/sdl_glimp.o : $(UDIR)/sdl_glimp.c; $(DO_CC) $(GL_CFLAGS)
|
$(B)/client/sdl_glimp.o : $(UDIR)/sdl_glimp.c; $(DO_CC) $(GL_CFLAGS)
|
||||||
|
|
|
@ -76,7 +76,7 @@ int Sys_Milliseconds (void)
|
||||||
return curtime;
|
return curtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__linux__) && !defined(DEDICATED)
|
#if (defined(__linux__) || defined(__FreeBSD__)) && !defined(DEDICATED)
|
||||||
/*
|
/*
|
||||||
================
|
================
|
||||||
Sys_XTimeToSysTime
|
Sys_XTimeToSysTime
|
||||||
|
@ -425,7 +425,7 @@ char *Sys_GetCurrentUser( void )
|
||||||
return p->pw_name;
|
return p->pw_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__) || defined(__FreeBSD__)
|
||||||
// TTimo
|
// TTimo
|
||||||
// sysconf() in libc, POSIX.1 compliant
|
// sysconf() in libc, POSIX.1 compliant
|
||||||
unsigned int Sys_ProcessorCount(void)
|
unsigned int Sys_ProcessorCount(void)
|
||||||
|
|
Loading…
Reference in a new issue