From a5bdbd47a202507794db55039193df49bebdfed7 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Tue, 1 Jan 2019 13:11:46 -0600 Subject: [PATCH] corrects compilation errors on mac --- .../worldEditor/guiConvexShapeEditorCtrl.cpp | 4 +-- Engine/source/platformMac/macFileIO.mm | 28 ++++++++----------- Engine/source/platformMac/macMath.mm | 9 +++++- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp index ecae9f76d..24e6ea8c8 100644 --- a/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp +++ b/Engine/source/gui/worldEditor/guiConvexShapeEditorCtrl.cpp @@ -178,7 +178,7 @@ void GuiConvexEditorCtrl::setVisible( bool val ) AbstractClassRep* classRep = AbstractClassRep::findClassRep(mProxyObjects[i].targetObjectClass); if (!classRep) { - Con::errorf("WorldEditor::createPolyhedralObject - No such class: %s", mProxyObjects[i].targetObjectClass); + Con::errorf("WorldEditor::createPolyhedralObject - No such class: %s", mProxyObjects[i].targetObjectClass.c_str()); continue; } @@ -2513,4 +2513,4 @@ if (convex) DefineEngineMethod( GuiConvexEditorCtrl, splitSelectedFace, void, (), , "" ) { object->splitSelectedFace(); -} \ No newline at end of file +} diff --git a/Engine/source/platformMac/macFileIO.mm b/Engine/source/platformMac/macFileIO.mm index e4d182dc1..b2549e0f7 100644 --- a/Engine/source/platformMac/macFileIO.mm +++ b/Engine/source/platformMac/macFileIO.mm @@ -39,7 +39,7 @@ #import "platform/profiler.h" #import "cinterface/c_controlInterface.h" #import "core/volume.h" - +#include "console/engineAPI.h" //TODO: file io still needs some work... #define MAX_MAC_PATH_LONG 2048 @@ -992,25 +992,22 @@ bool Platform::fileTimeToString(FileTime * time, char * string, U32 strLen) { re //----------------------------------------------------------------------------- #if defined(TORQUE_DEBUG) -ConsoleFunction(testHasSubdir,void,2,2,"tests platform::hasSubDirectory") { - Con::printf("testing %s",(const char*)argv[1]); +DefineEngineFunction(testHasSubdir,void, (String _dir),,"tests platform::hasSubDirectory") { Platform::addExcludedDirectory(".svn"); - if(Platform::hasSubDirectory(argv[1])) + if(Platform::hasSubDirectory(_dir.c_str())) Con::printf(" has subdir"); else Con::printf(" does not have subdir"); } -ConsoleFunction(testDumpDirectories,void,4,4,"testDumpDirectories('path', int depth, bool noBasePath)") { +DefineEngineFunction(testDumpDirectories,void,(String _path, S32 _depth, bool _noBasePath),,"testDumpDirectories('path', int depth, bool noBasePath)") { Vector paths; - const S32 depth = dAtoi(argv[2]); - const bool noBasePath = dAtob(argv[3]); Platform::addExcludedDirectory(".svn"); - Platform::dumpDirectories(argv[1], paths, depth, noBasePath); + Platform::dumpDirectories(_path.c_str(), paths, _depth, _noBasePath); - Con::printf("Dumping directories starting from %s with depth %i", (const char*)argv[1],depth); + Con::printf("Dumping directories starting from %s with depth %i", _path.c_str(), _depth); for(Vector::iterator itr = paths.begin(); itr != paths.end(); itr++) { Con::printf(*itr); @@ -1018,14 +1015,13 @@ ConsoleFunction(testDumpDirectories,void,4,4,"testDumpDirectories('path', int de } -ConsoleFunction(testDumpPaths, void, 3, 3, "testDumpPaths('path', int depth)") +DefineEngineFunction(testDumpPaths, void, (String _path, S32 _depth),, "testDumpPaths('path', int depth)") { Vector files; - S32 depth = dAtoi(argv[2]); Platform::addExcludedDirectory(".svn"); - Platform::dumpPath(argv[1], files, depth); + Platform::dumpPath(_path.c_str(), files, _depth); for(Vector::iterator itr = files.begin(); itr != files.end(); itr++) { Con::printf("%s/%s",itr->pFullPath, itr->pFileName); @@ -1033,15 +1029,15 @@ ConsoleFunction(testDumpPaths, void, 3, 3, "testDumpPaths('path', int depth)") } //----------------------------------------------------------------------------- -ConsoleFunction(testFileTouch, bool , 2,2, "testFileTouch('path')") +DefineEngineFunction(testFileTouch, bool , (String _path),, "testFileTouch('path')") { - return dFileTouch(argv[1]); + return dFileTouch(_path.c_str()); } -ConsoleFunction(testGetFileTimes, bool, 2,2, "testGetFileTimes('path')") +DefineEngineFunction(testGetFileTimes, bool, (String _path),, "testGetFileTimes('path')") { FileTime create, modify; - bool ok = Platform::getFileTimes(argv[1], &create, &modify); + bool ok = Platform::getFileTimes(_path.c_str(), &create, &modify); Con::printf("%s Platform::getFileTimes %i, %i", ok ? "+OK" : "-FAIL", create, modify); return ok; } diff --git a/Engine/source/platformMac/macMath.mm b/Engine/source/platformMac/macMath.mm index c27375ee4..a59bf6609 100644 --- a/Engine/source/platformMac/macMath.mm +++ b/Engine/source/platformMac/macMath.mm @@ -24,6 +24,7 @@ #import "console/console.h" #import "math/mMath.h" #import "core/strings/stringFunctions.h" +#include "console/engineAPI.h" extern void mInstallLibrary_C(); extern void mInstallLibrary_Vec(); @@ -51,7 +52,13 @@ void Platform::setMathControlStateKnown() } //-------------------------------------- -ConsoleFunction( MathInit, void, 1, 10, "(DETECT|C|SSE)") +DefineEngineStringlyVariadicFunction( mathInit, void, 1, 10, "( ... )" + "@brief Install the math library with specified extensions.\n\n" + "Possible parameters are:\n\n" + " - 'DETECT' Autodetect math lib settings.\n\n" + " - 'C' Enable the C math routines. C routines are always enabled.\n\n" + " - 'SSE' Enable SSE math routines.\n\n" + "@ingroup Math") { U32 properties = CPU_PROP_C; // C entensions are always used