aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
Diffstat (limited to 'code')
-rw-r--r--code/client/cl_curl.c8
-rw-r--r--code/client/cl_curl.h4
-rw-r--r--code/client/cl_main.c10
-rw-r--r--code/client/client.h2
-rw-r--r--code/client/qal.c4
-rw-r--r--code/client/qal.h6
-rw-r--r--code/client/snd_codec.c2
-rw-r--r--code/client/snd_codec_ogg.c2
-rw-r--r--code/client/snd_openal.c4
-rw-r--r--code/game/bg_lib.c24
-rw-r--r--code/game/bg_lib.h2
-rw-r--r--code/qcommon/q_shared.h4
12 files changed, 26 insertions, 46 deletions
diff --git a/code/client/cl_curl.c b/code/client/cl_curl.c
index e4527df..e4db3eb 100644
--- a/code/client/cl_curl.c
+++ b/code/client/cl_curl.c
@@ -20,11 +20,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
-#if USE_CURL
+#ifdef USE_CURL
#include "client.h"
cvar_t *cl_cURLLib;
-#if USE_CURL_DLOPEN
+#ifdef USE_CURL_DLOPEN
#include "../sys/sys_loadlib.h"
char* (*qcurl_version)(void);
@@ -88,7 +88,7 @@ CL_cURL_Init
*/
qboolean CL_cURL_Init()
{
-#if USE_CURL_DLOPEN
+#ifdef USE_CURL_DLOPEN
if(cURLLib)
return qtrue;
@@ -156,7 +156,7 @@ CL_cURL_Shutdown
void CL_cURL_Shutdown( void )
{
CL_cURL_Cleanup();
-#if USE_CURL_DLOPEN
+#ifdef USE_CURL_DLOPEN
if(cURLLib)
{
Sys_UnloadLibrary(cURLLib);
diff --git a/code/client/cl_curl.h b/code/client/cl_curl.h
index 57ed216..1cfd3f1 100644
--- a/code/client/cl_curl.h
+++ b/code/client/cl_curl.h
@@ -37,14 +37,14 @@ extern cvar_t *cl_cURLLib;
#define DEFAULT_CURL_LIB "libcurl.so.3"
#endif
-#if USE_LOCAL_HEADERS
+#ifdef USE_LOCAL_HEADERS
#include "../libcurl/curl/curl.h"
#else
#include <curl/curl.h>
#endif
-#if USE_CURL_DLOPEN
+#ifdef USE_CURL_DLOPEN
extern char* (*qcurl_version)(void);
extern CURL* (*qcurl_easy_init)(void);
diff --git a/code/client/cl_main.c b/code/client/cl_main.c
index fb830ef..146c234 100644
--- a/code/client/cl_main.c
+++ b/code/client/cl_main.c
@@ -689,7 +689,7 @@ CL_ShutdownAll
*/
void CL_ShutdownAll(void) {
-#if USE_CURL
+#ifdef USE_CURL
CL_cURL_Shutdown();
#endif
// clear sounds
@@ -1451,7 +1451,7 @@ Called when all downloading has been completed
*/
void CL_DownloadsComplete( void ) {
-#if USE_CURL
+#ifdef USE_CURL
// if we downloaded with cURL
if(clc.cURLUsed) {
clc.cURLUsed = qfalse;
@@ -1579,7 +1579,7 @@ void CL_NextDownload(void) {
*s++ = 0;
else
s = localName + strlen(localName); // point at the nul byte
-#if USE_CURL
+#ifdef USE_CURL
if(!(cl_allowDownload->integer & DLF_NO_REDIRECT)) {
if(clc.sv_allowDownload & DLF_NO_REDIRECT) {
Com_Printf("WARNING: server does not "
@@ -2205,7 +2205,7 @@ void CL_Frame ( int msec ) {
return;
}
-#if USE_CURL
+#ifdef USE_CURL
if(clc.downloadCURLM) {
CL_cURL_PerformDownload();
// we can't process frames normally when in disconnected
@@ -2698,7 +2698,7 @@ void CL_Init( void ) {
cl_showMouseRate = Cvar_Get ("cl_showmouserate", "0", 0);
cl_allowDownload = Cvar_Get ("cl_allowDownload", "0", CVAR_ARCHIVE);
-#if USE_CURL
+#ifdef USE_CURL
cl_cURLLib = Cvar_Get("cl_cURLLib", DEFAULT_CURL_LIB, CVAR_ARCHIVE);
#endif
diff --git a/code/client/client.h b/code/client/client.h
index d419bd1..936f906 100644
--- a/code/client/client.h
+++ b/code/client/client.h
@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../cgame/cg_public.h"
#include "../game/bg_public.h"
-#if USE_CURL
+#ifdef USE_CURL
#include "cl_curl.h"
#endif /* USE_CURL */
diff --git a/code/client/qal.c b/code/client/qal.c
index b573a3b..66b7f03 100644
--- a/code/client/qal.c
+++ b/code/client/qal.c
@@ -23,11 +23,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// Dynamically loads OpenAL
-#if USE_OPENAL
+#ifdef USE_OPENAL
#include "qal.h"
-#if USE_OPENAL_DLOPEN
+#ifdef USE_OPENAL_DLOPEN
#include "../sys/sys_loadlib.h"
diff --git a/code/client/qal.h b/code/client/qal.h
index b0f778c..1a2284a 100644
--- a/code/client/qal.h
+++ b/code/client/qal.h
@@ -28,12 +28,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../qcommon/q_shared.h"
#include "../qcommon/qcommon.h"
-#if USE_OPENAL_DLOPEN
+#ifdef USE_OPENAL_DLOPEN
#define AL_NO_PROTOTYPES
#define ALC_NO_PROTOTYPES
#endif
-#if USE_LOCAL_HEADERS
+#ifdef USE_LOCAL_HEADERS
#include "../AL/al.h"
#include "../AL/alc.h"
#else
@@ -47,7 +47,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif
#endif
-#if USE_OPENAL_DLOPEN
+#ifdef USE_OPENAL_DLOPEN
extern LPALENABLE qalEnable;
extern LPALDISABLE qalDisable;
extern LPALISENABLED qalIsEnabled;
diff --git a/code/client/snd_codec.c b/code/client/snd_codec.c
index 1c1a42a..52435c1 100644
--- a/code/client/snd_codec.c
+++ b/code/client/snd_codec.c
@@ -102,7 +102,7 @@ void S_CodecInit()
{
codecs = NULL;
S_CodecRegister(&wav_codec);
-#if USE_CODEC_VORBIS
+#ifdef USE_CODEC_VORBIS
S_CodecRegister(&ogg_codec);
#endif
}
diff --git a/code/client/snd_codec_ogg.c b/code/client/snd_codec_ogg.c
index 72ece94..3ea703a 100644
--- a/code/client/snd_codec_ogg.c
+++ b/code/client/snd_codec_ogg.c
@@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// OGG support is enabled by this define
-#if USE_CODEC_VORBIS
+#ifdef USE_CODEC_VORBIS
// includes for the Q3 sound system
#include "client.h"
diff --git a/code/client/snd_openal.c b/code/client/snd_openal.c
index a93c2d2..10b4c35 100644
--- a/code/client/snd_openal.c
+++ b/code/client/snd_openal.c
@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "snd_codec.h"
#include "client.h"
-#if USE_OPENAL
+#ifdef USE_OPENAL
#include "qal.h"
@@ -1864,7 +1864,7 @@ S_AL_Init
*/
qboolean S_AL_Init( soundInterface_t *si )
{
-#if USE_OPENAL
+#ifdef USE_OPENAL
qboolean enumsupport, founddev = qfalse;
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
diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h
index 559f99f..9959f27 100644
--- a/code/qcommon/q_shared.h
+++ b/code/qcommon/q_shared.h
@@ -92,11 +92,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
**********************************************************************/
-#ifdef Q3_VM
-
#include "../game/bg_lib.h"
-#else
+#ifndef Q3_VM
#include <assert.h>
#include <math.h>