#define PLUGIN
#define Q3RADIANT
-//#if GDEF_OS_LINUX || GDEF_OS_MACOS
+//#if !GDEF_OS_WINDOWS
#if 1
#include <algorithm>
#else
#define GDEF_OS_LINUX 0
#endif
-
#define GDEF_OS_BSD 0
#if defined(__FreeBSD__)
#define GDEF_OS_BSD_DRAGONFLY 0
#endif
+#if defined(__osf) || defined(__osf__) || defined(__OSF__)
+#define GDEF_OS_OSF1 1
+#else
+#define GDEF_OS_OSF1 0
+#endif
+
+#if defined(_MIPS_ISA)
+#define GDEF_OS_IRIX 1
+#else
+#define GDEF_OS_IRIX 0
+#endif
+
+#if defined(NeXT)
+#define GDEF_OS_NEXT 1
+#else
+#define GDEF_OS_NEXT 0
+#endif
+
+#if GDEF_OS_LINUX || GDEF_OS_BSD
+#define GDEF_OS_XDG 1
+#else
+#define GDEF_OS_XDG 0
+#endif
+
// COMPILER
#if defined(_MSC_VER)
#endif
#endif
-#endif
+#endif // !INCLUDED_LIBS_GLOBALDEFS
#include <stdlib.h>
#if !GDEF_OS_WINDOWS
-
// Necessary for proper boolean type declaration
#include "qertypes.h"
long right;
long bottom;
} RECT, *PRECT, *LPRECT;
-
-#endif // __linux__
+#endif // !GDEF_OS_WINDOWS
// plugin
// FIXME TTimo: drop this
if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "nexuiz.exe", buf, p - buf ) )
#elif GDEF_OS_MACOS
if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "Nexuiz.app/Contents/Info.plist", buf, p - buf ) )
-#else
+#elif GDEF_OS_LINUX
if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", "nexuiz-linux-glx.sh", buf, p - buf ) )
+#else
+ if ( gamedetect_check_game( "nexuiz.game", "data/common-spog.pk3", NULL, buf, p - buf ) )
#endif
{ return; }
}
path.clear();
path << DirectoryCleaned( g_get_home_dir() ) << prefix << "/";
-#endif
-
-#if GDEF_OS_WINDOWS
+#elif GDEF_OS_WINDOWS
TCHAR mydocsdir[MAX_PATH + 1];
wchar_t *mydocsdirw;
HMODULE shfolder = LoadLibrary( "shfolder.dll" );
break;
}
}
-#endif
-
-#if (GDEF_OS_POSIX && !GDEF_OS_MACOS)
+#elif GDEF_OS_XDG
path.clear();
path << DirectoryCleaned( g_get_user_data_dir() ) << ( prefix + 1 ) << "/";
if ( file_exists( path.c_str() ) && file_is_directory( path.c_str() ) ) {
}
};
-#else
+#else // !GDEF_OS_POSIX
#error "unsupported platform"
-#endif
+#endif // !GDEF_OS_POSIX
class DynamicLibraryModule
{
#if GDEF_OS_WINDOWS
#include <direct.h>
#include <windows.h>
-#endif
-
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
+#else // !GDEF_OS_WINDOWS
#include <unistd.h>
-#endif
+#endif // !GDEF_OS_WINDOWS
#ifdef NeXT
#include <libc.h>
void Sys_Sleep( int n ){
#if GDEF_OS_WINDOWS
Sleep( n );
-#endif
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
+#else // !GDEF_OS_WINDOWS
usleep( n * 1000 );
-#endif
+#endif // !GDEF_OS_WINDOWS
}
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+/*
Nurail: Swiped from Q3Map2
-
*/
#include "globaldefs.h"
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
- #define Q_UNIX
-#endif
-
-#ifdef Q_UNIX
+#if !GDEF_OS_WINDOWS
#include <unistd.h>
#include <pwd.h>
#include <limits.h>
-#endif
-
+#endif // !GDEF_OS_WINDOWS
/* dependencies */
#include "cmdlib.h"
#include "inout.h"
-
-
/* path support */
#define MAX_BASE_PATHS 10
#define MAX_GAME_PATHS 10
*/
char *LokiGetHomeDir( void ){
- #ifndef Q_UNIX
+ #if GDEF_OS_WINDOWS
return NULL;
- #else
+ #else // !GDEF_OS_WINDOWS
char *home;
uid_t id;
struct passwd *pwd;
/* return it */
return home;
- #endif
+ #endif // !GDEF_OS_WINDOWS
}
*/
void LokiInitPaths( char *argv0 ){
- #ifndef Q_UNIX
+ #if GDEF_OS_WINDOWS
/* this is kinda crap, but hey */
strcpy( installPath, "../" );
- #else
+ #else // !GDEF_OS_WINDOWS
char temp[ MAX_OS_PATH ];
char *home;
char *path;
/* set home path */
homePath = home;
- #endif
+ #endif // !GDEF_OS_WINDOWS
}
*/
void AddHomeBasePath( char *path ){
- #ifdef Q_UNIX
+ #if !GDEF_OS_WINDOWS
int i;
char temp[ MAX_OS_PATH ];
strcpy( basePaths[ 0 ], temp );
CleanPath( basePaths[ 0 ] );
numBasePaths++;
- #endif
+ #endif // !GDEF_OS_WINDOWS
}
// The below define is necessary to use
// pthreads extensions like pthread_mutexattr_settype
#define _GNU_SOURCE
-#include <pthread.h>
-#endif
+#endif // !GDEF_OS_WINDOWS
#include "cmdlib.h"
#include "mathlib.h"
}
+#if GDEF_OS_WINDOWS
+
/*
===================================================================
===================================================================
*/
-#if GDEF_OS_WINDOWS
-
-#define USED
#include <windows.h>
}
-#endif
+#elif GDEF_OS_OSF1
/*
===================================================================
===================================================================
*/
-#ifdef __osf__
-#define USED
-
int numthreads = 4;
void ThreadSetDefault( void ){
}
-#endif
+#elif GDEF_OS_IRIX
/*
===================================================================
===================================================================
*/
-#ifdef _MIPS_ISA
-#define USED
-
#include <task.h>
#include <abi_mutex.h>
#include <sys/types.h>
#include <sys/prctl.h>
-
int numthreads = -1;
abilock_t lck;
}
-#endif
-
+#elif GDEF_OS_LINUX || GDEF_OS_BSD || GDEF_OS_MACOS
/*
=======================================================================
=======================================================================
*/
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
-#define USED
-
// Setting default Threads to 1
int numthreads = 1;
Sys_Printf( " (%i)\n", end - start );
}
}
-#endif // ifdef __linux__
+#else // UNKNOWN OS
+
/*
=======================================================================
=======================================================================
*/
-#ifndef USED
-
int numthreads = 1;
void ThreadSetDefault( void ){
}
}
-#endif
+#endif // UNKNOWN OS
#include "globaldefs.h"
/* platform-specific */
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
- #define Q_UNIX
-#endif
-
-#ifdef Q_UNIX
+#if GDEF_OS_WINDOWS
+ #include <windows.h>
+#else // !GDEF_OS_WINDOWS
#include <unistd.h>
#include <pwd.h>
#include <limits.h>
-#endif
-
-#if GDEF_OS_WINDOWS
- #include <windows.h>
-#endif
+#endif // !GDEF_OS_WINDOWS
#include <stdlib.h>
#if GDEF_OS_WINDOWS
#include <direct.h>
#include <windows.h>
-#endif
-
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
+#elif GDEF_OS_NEXT
+#include <libc.h>
+#else // OTHER OSES
#include <unistd.h>
-#endif
+#endif // OTHER OSES
-#ifdef NeXT
-#include <libc.h>
-#endif
+#if !GDEF_OS_WINDOWS
+#define strlwr strlower
+#endif // !GDEF_OS_WINDOWS
#define BASEDIRNAME "h"
-#define PATHSEPERATOR '/'
+#define PATHSEPERATOR '/'
extern qboolean verbose;
return p;
}
-#endif
+#endif // !SAFE_MALLOC
void *SafeMalloc( size_t n, char *desc ){
void *p;
return p;
}
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
-void strlwr( char *conv_str ){
- int i;
-
- for ( i = 0; i < strlen( conv_str ); i++ )
- conv_str[i] = tolower( conv_str[i] );
-}
-#endif
-
-
// set these before calling CheckParm
int myargc;
char **myargv;
===================
*/
#define MAX_EX_ARGC 1024
+
int ex_argc;
char *ex_argv[MAX_EX_ARGC];
+
#if GDEF_OS_WINDOWS
#include "io.h"
void ExpandWildcards( int *argc, char ***argv ){
*argc = ex_argc;
*argv = ex_argv;
}
-#else
+#else // !GDEF_OS_WINDOWS
void ExpandWildcards( int *argc, char ***argv ){
}
-#endif
+#endif // !GDEF_OS_WINDOWS
/*
#if GDEF_OS_WINDOWS
_getcwd( out, 256 );
strcat( out, "\\" );
-#else
+#else // !GDEF_OS_WINDOWS
// Gef: Changed from getwd() to getcwd() to avoid potential buffer overflow
getcwd( out, 256 );
strcat( out, "/" );
-#endif
+#endif // !GDEF_OS_WINDOWS
while ( out[i] != 0 )
{
if ( out[i] == '\\' ) {
if ( _mkdir( path ) != -1 ) {
return;
}
-#else
+#else // !GDEF_OS_WINDOWS
if ( mkdir( path, 0777 ) != -1 ) {
return;
}
-#endif
+#endif // !GDEF_OS_WINDOWS
if ( errno != EEXIST ) {
Error( "mkdir %s: %s",path, strerror( errno ) );
}
Extract file parts
====================
*/
+
// FIXME: should include the slash, otherwise
// backing to an empty path will be wrong when appending a slash
void ExtractFilePath( const char *path, char *dest ){
}
-#else
+#else // !GDEF_ARCH_ENDIAN_BIG
short BigShort( short l ){
return l;
}
-
-#endif
+#endif // ! GDEF_ARCH_ENDIAN_BIG
//=======================================================
olddrive = _getdrive();
_chdrive( toupper( path[0] ) - 'A' + 1 );
}
-#endif
+#endif // !GDEF_OS_WINDOWS
if ( path[1] == ':' ) {
path += 2;
if ( olddrive != -1 ) {
_chdrive( olddrive );
}
-#endif
+#endif // !GDEF_OS_WINDOWS
}
void Sys_Sleep( int n ){
#if GDEF_OS_WINDOWS
Sleep( n );
-#endif
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
+#else // !GDEF_OS_WINDOWS
usleep( n * 1000 );
-#endif
+#endif // !GDEF_OS_WINDOWS
}
#include "globaldefs.h"
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
- #define Q_UNIX
-#endif
-
-#ifdef Q_UNIX
+#if !GDEF_OS_WINDOWS
#include <unistd.h>
#include <pwd.h>
#include <limits.h>
-#endif
-
+#endif // !GDEF_OS_WINDOWS
/* dependencies */
#include "cmdlib.h"
#include "inout.h"
-
-
/* path support */
#define MAX_BASE_PATHS 10
#define MAX_GAME_PATHS 10
*/
char *LokiGetHomeDir( void ){
- #ifndef Q_UNIX
+ #if GDEF_OS_WINDOWS
return NULL;
- #else
+ #else // !GDEF_OS_WINDOWS
char *home;
uid_t id;
struct passwd *pwd;
/* return it */
return home;
- #endif
+ #endif // !GDEF_OS_WINDOWS
}
*/
void LokiInitPaths( char *argv0 ){
- #ifndef Q_UNIX
+ #if GDEF_OS_WINDOWS
/* this is kinda crap, but hey */
strcpy( installPath, "../" );
- #else
+ #else // !GDEF_OS_WINDOWS
char temp[ MAX_OS_PATH ];
char *home;
char *path;
/* set home path */
homePath = home;
- #endif
+ #endif // !GDEF_OS_WINDOWS
}
*/
void AddHomeBasePath( char *path ){
- #ifdef Q_UNIX
+ #if !GDEF_OS_WINDOWS
int i;
char temp[ MAX_OS_PATH ];
strcpy( basePaths[ 0 ], temp );
CleanPath( basePaths[ 0 ] );
numBasePaths++;
- #endif
+ #endif // !GDEF_OS_WINDOWS
}
// The below define is necessary to use
// pthreads extensions like pthread_mutexattr_settype
#define _GNU_SOURCE
-#include <pthread.h>
-#endif
+#endif // !GDEF_OS_WINDOWS
#include "cmdlib.h"
#include "mathlib.h"
}
+#if GDEF_OS_WINDOWS
+
/*
===================================================================
===================================================================
*/
-#if GDEF_OS_WINDOWS
-
-#define USED
#include <windows.h>
}
-#endif
+#elif GDEF_OS_OSF1
/*
===================================================================
===================================================================
*/
-#ifdef __osf__
-#define USED
-
int numthreads = 4;
void ThreadSetDefault( void ){
}
}
-
#include <pthread.h>
pthread_mutex_t *my_mutex;
}
-#endif
+#elif GDEF_OS_IRIX
/*
===================================================================
===================================================================
*/
-#ifdef _MIPS_ISA
-#define USED
-
#include <task.h>
#include <abi_mutex.h>
#include <sys/types.h>
#include <sys/prctl.h>
-
int numthreads = -1;
abilock_t lck;
}
-#endif
-
+#elif GDEF_OS_LINUX || GDEF_OS_BSD || GDEF_OS_MACOS
/*
=======================================================================
=======================================================================
*/
-#if GDEF_OS_LINUX
-#define USED
-
int numthreads = 4;
void ThreadSetDefault( void ){
Sys_Printf( " (%i)\n", end - start );
}
}
-#endif // ifdef __linux__
+#else // UNKNOWN OS
+
/*
=======================================================================
=======================================================================
*/
-#ifndef USED
-
int numthreads = 1;
void ThreadSetDefault( void ){
}
}
-#endif
+#endif // UNKNOWN OS
#define MAXFILES 2048
+#if !GDEF_OS_WINDOWS
+#define strlwr strlower
+#endif // !GDEF_OS_WINDOWS
+
typedef struct
{
int x;
#define VERBOSE( x ) { if ( ase.verbose ) { Sys_Printf x ; } }
+#if !GDEF_OS_WINDOWS
+#define strlwr strlower
+#endif // !GDEF_OS_WINDOWS
+
typedef struct
{
float x, y, z;
static void ASE_Process( void );
static void ASE_FreeGeomObject( int ndx );
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
-
-static char* strlwr( char* string ){
- char *cp;
- for ( cp = string; *cp; ++cp )
- {
- if ( 'A' <= *cp && *cp <= 'Z' ) {
- *cp += 'a' - 'A';
- }
- }
-
- return string;
-}
-
-#endif
-
/*
** ASE_Load
*/
#if GDEF_OS_WINDOWS
#include <direct.h>
#include <windows.h>
-#endif
-
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
-#include <unistd.h>
-#endif
-
-#ifdef NeXT
+#elif GDEF_OS_NEXT
#include <libc.h>
-#endif
+#else // OTHER OS
+#include <unistd.h>
+#endif // OTHER OS
-#define BASEDIRNAME "quake" // assumed to have a 2 or 3 following
-#define PATHSEPERATOR '/'
+#define BASEDIRNAME "quake" // assumed to have a 2 or 3 following
+#define PATHSEPERATOR '/'
#ifdef SAFE_MALLOC
void *safe_malloc( size_t size ){
return p;
}
-#endif
+#endif // !SAFE_MALLOC
// set these before calling CheckParm
int myargc;
#define MAX_EX_ARGC 1024
int ex_argc;
char *ex_argv[MAX_EX_ARGC];
+
#if GDEF_OS_WINDOWS
#include "io.h"
void ExpandWildcards( int *argc, char ***argv ){
*argc = ex_argc;
*argv = ex_argv;
}
-#else
+#else // !GDEF_OS_WINDOWS
void ExpandWildcards( int *argc, char ***argv ){
}
-#endif
+#endif // !GDEF_OS_WINDOWS
/*
#if GDEF_OS_WINDOWS
_getcwd( out, 256 );
strcat( out, "\\" );
-#else
+#else // !GDEF_OS_WINDOWS
// Gef: Changed from getwd() to getcwd() to avoid potential buffer overflow
if ( !getcwd( out, 256 ) ) {
*out = 0;
}
strcat( out, "/" );
-#endif
+#endif // !GDEF_OS_WINDOWS
while ( out[i] != 0 )
{
if ( out[i] == '\\' ) {
p = q;
}
}
-#else
+#else // !GDEF_OS_WINDOWS
if ( mkdir( path, 0777 ) != -1 ) {
return;
}
if ( errno == ENOENT ) {
p = strrchr( path, '/' );
}
-#endif
+#endif // !GDEF_OS_WINDOWS
if ( p ) {
strncpy( parentbuf, path, sizeof( parentbuf ) );
if ( (int) ( p - path ) < (int) sizeof( parentbuf ) ) {
return l;
}
-
-#else
-
+#else // !GDEF_ARCH_ENDIAN_BIG
short BigShort( short l ){
byte b1,b2;
return l;
}
-
-#endif
+#endif // !GDEF_ARCH_ENDIAN_BIG
//=======================================================
olddrive = _getdrive();
_chdrive( toupper( path[0] ) - 'A' + 1 );
}
-#endif
+#endif // !GDEF_OS_WINDOWS
if ( path[1] == ':' ) {
path += 2;
if ( olddrive != -1 ) {
_chdrive( olddrive );
}
-#endif
+#endif // !>GDEF_OS_WINDOWS
}
void Sys_Sleep( int n ){
#if GDEF_OS_WINDOWS
Sleep( n );
-#endif
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
+#else // !GDEF_OS_WINDOWS
usleep( n * 1000 );
-#endif
+#endif // !GDEF_OS_WINDOWS
}
#include "globaldefs.h"
#include <stdint.h>
+
#if !GDEF_OS_WINDOWS
// The below define is necessary to use
// pthreads extensions like pthread_mutexattr_settype
#define _GNU_SOURCE
-#include <pthread.h>
-#endif
+#endif // !GDEF_OS_WINDOWS
#include "cmdlib.h"
#include "mathlib.h"
}
+#if GDEF_OS_WINDOWS
+
/*
===================================================================
===================================================================
*/
-#if GDEF_OS_WINDOWS
-
-#define USED
#include <windows.h>
}
-#endif
+#elif GDEF_OS_OSF1
/*
===================================================================
===================================================================
*/
-#ifdef __osf__
-#define USED
-
int numthreads = 4;
void ThreadSetDefault( void ){
}
}
-
#include <pthread.h>
pthread_mutex_t *my_mutex;
}
-#endif
+#elif GDEF_OS_IRIX
/*
===================================================================
===================================================================
*/
-#ifdef _MIPS_ISA
#define USED
#include <task.h>
#include <sys/types.h>
#include <sys/prctl.h>
-
int numthreads = -1;
abilock_t lck;
}
-#endif
-
+#elif GDEF_OS_LINUX || GDEF_OS_BSD || GDEF_OS_MACOS
/*
=======================================================================
=======================================================================
*/
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
-#define USED
-
#include <unistd.h>
int numthreads = -1;
Sys_Printf( " (%i)\n", end - start );
}
}
-#endif // ifdef __linux__
+#else // UNKNOWN OS
+
/*
=======================================================================
=======================================================================
*/
-#ifndef USED
-
int numthreads = 1;
void ThreadSetDefault( void ){
}
}
-#endif
+#endif // UNKNOWN OS
#define FLOAT_END -FLOAT_START
#define MAGIC 123322
-//#define NOISY 1
+// #define NOISY 1
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
+#if !GDEF_OS_WINDOWS
#define strlwr strlower
-#endif
+#endif // !GDEF_OS_WINDOWS
typedef struct {
float v[3];
// to get PATH_MAX
#include <stdio.h>
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
-#include <dirent.h>
-#include <unistd.h>
-#else
+
+#if GDEF_OS_WINDOWS
#include <wtypes.h>
#include <io.h>
#define S_ISDIR( mode ) ( mode & _S_IFDIR )
#define PATH_MAX 260
-#endif
+#else // !GDEF_OS_WINDOWS
+#include <dirent.h>
+#include <unistd.h>
+#endif // !GDEF_OS_WINDOWS
#define VFS_MAXDIRS 64
#include "globaldefs.h"
#include <assert.h>
+
#if GDEF_OS_WINDOWS
#include <io.h>
-#endif
+#endif // GDEF_OS_WINDOWS
+
#include "md3lib.h"
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
-#define filelength(f) Q_filelength(f)
-#else
+#if GDEF_OS_WINDOWS
#define filelength(f) filelength(fileno(f))
-#endif
+#else // !GDEF_OS_WINDOWS
+#define filelength(f) Q_filelength(f)
+#endif // ! GDEF_OS_WINDOWS
/*
** MD3_ComputeTagFromTri
#if GDEF_OS_WINDOWS
#include <io.h>
-#endif
+#endif // GDEF_OS_WINDOWS
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define MAX_POLYSETS 64
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
+#if GDEF_OS_WINDOWS
+ #define filelength(f) filelength(fileno(f))
+#else // !GDEF_OS_WINDOWS
#include "cmdlib.h"
#define _strcmpi Q_stricmp
#define strlwr strlower
#define filelength(f) Q_filelength(f)
-#else
- #define filelength(f) filelength(fileno(f))
-#endif
+#endif // !GDEF_OS_WINDOWS
+
typedef struct
{
long len;
*/
#include "globaldefs.h"
+
#if GDEF_OS_WINDOWS
#include <io.h>
-#endif
+#endif // GDEF_OS_WINDOWS
+
#include "q3data.h"
#include "md3lib.h"
// some old defined that was in cmdlib lost during merge
char writedir[1024];
-#if GDEF_OS_LINUX || GDEF_OS_MACOS
+#if !GDEF_OS_WINDOWS
#define strlwr strlower
-#endif
+#endif // !GDEF_OS_WINDOWS
/*
=======================================================
------------------------------------------------------------------------------- */
-
-
/* marker */
#define PATH_INIT_C
-
-
/* dependencies */
#include "q3map2.h"
-
-
/* path support */
#define MAX_BASE_PATHS 10
#define MAX_GAME_PATHS 10
#if GDEF_OS_MACOS
char *macLibraryApplicationSupportPath;
-#endif
-
-#if (GDEF_OS_POSIX && !GDEF_OS_MACOS)
+#elif GDEF_OS_XDG
char *xdgDataHomePath;
-#endif // (GDEF_OS_POSIX && !GDEF_OS_MACOS)
+#endif // GDEF_OS_XDG
char installPath[ MAX_OS_PATH ];
/* return it */
return home;
- #endif
+ #endif // !GDEF_OS_WINDOWS
}
}
#if GDEF_OS_MACOS
- char *subPath = "/Library/Application Support";
- macLibraryApplicationSupportPath = safe_malloc( sizeof( char ) * ( strlen( home ) + strlen( subPath ) ) );
- sprintf( macLibraryApplicationSupportPath, "%s%s", home, subPath );
- #endif // GDEF_OS_MACOS
-
- #if (GDEF_OS_POSIX && !GDEF_OS_MACOS)
+ char *subPath = "/Library/Application Support";
+ macLibraryApplicationSupportPath = safe_malloc( sizeof( char ) * ( strlen( home ) + strlen( subPath ) ) );
+ sprintf( macLibraryApplicationSupportPath, "%s%s", home, subPath );
+ #elif GDEF_OS_XDG
xdgDataHomePath = getenv( "XDG_DATA_HOME" );
if ( xdgDataHomePath == NULL ) {
xdgDataHomePath = safe_malloc( sizeof( char ) * ( strlen( home ) + strlen( subPath ) ) );
sprintf( xdgDataHomePath, "%s%s", home, subPath );
}
- #endif // (GDEF_OS_POSIX && !GDEF_OS_MACOS)
+ #endif // GDEF_OS_XDG
#if GDEF_OS_WINDOWS
/* this is kinda crap, but hey */
*/
tempHomePath = macLibraryApplicationSupportPath;
path = path + 1;
- #endif // GDEF_OS_MACOS
-
- #if (GDEF_OS_POSIX && !GDEF_OS_MACOS)
+ #elif GDEF_OS_XDG
/*
on Linux, check if game uses ${XDG_DATA_HOME}/prefix instead of ${HOME}/.prefix
if yes and home path is not user supplied
}
path = path + 1;
}
- #endif // (GDEF_OS_POSIX && !GDEF_OS_MACOS)
+ #endif // GDEF_OS_XDG
/* concatenate home dir and path */
sprintf( temp, "%s/%s", tempHomePath, path );
------------------------------------------------------------------------------- */
-#if 1
- #if GDEF_OS_WINDOWS
- #define Q_stricmp stricmp
- #define Q_strncasecmp strnicmp
- #else
- #define Q_stricmp strcasecmp
- #define Q_strncasecmp strncasecmp
- #endif
+#if GDEF_OS_WINDOWS
+ #define Q_stricmp stricmp
+ #define Q_strncasecmp strnicmp
+#else
+ #define Q_stricmp strcasecmp
+ #define Q_strncasecmp strncasecmp
#endif
/* macro version */