From 4ea28cf8094ef303fd832232019c9d5db12ebfe8 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Fri, 7 May 2010 23:09:36 +0000 Subject: [PATCH] OS X Atlas build fix. Fix wcsdup emulation. Remove seemingly unneeded compile flag (closes #424). This was SVN commit r7513. --- build/premake/extern_libs.lua | 5 ----- source/lib/posix/posix.cpp | 2 +- source/lib/posix/tests/test_posix.h | 8 ++++++++ source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp | 2 ++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build/premake/extern_libs.lua b/build/premake/extern_libs.lua index 4f0e06407a..b241ca0112 100644 --- a/build/premake/extern_libs.lua +++ b/build/premake/extern_libs.lua @@ -149,11 +149,6 @@ extern_lib_defs = { tinsert(package.config["Release"].links, "libxml2") else pkgconfig("libxml-2.0") - -- libxml2 needs _REENTRANT or __MT__ for thread support; - -- OS X doesn't get either set by default, so do it manually - if OS == "macosx" then - tinsert(package.defines, "_REENTRANT") - end end end, }, diff --git a/source/lib/posix/posix.cpp b/source/lib/posix/posix.cpp index 1f66e70c42..85f01b717d 100644 --- a/source/lib/posix/posix.cpp +++ b/source/lib/posix/posix.cpp @@ -102,7 +102,7 @@ wchar_t* wcsdup(const wchar_t* str) wchar_t* dst = (wchar_t*)malloc((num_chars+1)*sizeof(wchar_t)); // note: wcsdup is required to use malloc if(!dst) return 0; - wcscpy_s(dst, num_chars, str); + wcscpy_s(dst, num_chars+1, str); return dst; } #endif diff --git a/source/lib/posix/tests/test_posix.h b/source/lib/posix/tests/test_posix.h index ef36c2e482..11461c7f85 100644 --- a/source/lib/posix/tests/test_posix.h +++ b/source/lib/posix/tests/test_posix.h @@ -104,4 +104,12 @@ public: { do_fpclassify(); } + + void test_wcsdup() + { + const wchar_t* a = L"test"; + wchar_t* t = wcsdup(a); + TS_ASSERT_WSTR_EQUALS(t, a); + free(t); + } }; diff --git a/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp b/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp index 3fa860c82a..73a10f0d9e 100644 --- a/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp +++ b/source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp @@ -248,6 +248,7 @@ public: return true; } +#if wxUSE_DEBUGREPORT virtual void OnFatalException() { wxDebugReport report; @@ -262,6 +263,7 @@ public: OpenDirectory(dir); } } +#endif // wxUSE_DEBUGREPORT /* Disabled (and should be removed if it turns out to be unnecessary) - see MessagePasserImpl.cpp for information