rendered paste bodydiff --git a/build/premake/extern_libs.lua b/build/premake/extern_libs.luaindex 549e519..6e11d59 100644--- a/build/premake/extern_libs.lua+++ b/build/premake/extern_libs.lua@@ -56,7 +56,8 @@ end -- library installation rules. extern_lib_defs = { boost = {- unix_names = { "boost_signals", "boost_filesystem" }+ unix_names = { "boost_signals", "boost_filesystem" },+ osx_names = { "boost_signals-mt", "boost_filesystem-mt", "boost_system-mt" } }, cryptopp = { },@@ -220,6 +221,8 @@ local function add_extern_lib(extern_lib, def) if def.win_names then names = def.win_names end+ elseif OS == "macosx" and def.osx_names then+ names = def.osx_names else if def.unix_names then names = def.unix_namesdiff --git a/build/premake/premake.lua b/build/premake/premake.luaindex 4ce0add..ce04dd7 100755--- a/build/premake/premake.lua+++ b/build/premake/premake.lua@@ -846,7 +846,7 @@ function setup_collada_package(package_name, target_type, rel_source_dirs, rel_i -- define MACOS-something? tinsert(package.buildoptions, "`pkg-config libxml-2.0 --cflags`")- tinsert(package.linkoptions, "`pkg-config libxml-2.0 --libs`")+ tinsert(package.linkoptions, "`pkg-config libxml-2.0 --libs` -framework CoreServices") end enddiff --git a/libraries/fcollada/include/FUtils/FUStringBuilder.h b/libraries/fcollada/include/FUtils/FUStringBuilder.hindex bcb5b00..a2bcba1 100644--- a/libraries/fcollada/include/FUtils/FUStringBuilder.h+++ b/libraries/fcollada/include/FUtils/FUStringBuilder.h@@ -117,9 +117,9 @@ public: /** Appends the integer value, after converting it to a string, to the content of the builder. @param i An integer value. */- void append(const int32 i);- void append(const uint32 i); /**< See above. */- void append(const uint64 i); /**< See above. */+ void append(int32 i);+ void append(uint32 i); /**< See above. */+ void append(uint64 i); /**< See above. */ /** Appends the integer value, after converting it to a fm::string, in hexadecimal, to the content of the builder.diff --git a/libraries/fcollada/src/FCollada/FCDocument/FCDGeometryPolygonsTools.cpp b/libraries/fcollada/src/FCollada/FCDocument/FCDGeometryPolygonsTools.cppindex 6c054bf..552fe05 100644--- a/libraries/fcollada/src/FCollada/FCDocument/FCDGeometryPolygonsTools.cpp+++ b/libraries/fcollada/src/FCollada/FCDocument/FCDGeometryPolygonsTools.cpp@@ -905,10 +905,12 @@ namespace FCDGeometryPolygonsTools } } +#ifdef WIN32 #pragma warning(push) #pragma warning(disable : 4127) // conditional expression constant #pragma warning(disable : 4244) // conversion from 'const float' to 'uint8'- +#endif+ #define INVALID_VTX_IDX (uint16(~0)) // This value is the default (invalid) value in the vtx data map template<class VAL, bool translateValue, bool isColor>@@ -954,7 +956,9 @@ namespace FCDGeometryPolygonsTools } } +#ifdef WIN32 #pragma warning(pop)+#endif void PackVertexBufferV3(uint8* destBuffer, uint32 destBuffStride, const FCDGeometrySource* source, uint32 vCount, uint16* vtxPackingMap,diff --git a/libraries/fcollada/src/FCollada/FUtils/FUDebug.cpp b/libraries/fcollada/src/FCollada/FUtils/FUDebug.cppindex 4eadfee..90d5db3 100644--- a/libraries/fcollada/src/FCollada/FUtils/FUDebug.cpp+++ b/libraries/fcollada/src/FCollada/FUtils/FUDebug.cpp@@ -70,7 +70,7 @@ void FUDebug::DebugOut(uint8 verbosity, const char* message, ...) void FUDebug::DebugOutV(uint8 verbosity, const char* filename, uint32 line, const char* message, va_list& vars) { char buffer[256];- snprintf(buffer, 256, "[%s@%lu] ", filename, line);+ snprintf(buffer, 256, "[%s@%u] ", filename, line); buffer[255] = 0; DebugString(buffer); diff --git a/libraries/fcollada/src/FCollada/FUtils/FUFileManager.cpp b/libraries/fcollada/src/FCollada/FUtils/FUFileManager.cppindex d01e991..ee89747 100644--- a/libraries/fcollada/src/FCollada/FUtils/FUFileManager.cpp+++ b/libraries/fcollada/src/FCollada/FUtils/FUFileManager.cpp@@ -21,10 +21,11 @@ #if defined(WIN32) #include <direct.h>-#elif defined(__APPLE__)+#elif defined(LINUX)+#if defined(__APPLE__) #include <mach-o/dyld.h> typedef int (*NSGetExecutablePathProcPtr)(char *buf, size_t *bufsize);-#elif defined(LINUX)+#endif #include <sys/types.h> #include <sys/stat.h> #include <unistd.h>diff --git a/libraries/fcollada/src/FCollada/FUtils/FUStringBuilder.h b/libraries/fcollada/src/FCollada/FUtils/FUStringBuilder.hindex bcb5b00..aefe58a 100644--- a/libraries/fcollada/src/FCollada/FUtils/FUStringBuilder.h+++ b/libraries/fcollada/src/FCollada/FUtils/FUStringBuilder.h@@ -117,9 +117,12 @@ public: /** Appends the integer value, after converting it to a string, to the content of the builder. @param i An integer value. */- void append(const int32 i);- void append(const uint32 i); /**< See above. */- void append(const uint64 i); /**< See above. */+ void append(int32 i);+ void append(uint32 i); /**< See above. */+ void append(uint64 i); /**< See above. */+#if defined(__APPLE__)+ void append(size_t i) { append((uint32) i); }+#endif /** Appends the integer value, after converting it to a fm::string, in hexadecimal, to the content of the builder.diff --git a/libraries/fcollada/src/Makefile b/libraries/fcollada/src/Makefileindex bd795f9..e6f0ae2 100644--- a/libraries/fcollada/src/Makefile+++ b/libraries/fcollada/src/Makefile@@ -1,8 +1,16 @@+OS_ARCH := $(shell uname -s)++ifeq ($(OS_ARCH),Darwin)+PIC_FLAGS := -fPIC+else+PIC_FLAGS := -fpic+endif+ CXX := g++-CXXFLAGS := -W -Wall -Wno-unused-parameter -Wno-unused-function -DLINUX -fPIC+CXXFLAGS := -W -Wall -Wno-unused-parameter -Wno-unused-function -DLINUX $(PIC_FLAGS) CXXFLAGS_DEBUG := -O0 -g -D_DEBUG CXXFLAGS_RELEASE := -O2 -DNDEBUG -DRETAIL-LDFLAGS := -lxml2 -shared -fPIC+LDFLAGS := -lxml2 -shared $(PIC_FLAGS) INCLUDES := -IFCollada -I/usr/include/libxml2 SOURCE = \@@ -194,6 +202,7 @@ output/libFColladaSR.a: $(OBJECTS_RELEASE) ar -cr $@ $(OBJECTS_RELEASE); ranlib $@ install: output/libFColladaSD.a output/libFColladaSR.a+ if [ ! -d ../lib ]; then mkdir ../lib ; fi cp output/libFColladaSD.a ../lib/libFColladaSD.a cp output/libFColladaSR.a ../lib/libFColladaSR.a diff --git a/source/lib/external_libraries/openal.h b/source/lib/external_libraries/openal.hindex 86738d2..0128eb6 100644--- a/source/lib/external_libraries/openal.h+++ b/source/lib/external_libraries/openal.h@@ -32,11 +32,8 @@ // ALC strings (e.g. device and extension names) are typed differently // between platforms *sigh*-#if OS_MACOSX-typedef ALCubyte* alcString;-#else+// No, they're not... typedef ALCchar* alcString;-#endif #if MSC_VERSION # pragma comment(lib, "openal32.lib")diff --git a/source/lib/secure_crt.h b/source/lib/secure_crt.hindex 46daf1a..677714f 100644--- a/source/lib/secure_crt.h+++ b/source/lib/secure_crt.h@@ -38,7 +38,7 @@ namespace ERR #if EMULATE_SECURE_CRT // (conflicts with glibc definitions)-#if !OS_UNIX+#if !OS_UNIX || OS_MACOSX // return length [in characters] of a string, not including the trailing // null character. to protect against access violations, only the // first <max_len> characters are examined; if the null character isdiff --git a/source/lib/sysdep/os/osx/odbg.cpp b/source/lib/sysdep/os/osx/odbg.cppindex 6f06d58..016b3c3 100644--- a/source/lib/sysdep/os/osx/odbg.cpp+++ b/source/lib/sysdep/os/osx/odbg.cpp@@ -28,7 +28,7 @@ void* debug_GetCaller(void* UNUSED(context), const char* UNUSED(lastFuncToSkip)) return NULL; } -LibError debug_DumpStack(wchar_t* UNUSED(buf), size_t UNUSED(max_chars), size_t UNUSED(skip), void* UNUSED(context))+LibError debug_DumpStack(wchar_t* UNUSED(buf), size_t UNUSED(max_chars), void* UNUSED(context), const char* UNUSED(lastFuncToSkip)) { return ERR::NOT_IMPLEMENTED; }diff --git a/source/lib/timer.cpp b/source/lib/timer.cppindex 59653ed..cf19acc 100644--- a/source/lib/timer.cpp+++ b/source/lib/timer.cpp@@ -53,7 +53,11 @@ // they're also not guaranteed to be monotonic. #if HAVE_GETTIMEOFDAY+#if defined(__APPLE__)+static struct timeval start;+#else static struct timespec start;+#endif #elif HAVE_CLOCK_GETTIME static struct timeval start; #endifdiff --git a/source/tools/atlas/AtlasUI/ActorViewer/ActorViewer.cpp b/source/tools/atlas/AtlasUI/ActorViewer/ActorViewer.cppindex b90d926..bb0e2b5 100644--- a/source/tools/atlas/AtlasUI/ActorViewer/ActorViewer.cpp+++ b/source/tools/atlas/AtlasUI/ActorViewer/ActorViewer.cpp@@ -242,7 +242,11 @@ ActorViewer::ActorViewer(wxWindow* parent, ScriptInterface& scriptInterface) std::map<std::wstring, wxTreeItemId> treeEntries; +#ifdef wxHAS_REGEX_ADVANCED wxRegEx stripDirs (_T("^([^/]+)/"), wxRE_ADVANCED); // the non-empty string up to the first slash+#else+ wxRegEx stripDirs (_T("^([^/]+)/"), wxRE_DEFAULT); // the non-empty string up to the first slash+#endif for (std::vector<sObjectsListItem>::iterator it = objects.begin(); it != objects.end(); ++it) {diff --git a/source/tools/atlas/AtlasUI/CustomControls/ColourDialog/ColourDialog.cpp b/source/tools/atlas/AtlasUI/CustomControls/ColourDialog/ColourDialog.cppindex 5372d3c..3708578 100644--- a/source/tools/atlas/AtlasUI/CustomControls/ColourDialog/ColourDialog.cpp+++ b/source/tools/atlas/AtlasUI/CustomControls/ColourDialog/ColourDialog.cpp@@ -29,7 +29,11 @@ ColourDialog::ColourDialog(wxWindow* parent, const wxString& customColourConfigP // Load custom colours from the config database +#ifdef wxHAS_REGEX_ADVANCED wxRegEx re (_T("(\\d+) (\\d+) (\\d+)"), wxRE_ADVANCED);+#else+ wxRegEx re (_T("(\\d+) (\\d+) (\\d+)"), wxRE_DEFAULT);+#endif wxConfigBase* cfg = wxConfigBase::Get(false); if (cfg)diff --git a/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp b/source/tools/atlas/AtlasUI/Misc/DLLInterface.cppindex 8ffeea9..3e7df46 100644--- a/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp+++ b/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp@@ -243,6 +243,7 @@ public: virtual void OnFatalException() {+#if wxUSE_DEBUGREPORT wxDebugReport report; wxDebugReportPreviewStd preview; @@ -254,6 +255,7 @@ public: report.Process(); OpenDirectory(dir); }+#endif } /* Disabled (and should be removed if it turns out to be unnecessary)diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cppindex ac215a8..89131f4 100644--- a/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp+++ b/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp@@ -30,6 +30,14 @@ #include "General/AtlasEventLoop.h" #include "General/Datafile.h" +#if defined(__APPLE__)+ #include "AtlasScript/ScriptInterface.h"+ #define _UINT64+ #define _UINT32+ #define _UINT16+ #define _UINT8+#endif+ #include "CustomControls/HighResTimer/HighResTimer.h" #include "CustomControls/Buttons/ToolButton.h" #include "CustomControls/Canvas/Canvas.h"@@ -37,7 +45,9 @@ #include "GameInterface/MessagePasser.h" #include "GameInterface/Messages.h" +#if !defined(__APPLE__) #include "AtlasScript/ScriptInterface.h"+#endif #include "Tools/Common/Tools.h" #include "Tools/Common/Brushes.h"