[iortcw] 80/152: All: Use __APPLE__ macro instead of MACOS_X
Simon McVittie
smcv at debian.org
Fri Sep 8 10:40:14 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to annotated tag 1.5a
in repository iortcw.
commit 72dc3e12a31bbb0352d566317ba8d9c3609357b9
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Sun Jul 10 08:37:15 2016 -0400
All: Use __APPLE__ macro instead of MACOS_X
---
MP/Makefile | 16 ++++------------
MP/code/client/cl_curl.h | 2 +-
MP/code/client/snd_mix.c | 2 +-
MP/code/client/snd_openal.c | 10 +++++-----
MP/code/qcommon/common.c | 2 +-
MP/code/qcommon/files.c | 4 ++--
MP/code/qcommon/q_platform.h | 8 ++++----
MP/code/qcommon/q_shared.c | 2 +-
MP/code/qcommon/qcommon.h | 2 +-
MP/code/rend2/qgl.h | 2 +-
MP/code/rend2/tr_shade.c | 2 +-
MP/code/rend2/tr_surface.c | 2 +-
MP/code/renderer/qgl.h | 2 +-
MP/code/renderer/tr_shade.c | 2 +-
MP/code/renderer/tr_shade_calc.c | 2 +-
MP/code/renderer/tr_surface.c | 2 +-
MP/code/sdl/sdl_input.c | 2 +-
MP/code/splines/math_vector.cpp | 2 +-
MP/code/sys/sys_local.h | 2 +-
MP/code/sys/sys_main.c | 4 ++--
MP/code/sys/sys_osx.m | 2 +-
MP/code/sys/sys_unix.c | 6 +++---
MP/code/tools/lcc/cpp/unix.c | 2 +-
MP/code/zlib-1.2.8/ioapi.c | 2 +-
MP/code/zlib-1.2.8/ioapi.h | 2 +-
SP/Makefile | 16 ++++------------
SP/code/client/cl_curl.h | 2 +-
SP/code/client/snd_mix.c | 2 +-
SP/code/client/snd_openal.c | 10 +++++-----
SP/code/qcommon/common.c | 2 +-
SP/code/qcommon/files.c | 4 ++--
SP/code/qcommon/q_platform.h | 8 ++++----
SP/code/qcommon/qcommon.h | 2 +-
SP/code/rend2/qgl.h | 2 +-
SP/code/rend2/tr_shade.c | 2 +-
SP/code/rend2/tr_surface.c | 2 +-
SP/code/renderer/qgl.h | 2 +-
SP/code/renderer/tr_shade.c | 2 +-
SP/code/renderer/tr_shade_calc.c | 2 +-
SP/code/renderer/tr_surface.c | 2 +-
SP/code/sdl/sdl_input.c | 2 +-
SP/code/splines/math_vector.cpp | 2 +-
SP/code/sys/sys_local.h | 2 +-
SP/code/sys/sys_main.c | 4 ++--
SP/code/sys/sys_osx.m | 2 +-
SP/code/sys/sys_unix.c | 6 +++---
SP/code/tools/lcc/cpp/unix.c | 2 +-
SP/code/zlib-1.2.8/ioapi.c | 2 +-
SP/code/zlib-1.2.8/ioapi.h | 2 +-
49 files changed, 77 insertions(+), 93 deletions(-)
diff --git a/MP/Makefile b/MP/Makefile
index 7a9aa78..3febcd4 100644
--- a/MP/Makefile
+++ b/MP/Makefile
@@ -4,19 +4,13 @@
# GNU Make required
#
-COMPILE_PLATFORM=$(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'|sed -e 's/\//_/g')
-
-COMPILE_ARCH=$(shell uname -m | sed -e s/i.86/i386/ | sed -e 's/^arm.*/arm/')
-
+COMPILE_PLATFORM=$(shell uname | sed -e 's/_.*//' | tr '[:upper:]' '[:lower:]' | sed -e 's/\//_/g')
+COMPILE_ARCH=$(shell uname -m | sed -e 's/i.86/x86/' | sed -e 's/^arm.*/arm/')
ARM_VER_CHECK=$(shell uname -m)
ifeq ($(COMPILE_PLATFORM),sunos)
# Solaris uname and GNU uname differ
- COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/i386/)
-endif
-ifeq ($(COMPILE_PLATFORM),darwin)
- # Apple does some things a little differently...
- COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/i386/)
+ COMPILE_ARCH=$(shell uname -p | sed -e 's/i.86/x86/')
endif
ifndef BUILD_STANDALONE
@@ -520,11 +514,9 @@ ifeq ($(PLATFORM),darwin)
$(error Architecture $(ARCH) is not supported when cross compiling)
endif
endif
- else
- TOOLS_CFLAGS += -DMACOS_X
endif
- BASE_CFLAGS += -fno-strict-aliasing -DMACOS_X -fno-common -pipe
+ BASE_CFLAGS += -fno-strict-aliasing -fno-common -pipe
ifeq ($(USE_OPENAL),1)
ifneq ($(USE_OPENAL_DLOPEN),1)
diff --git a/MP/code/client/cl_curl.h b/MP/code/client/cl_curl.h
index 789542c..3ab8535 100644
--- a/MP/code/client/cl_curl.h
+++ b/MP/code/client/cl_curl.h
@@ -37,7 +37,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifdef WIN32
#define DEFAULT_CURL_LIB "libcurl-4.dll"
#define ALTERNATE_CURL_LIB "libcurl-3.dll"
-#elif defined(MACOS_X)
+#elif defined(__APPLE__)
#define DEFAULT_CURL_LIB "libcurl.dylib"
#else
#define DEFAULT_CURL_LIB "libcurl.so.4"
diff --git a/MP/code/client/snd_mix.c b/MP/code/client/snd_mix.c
index 943c50f..4418d22 100644
--- a/MP/code/client/snd_mix.c
+++ b/MP/code/client/snd_mix.c
@@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "client.h"
#include "snd_local.h"
-#if idppc_altivec && !defined(MACOS_X)
+#if idppc_altivec && !defined(__APPLE__)
#include <altivec.h>
#endif
diff --git a/MP/code/client/snd_openal.c b/MP/code/client/snd_openal.c
index e45f772..900dc5e 100644
--- a/MP/code/client/snd_openal.c
+++ b/MP/code/client/snd_openal.c
@@ -584,7 +584,7 @@ typedef struct src_s
int flags; // flags from StartSoundEx
} src_t;
-#ifdef MACOS_X
+#ifdef __APPLE__
#define MAX_SRC 128
#else
#define MAX_SRC 256
@@ -2307,7 +2307,7 @@ static cvar_t *s_alCapture;
#ifdef _WIN32
#define ALDRIVER_DEFAULT "OpenAL32.dll"
-#elif defined(MACOS_X)
+#elif defined(__APPLE__)
#define ALDRIVER_DEFAULT "libopenal.dylib"
#elif defined(__OpenBSD__)
#define ALDRIVER_DEFAULT "libopenal.so"
@@ -2532,7 +2532,7 @@ static void S_AL_SoundInfo(void)
#ifdef USE_VOIP
if(capture_ext)
{
-#ifdef MACOS_X
+#ifdef __APPLE__
Com_Printf(" Input Device: %s\n", qalcGetString(alCaptureDevice, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER));
#else
Com_Printf(" Input Device: %s\n", qalcGetString(alCaptureDevice, ALC_CAPTURE_DEVICE_SPECIFIER));
@@ -2628,7 +2628,7 @@ qboolean S_AL_Init( soundInterface_t *si )
{
#if defined( _WIN32 )
if( !Q_stricmp( s_alDriver->string, ALDRIVER_DEFAULT ) && !QAL_Init( "OpenAL64.dll" ) ) {
-#elif defined ( MACOS_X )
+#elif defined ( __APPLE__ )
if( !Q_stricmp( s_alDriver->string, ALDRIVER_DEFAULT ) && !QAL_Init( "/System/Library/Frameworks/OpenAL.framework/OpenAL" ) ) {
#else
if( !Q_stricmp( s_alDriver->string, ALDRIVER_DEFAULT ) || !QAL_Init( ALDRIVER_DEFAULT ) ) {
@@ -2756,7 +2756,7 @@ qboolean S_AL_Init( soundInterface_t *si )
#endif
else
{
-#ifdef MACOS_X
+#ifdef __APPLE__
// !!! FIXME: Apple has a 1.1-compliant OpenAL, which includes
// !!! FIXME: capture support, but they don't list it in the
// !!! FIXME: extension string. We need to check the version string,
diff --git a/MP/code/qcommon/common.c b/MP/code/qcommon/common.c
index b13477e..9b02719 100644
--- a/MP/code/qcommon/common.c
+++ b/MP/code/qcommon/common.c
@@ -2566,7 +2566,7 @@ static void Com_WriteCDKey( const char *filename, const char *ikey ) {
FS_Printf( f, "\n// generated by RTCW, do not modify\r\n" );
FS_Printf( f, "// Do not give this file to ANYONE.\r\n" );
-#ifdef MACOS_X
+#ifdef __APPLE__
FS_Printf( f, "// Aspyr will NOT ask you to send this file to them.\r\n" );
#else
FS_Printf( f, "// id Software and Activision will NOT ask you to send this file to them.\r\n" );
diff --git a/MP/code/qcommon/files.c b/MP/code/qcommon/files.c
index 862350e..9011cb0 100644
--- a/MP/code/qcommon/files.c
+++ b/MP/code/qcommon/files.c
@@ -247,7 +247,7 @@ static char fs_gamedir[MAX_OSPATH]; // this will be a single file name w
static cvar_t *fs_debug;
static cvar_t *fs_homepath;
-#ifdef MACOS_X
+#ifdef __APPLE__
// Also search the .app bundle for .pk3 files
static cvar_t *fs_apppath;
#endif
@@ -3517,7 +3517,7 @@ static void FS_Startup( const char *gameName ) {
}
// fs_homepath is somewhat particular to *nix systems, only add if relevant
- #ifdef MACOS_X
+ #ifdef __APPLE__
fs_apppath = Cvar_Get ("fs_apppath", Sys_DefaultAppPath(), CVAR_INIT|CVAR_PROTECTED );
// Make MacOSX also include the base path included with the .app bundle
if (fs_apppath->string[0])
diff --git a/MP/code/qcommon/q_platform.h b/MP/code/qcommon/q_platform.h
index 969fbbb..3c5821e 100644
--- a/MP/code/qcommon/q_platform.h
+++ b/MP/code/qcommon/q_platform.h
@@ -46,7 +46,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define idppc 1
#if defined(__VEC__)
#define idppc_altivec 1
-#ifdef MACOS_X // Apple's GCC does this differently than the FSF.
+#ifdef __APPLE__ // Apple's GCC does this differently than the FSF.
#define VECCONST_UINT8(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
(vector unsigned char) (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
#else
@@ -139,11 +139,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//============================================================== MAC OS X ===
-#if defined(MACOS_X) || defined(__APPLE_CC__)
+#if defined(__APPLE__) || defined(__APPLE_CC__)
// make sure this is defined, just for sanity's sake...
-#ifndef MACOS_X
-#define MACOS_X
+#ifndef __APPLE__
+#define __APPLE__
#endif
#define OS_STRING "macosx"
diff --git a/MP/code/qcommon/q_shared.c b/MP/code/qcommon/q_shared.c
index 6c9bf5a..b7cc5b0 100644
--- a/MP/code/qcommon/q_shared.c
+++ b/MP/code/qcommon/q_shared.c
@@ -31,7 +31,7 @@ If you have questions concerning this license or the applicable additional terms
// os x game bundles have no standard library links, and the defines are not always defined!
-#ifdef MACOS_X
+#ifdef __APPLE__
int qmax( int x, int y ) {
return ( ( ( x ) > ( y ) ) ? ( x ) : ( y ) );
}
diff --git a/MP/code/qcommon/qcommon.h b/MP/code/qcommon/qcommon.h
index 3ff2284..50cb5e9 100644
--- a/MP/code/qcommon/qcommon.h
+++ b/MP/code/qcommon/qcommon.h
@@ -1232,7 +1232,7 @@ char *Sys_DefaultInstallPath( void );
char *Sys_SteamPath(void);
#endif
-#ifdef MACOS_X
+#ifdef __APPLE__
char *Sys_DefaultAppPath(void);
#endif
diff --git a/MP/code/rend2/qgl.h b/MP/code/rend2/qgl.h
index e933ecf..1c73e40 100644
--- a/MP/code/rend2/qgl.h
+++ b/MP/code/rend2/qgl.h
@@ -60,7 +60,7 @@ extern void ( APIENTRY * qglUnlockArraysEXT )( void );
// GL_ATI_pn_triangles
#ifndef GL_ATI_pn_triangles
#define GL_ATI_pn_triangles 1
-#ifndef MACOS_X //DAJ BUGFIX changed the numbers
+#ifndef __APPLE__ //DAJ BUGFIX changed the numbers
#define GL_PN_TRIANGLES_ATI 0x6090
#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x6091
#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x6092
diff --git a/MP/code/rend2/tr_shade.c b/MP/code/rend2/tr_shade.c
index 24421c8..23e0d42 100644
--- a/MP/code/rend2/tr_shade.c
+++ b/MP/code/rend2/tr_shade.c
@@ -28,7 +28,7 @@ If you have questions concerning this license or the applicable additional terms
// tr_shade.c
#include "tr_local.h"
-#if idppc_altivec && !defined(MACOS_X)
+#if idppc_altivec && !defined(__APPLE__)
#include <altivec.h>
#endif
diff --git a/MP/code/rend2/tr_surface.c b/MP/code/rend2/tr_surface.c
index 4f2fd88..3b3769a 100644
--- a/MP/code/rend2/tr_surface.c
+++ b/MP/code/rend2/tr_surface.c
@@ -28,7 +28,7 @@ If you have questions concerning this license or the applicable additional terms
// tr_surf.c
#include "tr_local.h"
-#if idppc_altivec && !defined(MACOS_X)
+#if idppc_altivec && !defined(__APPLE__)
#include <altivec.h>
#endif
diff --git a/MP/code/renderer/qgl.h b/MP/code/renderer/qgl.h
index 29fb3f4..e055cbb 100644
--- a/MP/code/renderer/qgl.h
+++ b/MP/code/renderer/qgl.h
@@ -85,7 +85,7 @@ extern void myglMultiTexCoord2f( GLenum texture, GLfloat s, GLfloat t );
// GL_ATI_pn_triangles
#ifndef GL_ATI_pn_triangles
#define GL_ATI_pn_triangles 1
-#ifndef MACOS_X //DAJ BUGFIX changed the numbers
+#ifndef __APPLE__ //DAJ BUGFIX changed the numbers
#define GL_PN_TRIANGLES_ATI 0x6090
#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x6091
#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x6092
diff --git a/MP/code/renderer/tr_shade.c b/MP/code/renderer/tr_shade.c
index edabc76..0aa2890 100644
--- a/MP/code/renderer/tr_shade.c
+++ b/MP/code/renderer/tr_shade.c
@@ -29,7 +29,7 @@ If you have questions concerning this license or the applicable additional terms
// tr_shade.c
#include "tr_local.h"
-#if idppc_altivec && !defined(MACOS_X)
+#if idppc_altivec && !defined(__APPLE__)
#include <altivec.h>
#endif
diff --git a/MP/code/renderer/tr_shade_calc.c b/MP/code/renderer/tr_shade_calc.c
index abe25d5..ef4a710 100644
--- a/MP/code/renderer/tr_shade_calc.c
+++ b/MP/code/renderer/tr_shade_calc.c
@@ -29,7 +29,7 @@ If you have questions concerning this license or the applicable additional terms
// tr_shade_calc.c
#include "tr_local.h"
-#if idppc_altivec && !defined(MACOS_X)
+#if idppc_altivec && !defined(__APPLE__)
#include <altivec.h>
#endif
diff --git a/MP/code/renderer/tr_surface.c b/MP/code/renderer/tr_surface.c
index a0d3732..e051dac 100644
--- a/MP/code/renderer/tr_surface.c
+++ b/MP/code/renderer/tr_surface.c
@@ -28,7 +28,7 @@ If you have questions concerning this license or the applicable additional terms
// tr_surf.c
#include "tr_local.h"
-#if idppc_altivec && !defined(MACOS_X)
+#if idppc_altivec && !defined(__APPLE__)
#include <altivec.h>
#endif
diff --git a/MP/code/sdl/sdl_input.c b/MP/code/sdl/sdl_input.c
index 383878d..f758de1 100644
--- a/MP/code/sdl/sdl_input.c
+++ b/MP/code/sdl/sdl_input.c
@@ -247,7 +247,7 @@ static keyNum_t IN_TranslateSDLToQ3Key( SDL_Keysym *keysym, qboolean down )
case SDLK_LCTRL:
case SDLK_RCTRL: key = K_CTRL; break;
-#ifdef MACOS_X
+#ifdef __APPLE__
case SDLK_RGUI:
case SDLK_LGUI: key = K_COMMAND; break;
#else
diff --git a/MP/code/splines/math_vector.cpp b/MP/code/splines/math_vector.cpp
index e6ad700..548fbaf 100644
--- a/MP/code/splines/math_vector.cpp
+++ b/MP/code/splines/math_vector.cpp
@@ -36,7 +36,7 @@ If you have questions concerning this license or the applicable additional terms
#include <time.h>
#include <ctype.h>
-#ifndef MACOS_X
+#ifndef __APPLE__
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
#endif
diff --git a/MP/code/sys/sys_local.h b/MP/code/sys/sys_local.h
index f8bd5b4..96edd98 100644
--- a/MP/code/sys/sys_local.h
+++ b/MP/code/sys/sys_local.h
@@ -44,7 +44,7 @@ unsigned int CON_LogSize( void );
unsigned int CON_LogWrite( const char *in );
unsigned int CON_LogRead( char *out, unsigned int outSize );
-#ifdef MACOS_X
+#ifdef __APPLE__
char *Sys_StripAppBundle( char *pwd );
#endif
diff --git a/MP/code/sys/sys_main.c b/MP/code/sys/sys_main.c
index 2e537d9..4a48d00 100644
--- a/MP/code/sys/sys_main.c
+++ b/MP/code/sys/sys_main.c
@@ -565,7 +565,7 @@ void Sys_ParseArgs( int argc, char **argv )
}
#ifndef DEFAULT_BASEDIR
-# ifdef MACOS_X
+# ifdef __APPLE__
# define DEFAULT_BASEDIR Sys_StripAppBundle(Sys_BinaryPath())
# else
# define DEFAULT_BASEDIR Sys_BinaryPath()
@@ -646,7 +646,7 @@ int main( int argc, char **argv )
// Set the initial time base
Sys_Milliseconds( );
-#ifdef MACOS_X
+#ifdef __APPLE__
// This is passed if we are launched by double-clicking
if ( argc >= 2 && Q_strncmp ( argv[1], "-psn", 4 ) == 0 )
argc = 1;
diff --git a/MP/code/sys/sys_osx.m b/MP/code/sys/sys_osx.m
index 30bf932..b0ecf6a 100644
--- a/MP/code/sys/sys_osx.m
+++ b/MP/code/sys/sys_osx.m
@@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
-#ifndef MACOS_X
+#ifndef __APPLE__
#error This file is for Mac OS X only. You probably should not compile it.
#endif
diff --git a/MP/code/sys/sys_unix.c b/MP/code/sys/sys_unix.c
index 3922979..9fe98b8 100644
--- a/MP/code/sys/sys_unix.c
+++ b/MP/code/sys/sys_unix.c
@@ -63,7 +63,7 @@ char *Sys_DefaultHomePath(void)
if( ( p = getenv( "HOME" ) ) != NULL )
{
Com_sprintf(homePath, sizeof(homePath), "%s%c", p, PATH_SEP);
-#ifdef MACOS_X
+#ifdef __APPLE__
Q_strcat(homePath, sizeof(homePath),
"Library/Application Support/");
@@ -97,7 +97,7 @@ char *Sys_SteamPath( void )
if( ( p = getenv( "HOME" ) ) != NULL )
{
-#ifdef MACOS_X
+#ifdef __APPLE__
char *steamPathEnd = "/Library/Application Support/Steam/SteamApps/common/" STEAMPATH_NAME;
#else
char *steamPathEnd = "/.steam/steam/SteamApps/common/" STEAMPATH_NAME;
@@ -581,7 +581,7 @@ void Sys_ErrorDialog( const char *error )
close( f );
}
-#ifndef MACOS_X
+#ifndef __APPLE__
static char execBuffer[ 1024 ];
static char *execBufferPointer;
static char *execArgv[ 16 ];
diff --git a/MP/code/tools/lcc/cpp/unix.c b/MP/code/tools/lcc/cpp/unix.c
index 75e5b6d..bac841d 100644
--- a/MP/code/tools/lcc/cpp/unix.c
+++ b/MP/code/tools/lcc/cpp/unix.c
@@ -106,7 +106,7 @@ char *basepath( char *fname )
all and others do a terrible job (like calling malloc) */
// -- ouch, that hurts -- ln
/* always use the system memmove() on Mac OS X. --ryan. */
-#if !defined(MACOS_X) && !defined(_MSC_VER)
+#if !defined(__APPLE__) && !defined(_MSC_VER)
#ifdef memmove
#undef memmove
#endif
diff --git a/MP/code/zlib-1.2.8/ioapi.c b/MP/code/zlib-1.2.8/ioapi.c
index f1c3aec..7f5c191 100644
--- a/MP/code/zlib-1.2.8/ioapi.c
+++ b/MP/code/zlib-1.2.8/ioapi.c
@@ -14,7 +14,7 @@
#define _CRT_SECURE_NO_WARNINGS
#endif
-#if defined(MACOS_X) || defined(IOAPI_NO_64)
+#if defined(__APPLE__) || defined(IOAPI_NO_64)
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) ftello(stream)
diff --git a/MP/code/zlib-1.2.8/ioapi.h b/MP/code/zlib-1.2.8/ioapi.h
index b50c425..ea4493b 100644
--- a/MP/code/zlib-1.2.8/ioapi.h
+++ b/MP/code/zlib-1.2.8/ioapi.h
@@ -21,7 +21,7 @@
#ifndef _ZLIBIOAPI64_H
#define _ZLIBIOAPI64_H
-#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(MACOS_X))
+#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
// Linux needs this to support file operation on files larger then 4+GB
// But might need better if/def to select just the platforms that needs them.
diff --git a/SP/Makefile b/SP/Makefile
index 2b685a0..a5082b3 100644
--- a/SP/Makefile
+++ b/SP/Makefile
@@ -4,19 +4,13 @@
# GNU Make required
#
-COMPILE_PLATFORM=$(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'|sed -e 's/\//_/g')
-
-COMPILE_ARCH=$(shell uname -m | sed -e s/i.86/i386/ | sed -e 's/^arm.*/arm/')
-
+COMPILE_PLATFORM=$(shell uname | sed -e 's/_.*//' | tr '[:upper:]' '[:lower:]' | sed -e 's/\//_/g')
+COMPILE_ARCH=$(shell uname -m | sed -e 's/i.86/x86/' | sed -e 's/^arm.*/arm/')
ARM_VER_CHECK=$(shell uname -m)
ifeq ($(COMPILE_PLATFORM),sunos)
# Solaris uname and GNU uname differ
- COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/i386/)
-endif
-ifeq ($(COMPILE_PLATFORM),darwin)
- # Apple does some things a little differently...
- COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/i386/)
+ COMPILE_ARCH=$(shell uname -p | sed -e 's/i.86/x86/')
endif
ifndef BUILD_STANDALONE
@@ -509,11 +503,9 @@ ifeq ($(PLATFORM),darwin)
$(error Architecture $(ARCH) is not supported when cross compiling)
endif
endif
- else
- TOOLS_CFLAGS += -DMACOS_X
endif
- BASE_CFLAGS += -fno-strict-aliasing -DMACOS_X -fno-common -pipe
+ BASE_CFLAGS += -fno-strict-aliasing -fno-common -pipe
ifeq ($(USE_OPENAL),1)
ifneq ($(USE_OPENAL_DLOPEN),1)
diff --git a/SP/code/client/cl_curl.h b/SP/code/client/cl_curl.h
index 789542c..3ab8535 100644
--- a/SP/code/client/cl_curl.h
+++ b/SP/code/client/cl_curl.h
@@ -37,7 +37,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifdef WIN32
#define DEFAULT_CURL_LIB "libcurl-4.dll"
#define ALTERNATE_CURL_LIB "libcurl-3.dll"
-#elif defined(MACOS_X)
+#elif defined(__APPLE__)
#define DEFAULT_CURL_LIB "libcurl.dylib"
#else
#define DEFAULT_CURL_LIB "libcurl.so.4"
diff --git a/SP/code/client/snd_mix.c b/SP/code/client/snd_mix.c
index 89245bf..cdeb78b 100644
--- a/SP/code/client/snd_mix.c
+++ b/SP/code/client/snd_mix.c
@@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "client.h"
#include "snd_local.h"
-#if idppc_altivec && !defined(MACOS_X)
+#if idppc_altivec && !defined(__APPLE__)
#include <altivec.h>
#endif
diff --git a/SP/code/client/snd_openal.c b/SP/code/client/snd_openal.c
index e668b3c..5d689b6 100644
--- a/SP/code/client/snd_openal.c
+++ b/SP/code/client/snd_openal.c
@@ -585,7 +585,7 @@ typedef struct src_s
int flags; // flags from StartSoundEx
} src_t;
-#ifdef MACOS_X
+#ifdef __APPLE__
#define MAX_SRC 128
#else
#define MAX_SRC 256
@@ -2363,7 +2363,7 @@ static cvar_t *s_alCapture;
#ifdef _WIN32
#define ALDRIVER_DEFAULT "OpenAL32.dll"
-#elif defined(MACOS_X)
+#elif defined(__APPLE__)
#define ALDRIVER_DEFAULT "libopenal.dylib"
#elif defined(__OpenBSD__)
#define ALDRIVER_DEFAULT "libopenal.so"
@@ -2588,7 +2588,7 @@ static void S_AL_SoundInfo(void)
#ifdef USE_VOIP
if(capture_ext)
{
-#ifdef MACOS_X
+#ifdef __APPLE__
Com_Printf(" Input Device: %s\n", qalcGetString(alCaptureDevice, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER));
#else
Com_Printf(" Input Device: %s\n", qalcGetString(alCaptureDevice, ALC_CAPTURE_DEVICE_SPECIFIER));
@@ -2685,7 +2685,7 @@ qboolean S_AL_Init( soundInterface_t *si )
{
#if defined( _WIN32 )
if( !Q_stricmp( s_alDriver->string, ALDRIVER_DEFAULT ) && !QAL_Init( "OpenAL64.dll" ) ) {
-#elif defined ( MACOS_X )
+#elif defined ( __APPLE__ )
if( !Q_stricmp( s_alDriver->string, ALDRIVER_DEFAULT ) && !QAL_Init( "/System/Library/Frameworks/OpenAL.framework/OpenAL" ) ) {
#else
if( !Q_stricmp( s_alDriver->string, ALDRIVER_DEFAULT ) || !QAL_Init( ALDRIVER_DEFAULT ) ) {
@@ -2813,7 +2813,7 @@ qboolean S_AL_Init( soundInterface_t *si )
#endif
else
{
-#ifdef MACOS_X
+#ifdef __APPLE__
// !!! FIXME: Apple has a 1.1-compliant OpenAL, which includes
// !!! FIXME: capture support, but they don't list it in the
// !!! FIXME: extension string. We need to check the version string,
diff --git a/SP/code/qcommon/common.c b/SP/code/qcommon/common.c
index f89dfed..0f69fb6 100644
--- a/SP/code/qcommon/common.c
+++ b/SP/code/qcommon/common.c
@@ -2106,7 +2106,7 @@ static void Com_WriteCDKey( const char *filename, const char *ikey ) {
FS_Printf( f, "\n// generated by RTCW, do not modify\r\n" );
FS_Printf( f, "// Do not give this file to ANYONE.\r\n" );
-#ifdef MACOS_X // TTimo
+#ifdef __APPLE__ // TTimo
FS_Printf( f, "// Aspyr will NOT ask you to send this file to them.\r\n" );
#else
FS_Printf( f, "// id Software and Activision will NOT ask you to send this file to them.\r\n" );
diff --git a/SP/code/qcommon/files.c b/SP/code/qcommon/files.c
index 03a3e1d..eb70384 100644
--- a/SP/code/qcommon/files.c
+++ b/SP/code/qcommon/files.c
@@ -274,7 +274,7 @@ static char fs_gamedir[MAX_OSPATH]; // this will be a single file name w
static cvar_t *fs_debug;
static cvar_t *fs_homepath;
-#ifdef MACOS_X
+#ifdef __APPLE__
// Also search the .app bundle for .pk3 files
static cvar_t *fs_apppath;
#endif
@@ -3550,7 +3550,7 @@ static void FS_Startup( const char *gameName )
}
// fs_homepath is somewhat particular to *nix systems, only add if relevant
-#ifdef MACOS_X
+#ifdef __APPLE__
fs_apppath = Cvar_Get ("fs_apppath", Sys_DefaultAppPath(), CVAR_INIT|CVAR_PROTECTED );
// Make MacOSX also include the base path included with the .app bundle
if (fs_apppath->string[0])
diff --git a/SP/code/qcommon/q_platform.h b/SP/code/qcommon/q_platform.h
index 969fbbb..3c5821e 100644
--- a/SP/code/qcommon/q_platform.h
+++ b/SP/code/qcommon/q_platform.h
@@ -46,7 +46,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define idppc 1
#if defined(__VEC__)
#define idppc_altivec 1
-#ifdef MACOS_X // Apple's GCC does this differently than the FSF.
+#ifdef __APPLE__ // Apple's GCC does this differently than the FSF.
#define VECCONST_UINT8(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
(vector unsigned char) (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
#else
@@ -139,11 +139,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//============================================================== MAC OS X ===
-#if defined(MACOS_X) || defined(__APPLE_CC__)
+#if defined(__APPLE__) || defined(__APPLE_CC__)
// make sure this is defined, just for sanity's sake...
-#ifndef MACOS_X
-#define MACOS_X
+#ifndef __APPLE__
+#define __APPLE__
#endif
#define OS_STRING "macosx"
diff --git a/SP/code/qcommon/qcommon.h b/SP/code/qcommon/qcommon.h
index af244b3..570efe1 100644
--- a/SP/code/qcommon/qcommon.h
+++ b/SP/code/qcommon/qcommon.h
@@ -1150,7 +1150,7 @@ char *Sys_DefaultInstallPath( void );
char *Sys_SteamPath(void);
#endif
-#ifdef MACOS_X
+#ifdef __APPLE__
char *Sys_DefaultAppPath(void);
#endif
diff --git a/SP/code/rend2/qgl.h b/SP/code/rend2/qgl.h
index 32ac3cc..7a7898d 100644
--- a/SP/code/rend2/qgl.h
+++ b/SP/code/rend2/qgl.h
@@ -60,7 +60,7 @@ extern void ( APIENTRY * qglUnlockArraysEXT )( void );
// GL_ATI_pn_triangles
#ifndef GL_ATI_pn_triangles
#define GL_ATI_pn_triangles 1
-#ifndef MACOS_X //DAJ BUGFIX changed the numbers
+#ifndef __APPLE__ //DAJ BUGFIX changed the numbers
#define GL_PN_TRIANGLES_ATI 0x6090
#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x6091
#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x6092
diff --git a/SP/code/rend2/tr_shade.c b/SP/code/rend2/tr_shade.c
index f600fb0..4a1ef8f 100644
--- a/SP/code/rend2/tr_shade.c
+++ b/SP/code/rend2/tr_shade.c
@@ -28,7 +28,7 @@ If you have questions concerning this license or the applicable additional terms
// tr_shade.c
#include "tr_local.h"
-#if idppc_altivec && !defined(MACOS_X)
+#if idppc_altivec && !defined(__APPLE__)
#include <altivec.h>
#endif
diff --git a/SP/code/rend2/tr_surface.c b/SP/code/rend2/tr_surface.c
index bc66a67..dfd0f8d 100644
--- a/SP/code/rend2/tr_surface.c
+++ b/SP/code/rend2/tr_surface.c
@@ -28,7 +28,7 @@ If you have questions concerning this license or the applicable additional terms
// tr_surf.c
#include "tr_local.h"
-#if idppc_altivec && !defined(MACOS_X)
+#if idppc_altivec && !defined(__APPLE__)
#include <altivec.h>
#endif
diff --git a/SP/code/renderer/qgl.h b/SP/code/renderer/qgl.h
index 1638f7a..b3656a0 100644
--- a/SP/code/renderer/qgl.h
+++ b/SP/code/renderer/qgl.h
@@ -85,7 +85,7 @@ extern void myglMultiTexCoord2f( GLenum texture, GLfloat s, GLfloat t );
// GL_ATI_pn_triangles
#ifndef GL_ATI_pn_triangles
#define GL_ATI_pn_triangles 1
-#ifndef MACOS_X //DAJ BUGFIX changed the numbers
+#ifndef __APPLE__ //DAJ BUGFIX changed the numbers
#define GL_PN_TRIANGLES_ATI 0x6090
#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x6091
#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x6092
diff --git a/SP/code/renderer/tr_shade.c b/SP/code/renderer/tr_shade.c
index e884a26..ba76811 100644
--- a/SP/code/renderer/tr_shade.c
+++ b/SP/code/renderer/tr_shade.c
@@ -29,7 +29,7 @@ If you have questions concerning this license or the applicable additional terms
// tr_shade.c
#include "tr_local.h"
-#if idppc_altivec && !defined(MACOS_X)
+#if idppc_altivec && !defined(__APPLE__)
#include <altivec.h>
#endif
diff --git a/SP/code/renderer/tr_shade_calc.c b/SP/code/renderer/tr_shade_calc.c
index a1854b7..e3c36c2 100644
--- a/SP/code/renderer/tr_shade_calc.c
+++ b/SP/code/renderer/tr_shade_calc.c
@@ -29,7 +29,7 @@ If you have questions concerning this license or the applicable additional terms
// tr_shade_calc.c
#include "tr_local.h"
-#if idppc_altivec && !defined(MACOS_X)
+#if idppc_altivec && !defined(__APPLE__)
#include <altivec.h>
#endif
diff --git a/SP/code/renderer/tr_surface.c b/SP/code/renderer/tr_surface.c
index 2cb026f..671ac38 100644
--- a/SP/code/renderer/tr_surface.c
+++ b/SP/code/renderer/tr_surface.c
@@ -28,7 +28,7 @@ If you have questions concerning this license or the applicable additional terms
// tr_surf.c
#include "tr_local.h"
-#if idppc_altivec && !defined(MACOS_X)
+#if idppc_altivec && !defined(__APPLE__)
#include <altivec.h>
#endif
diff --git a/SP/code/sdl/sdl_input.c b/SP/code/sdl/sdl_input.c
index 383878d..f758de1 100644
--- a/SP/code/sdl/sdl_input.c
+++ b/SP/code/sdl/sdl_input.c
@@ -247,7 +247,7 @@ static keyNum_t IN_TranslateSDLToQ3Key( SDL_Keysym *keysym, qboolean down )
case SDLK_LCTRL:
case SDLK_RCTRL: key = K_CTRL; break;
-#ifdef MACOS_X
+#ifdef __APPLE__
case SDLK_RGUI:
case SDLK_LGUI: key = K_COMMAND; break;
#else
diff --git a/SP/code/splines/math_vector.cpp b/SP/code/splines/math_vector.cpp
index e6ad700..548fbaf 100644
--- a/SP/code/splines/math_vector.cpp
+++ b/SP/code/splines/math_vector.cpp
@@ -36,7 +36,7 @@ If you have questions concerning this license or the applicable additional terms
#include <time.h>
#include <ctype.h>
-#ifndef MACOS_X
+#ifndef __APPLE__
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
#endif
diff --git a/SP/code/sys/sys_local.h b/SP/code/sys/sys_local.h
index f8bd5b4..96edd98 100644
--- a/SP/code/sys/sys_local.h
+++ b/SP/code/sys/sys_local.h
@@ -44,7 +44,7 @@ unsigned int CON_LogSize( void );
unsigned int CON_LogWrite( const char *in );
unsigned int CON_LogRead( char *out, unsigned int outSize );
-#ifdef MACOS_X
+#ifdef __APPLE__
char *Sys_StripAppBundle( char *pwd );
#endif
diff --git a/SP/code/sys/sys_main.c b/SP/code/sys/sys_main.c
index ef6d60f..c168cc6 100644
--- a/SP/code/sys/sys_main.c
+++ b/SP/code/sys/sys_main.c
@@ -565,7 +565,7 @@ void Sys_ParseArgs( int argc, char **argv )
}
#ifndef DEFAULT_BASEDIR
-# ifdef MACOS_X
+# ifdef __APPLE__
# define DEFAULT_BASEDIR Sys_StripAppBundle(Sys_BinaryPath())
# else
# define DEFAULT_BASEDIR Sys_BinaryPath()
@@ -646,7 +646,7 @@ int main( int argc, char **argv )
// Set the initial time base
Sys_Milliseconds( );
-#ifdef MACOS_X
+#ifdef __APPLE__
// This is passed if we are launched by double-clicking
if ( argc >= 2 && Q_strncmp ( argv[1], "-psn", 4 ) == 0 )
argc = 1;
diff --git a/SP/code/sys/sys_osx.m b/SP/code/sys/sys_osx.m
index 30bf932..b0ecf6a 100644
--- a/SP/code/sys/sys_osx.m
+++ b/SP/code/sys/sys_osx.m
@@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
-#ifndef MACOS_X
+#ifndef __APPLE__
#error This file is for Mac OS X only. You probably should not compile it.
#endif
diff --git a/SP/code/sys/sys_unix.c b/SP/code/sys/sys_unix.c
index b6d66ea..f7aa689 100644
--- a/SP/code/sys/sys_unix.c
+++ b/SP/code/sys/sys_unix.c
@@ -63,7 +63,7 @@ char *Sys_DefaultHomePath(void)
if( ( p = getenv( "HOME" ) ) != NULL )
{
Com_sprintf(homePath, sizeof(homePath), "%s%c", p, PATH_SEP);
-#ifdef MACOS_X
+#ifdef __APPLE__
Q_strcat(homePath, sizeof(homePath),
"Library/Application Support/");
@@ -97,7 +97,7 @@ char *Sys_SteamPath( void )
if( ( p = getenv( "HOME" ) ) != NULL )
{
-#ifdef MACOS_X
+#ifdef __APPLE__
char *steamPathEnd = "/Library/Application Support/Steam/SteamApps/common/" STEAMPATH_NAME;
#else
char *steamPathEnd = "/.steam/steam/SteamApps/common/" STEAMPATH_NAME;
@@ -581,7 +581,7 @@ void Sys_ErrorDialog( const char *error )
close( f );
}
-#ifndef MACOS_X
+#ifndef __APPLE__
static char execBuffer[ 1024 ];
static char *execBufferPointer;
static char *execArgv[ 16 ];
diff --git a/SP/code/tools/lcc/cpp/unix.c b/SP/code/tools/lcc/cpp/unix.c
index 75e5b6d..bac841d 100644
--- a/SP/code/tools/lcc/cpp/unix.c
+++ b/SP/code/tools/lcc/cpp/unix.c
@@ -106,7 +106,7 @@ char *basepath( char *fname )
all and others do a terrible job (like calling malloc) */
// -- ouch, that hurts -- ln
/* always use the system memmove() on Mac OS X. --ryan. */
-#if !defined(MACOS_X) && !defined(_MSC_VER)
+#if !defined(__APPLE__) && !defined(_MSC_VER)
#ifdef memmove
#undef memmove
#endif
diff --git a/SP/code/zlib-1.2.8/ioapi.c b/SP/code/zlib-1.2.8/ioapi.c
index f1c3aec..7f5c191 100644
--- a/SP/code/zlib-1.2.8/ioapi.c
+++ b/SP/code/zlib-1.2.8/ioapi.c
@@ -14,7 +14,7 @@
#define _CRT_SECURE_NO_WARNINGS
#endif
-#if defined(MACOS_X) || defined(IOAPI_NO_64)
+#if defined(__APPLE__) || defined(IOAPI_NO_64)
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) ftello(stream)
diff --git a/SP/code/zlib-1.2.8/ioapi.h b/SP/code/zlib-1.2.8/ioapi.h
index b50c425..ea4493b 100644
--- a/SP/code/zlib-1.2.8/ioapi.h
+++ b/SP/code/zlib-1.2.8/ioapi.h
@@ -21,7 +21,7 @@
#ifndef _ZLIBIOAPI64_H
#define _ZLIBIOAPI64_H
-#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(MACOS_X))
+#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
// Linux needs this to support file operation on files larger then 4+GB
// But might need better if/def to select just the platforms that needs them.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list