From e467f40d4a448eecda0b5417be08910c175c9c66 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 9 Jan 2009 22:44:43 +0000 Subject: [PATCH] it now compiles on OS X, but does it work? git-svn-id: svn://svn.icculus.org/netradiant/trunk@169 61c419a2-8eb2-4b30-bcec-8cead039b335 --- Makefile | 6 +++--- contrib/sunplug/sunplug.cpp | 2 +- radiant/texwindow.cpp | 2 +- tools/quake2/common/threads.c | 6 +----- tools/quake3/common/threads.c | 8 ++------ 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index a26833a9..8ce76bab 100644 --- a/Makefile +++ b/Makefile @@ -259,7 +259,7 @@ dependencies-check: checkbinary binutils "$(AR)"; \ checkbinary pkg-config "$(PKGCONFIG)"; \ [ "$(OS)" = "Win32" ] && checkbinary mingw32 "$(WINDRES)"; \ - [ "$(OS)" != "Win32" ] && checkbinary libc6 "$(LDD)"; \ + [ -n "$(lDD)" ] && checkbinary libc6 "$(LDD)"; \ $(ECHO) All required tools have been found! @$(ECHO) @if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; fi; \ @@ -481,8 +481,8 @@ libddslib.$(A): CPPFLAGS_EXTRA := -Ilibs libddslib.$(A): \ libs/ddslib/ddslib.o \ -$(INSTALLDIR)/q3data.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) -$(INSTALLDIR)/q3data.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Itools/quake3/common -Ilibs -Iinclude +$(INSTALLDIR)/q3data.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_ZLIB) +$(INSTALLDIR)/q3data.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_ZLIB) -Itools/quake3/common -Ilibs -Iinclude $(INSTALLDIR)/q3data.$(EXE): \ tools/quake3/common/aselib.o \ tools/quake3/common/bspfile.o \ diff --git a/contrib/sunplug/sunplug.cpp b/contrib/sunplug/sunplug.cpp index cebf44eb..2a89c5cf 100644 --- a/contrib/sunplug/sunplug.cpp +++ b/contrib/sunplug/sunplug.cpp @@ -39,7 +39,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA void about_plugin_window(); void MapCoordinator(); -#ifdef __linux__ +#ifndef _WIN32 // linux itoa implementation char* itoa( int value, char* result, int base ) { diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 810fc195..f24860b8 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -1917,7 +1917,7 @@ void TextureBrowser_searchTags() { size_t shaders_found = g_TextureBrowser.m_found_shaders.size(); - globalOutputStream() << "Found " << shaders_found << " textures and shaders with " << tags_searched << "\n"; + globalOutputStream() << "Found " << (unsigned int)shaders_found << " textures and shaders with " << (unsigned int)tags_searched << "\n"; ScopeDisableScreenUpdates disableScreenUpdates("Searching...", "Loading Textures"); std::set::iterator iter; diff --git a/tools/quake2/common/threads.c b/tools/quake2/common/threads.c index 76e969da..9c123a5a 100644 --- a/tools/quake2/common/threads.c +++ b/tools/quake2/common/threads.c @@ -542,11 +542,7 @@ void RunThreadsOn (int workcnt, qboolean showpacifier, void(*func)(int)) if(pthread_mutexattr_init(&mattrib) != 0) Error("pthread_mutexattr_init failed"); -#if __GLIBC_MINOR__ == 1 - if (pthread_mutexattr_settype(&mattrib, PTHREAD_MUTEX_FAST_NP) != 0) -#else - if (pthread_mutexattr_settype(&mattrib, PTHREAD_MUTEX_ADAPTIVE_NP) != 0) -#endif + if (pthread_mutexattr_settype(&mattrib, PTHREAD_MUTEX_ERRORCHECK) != 0) Error ("pthread_mutexattr_settype failed"); recursive_mutex_init(mattrib); diff --git a/tools/quake3/common/threads.c b/tools/quake3/common/threads.c index 137597c7..8a5fa35a 100644 --- a/tools/quake3/common/threads.c +++ b/tools/quake3/common/threads.c @@ -415,7 +415,7 @@ void RunThreadsOn (int workcnt, qboolean showpacifier, void(*func)(int)) ======================================================================= */ -#ifdef __linux__ +#if defined(__linux__) || defined(__APPLE__) #define USED int numthreads = 4; @@ -540,11 +540,7 @@ void RunThreadsOn (int workcnt, qboolean showpacifier, void(*func)(int)) if(pthread_mutexattr_init(&mattrib) != 0) Error("pthread_mutexattr_init failed"); -#if __GLIBC_MINOR__ == 1 - if (pthread_mutexattr_settype(&mattrib, PTHREAD_MUTEX_FAST_NP) != 0) -#else - if (pthread_mutexattr_settype(&mattrib, PTHREAD_MUTEX_ADAPTIVE_NP) != 0) -#endif + if (pthread_mutexattr_settype(&mattrib, PTHREAD_MUTEX_ERRORCHECK) != 0) Error ("pthread_mutexattr_settype failed"); recursive_mutex_init(mattrib); -- 2.39.2