From bd433afef712ac9c734949667503f1795eb361c8 Mon Sep 17 00:00:00 2001 From: tma Date: Sat, 22 Sep 2007 20:32:11 +0000 Subject: * Move the conditional compilation of bg_lib.c from the Makefile to cpp in order to force dependency generation on bg_lib.* * Make testing USE_ defines more consistent git-svn-id: svn://svn.icculus.org/quake3/trunk@1186 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/game/bg_lib.c | 24 +++--------------------- code/game/bg_lib.h | 2 +- 2 files changed, 4 insertions(+), 22 deletions(-) (limited to 'code/game') diff --git a/code/game/bg_lib.c b/code/game/bg_lib.c index 1e65ae5..2b1af69 100644 --- a/code/game/bg_lib.c +++ b/code/game/bg_lib.c @@ -3,6 +3,8 @@ // bg_lib,c -- standard C library replacement routines used by code // compiled for the virtual machine +#ifdef Q3_VM + #include "../qcommon/q_shared.h" /*- @@ -43,10 +45,6 @@ static char sccsid[] = "@(#)qsort.c 8.1 (Berkeley) 6/4/93"; static const char rcsid[] = #endif /* LIBC_SCCS and not lint */ -#if !defined( Q3_VM ) -typedef int cmp_t(const void *, const void *); -#endif - static char* med3(char *, char *, char *, cmp_t *); static void swapfunc(char *, char *, int, int); @@ -186,10 +184,6 @@ loop: SWAPINIT(a, es); //================================================================================== - -// this file is excluded from release builds because of intrinsics -#if defined ( Q3_VM ) - size_t strlen( const char *string ) { const char *s; @@ -262,9 +256,7 @@ char *strstr( const char *string, const char *strCharSet ) { } return (char *)0; } -#endif -#if defined ( Q3_VM ) int tolower( int c ) { if ( c >= 'A' && c <= 'Z' ) { c += 'a' - 'A'; @@ -280,9 +272,6 @@ int toupper( int c ) { return c; } -#endif -//#ifndef _MSC_VER - void *memmove( void *dest, const void *src, size_t count ) { int i; @@ -750,11 +739,9 @@ double atan2( double y, double x ) { #endif -#ifdef Q3_VM double tan( double x ) { return sin(x) / cos(x); } -#endif static int randSeed = 0; @@ -904,7 +891,6 @@ double _atof( const char **stringPtr ) { } -#if defined ( Q3_VM ) int atoi( const char *string ) { int sign; int value; @@ -1248,11 +1234,7 @@ reswitch: break; case 'f': AddFloat( &buf_p, *(double *)arg, width, prec ); -#ifdef Q3_VM - arg += 1; // everything is 32 bit in my compiler -#else - arg += 2; -#endif + arg += 1; // everything is 32 bit break; case 's': AddString( &buf_p, (char *)*arg, width, prec ); diff --git a/code/game/bg_lib.h b/code/game/bg_lib.h index 1354951..0629d7b 100644 --- a/code/game/bg_lib.h +++ b/code/game/bg_lib.h @@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // compiled for the virtual machine // This file is NOT included on native builds -#ifndef BG_LIB_H +#if !defined( BG_LIB_H ) && defined( Q3_VM ) #define BG_LIB_H //Ignore __attribute__ on non-gcc platforms -- cgit v1.2.3