aboutsummaryrefslogtreecommitdiffstats
path: root/code/unix/unix_main.c
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-11-26 15:01:28 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-11-26 15:01:28 +0000
commit59b6a5ccdb397cdd3a47c97d6cda5438a225a338 (patch)
tree2fab1bfb840fc08009145560102c678ccf79ed2c /code/unix/unix_main.c
parent26b9cf5a0ca15a80690060daf5f3cbf0576ade28 (diff)
downloadioquake3-aero-59b6a5ccdb397cdd3a47c97d6cda5438a225a338.tar.gz
ioquake3-aero-59b6a5ccdb397cdd3a47c97d6cda5438a225a338.zip
* Disable ccache by default. If you want it, add USE_CCACHE=1 to Makefile.local
* Remove -gfull from linux section in Makefile -- it's darwin only * Cast away some warnings that surfaced from using "new" AL headers * Various whitespace and consistency fixes git-svn-id: svn://svn.icculus.org/quake3/trunk@375 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/unix/unix_main.c')
-rw-r--r--code/unix/unix_main.c51
1 files changed, 25 insertions, 26 deletions
diff --git a/code/unix/unix_main.c b/code/unix/unix_main.c
index 82c9a42..58e1a08 100644
--- a/code/unix/unix_main.c
+++ b/code/unix/unix_main.c
@@ -364,24 +364,22 @@ void Sys_Quit (void) {
static void Sys_DetectAltivec(void)
{
- extern cvar_t *com_altivec;
-
// Only detect if user hasn't forcibly disabled it.
if (com_altivec->integer) {
- #if idppc_altivec
- #if MACOS_X
- {
- long feat = 0;
- OSErr err = Gestalt(gestaltPowerPCProcessorFeatures, &feat);
- if ((err==noErr) && ((1 << gestaltPowerPCHasVectorInstructions) & feat))
- com_altivec->integer = 1;
- }
- #else // !!! FIXME: PowerPC Linux, etc: how to detect?
- com_altivec->integer = 1;
- #endif
- #else
- com_altivec->integer = 0; // not an Altivec system, so never use it.
- #endif
+#if idppc_altivec
+#ifdef MACOS_X
+ long feat = 0;
+ OSErr err = Gestalt(gestaltPowerPCProcessorFeatures, &feat);
+ if ((err==noErr) && ((1 << gestaltPowerPCHasVectorInstructions) & feat)) {
+ Cvar_Set( "com_altivec", "1" );
+ }
+#else // !!! FIXME: PowerPC Linux, etc: how to detect?
+ Cvar_Set( "com_altivec", "1" );
+#endif
+#else
+ // not an Altivec system, so never use it.
+ Cvar_Set( "com_altivec", "0" );
+#endif
}
}
@@ -705,9 +703,9 @@ void Sys_UnloadDll( void *dllHandle ) {
return;
}
- #if USE_SDL_VIDEO
+#if USE_SDL_VIDEO
SDL_UnloadObject(dllHandle);
- #else
+#else
dlclose( dllHandle );
{
const char* err; // rb010123 - now const
@@ -715,7 +713,7 @@ void Sys_UnloadDll( void *dllHandle ) {
if ( err != NULL )
Com_Printf ( "Sys_UnloadGame failed on dlclose: \"%s\"!\n", err );
}
- #endif
+#endif
}
@@ -745,11 +743,11 @@ static void* try_dlopen(const char* base, const char* gamedir, const char* fname
fn = FS_BuildOSPath( base, gamedir, fname );
Com_Printf( "Sys_LoadDll(%s)... \n", fn );
- #if USE_SDL_VIDEO
+#if USE_SDL_VIDEO
libHandle = SDL_LoadObject(fn);
- #else
+#else
libHandle = dlopen( fn, Q_RTLD );
- #endif
+#endif
if(!libHandle) {
Com_Printf( "Sys_LoadDll(%s) failed:\n\"%s\"\n", fn, do_dlerror() );
@@ -827,14 +825,15 @@ void *Sys_LoadDll( const char *name, char *fqpath ,
#else
Com_Printf ( "Sys_LoadDll(%s) failed dlsym(vmMain):\n\"%s\" !\n", name, err );
#endif
- #if USE_SDL_VIDEO
+#if USE_SDL_VIDEO
SDL_UnloadObject(libHandle);
- #else
+#else
dlclose( libHandle );
err = do_dlerror();
- if ( err != NULL )
+ if ( err != NULL ) {
Com_Printf ( "Sys_LoadDll(%s) failed dlcose:\n\"%s\"\n", name, err );
- #endif
+ }
+#endif
return NULL;
}