From 75b17aa9684a80de10472fbe8b5fdf90864dab4d Mon Sep 17 00:00:00 2001 From: Joseph Davies Date: Tue, 15 Jan 2013 16:00:06 -0800 Subject: [PATCH 1/2] Fix compiler error when using Max SDK 2008. --- Sources/Tools/MaxMain/MaxCompat.h | 6 ++++++ Sources/Tools/MaxMain/main.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/Tools/MaxMain/MaxCompat.h b/Sources/Tools/MaxMain/MaxCompat.h index 71f0eba3..81dee8d5 100644 --- a/Sources/Tools/MaxMain/MaxCompat.h +++ b/Sources/Tools/MaxMain/MaxCompat.h @@ -84,4 +84,10 @@ typedef TCHAR MCHAR; #define INIT_CUSTOM_CONTROLS(instance) #endif +#if MAX_VERSION_MAJOR <= 10 // Max 2008 +#define GETNAME_RETURN_TYPE TCHAR* +#else +#define GETNAME_RETURN_TYPE const TCHAR* +#endif + #endif // _PLASMA_MAXCOMPAT_H \ No newline at end of file diff --git a/Sources/Tools/MaxMain/main.cpp b/Sources/Tools/MaxMain/main.cpp index 25c2a4ba..3149eb35 100644 --- a/Sources/Tools/MaxMain/main.cpp +++ b/Sources/Tools/MaxMain/main.cpp @@ -235,7 +235,7 @@ public: ReferenceTarget *Clone(RemapDir &remap = DEFAULTREMAP); virtual bool CheckCopyAttribTo(ICustAttribContainer *to) { return true; } - const TCHAR* GetName() { return (const TCHAR*)_T(fClassDesc->ClassName()); } + GETNAME_RETURN_TYPE GetName() { return (GETNAME_RETURN_TYPE)_T(fClassDesc->ClassName()); } void DeleteThis() { delete this; } }; From 297e987036991fd7a68b2544b4f37927adc75f64 Mon Sep 17 00:00:00 2001 From: Joseph Davies Date: Tue, 15 Jan 2013 16:00:38 -0800 Subject: [PATCH 2/2] Fix typo in MaxCompat macro. --- Sources/Tools/MaxMain/MaxCompat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Tools/MaxMain/MaxCompat.h b/Sources/Tools/MaxMain/MaxCompat.h index 81dee8d5..dcd2abdd 100644 --- a/Sources/Tools/MaxMain/MaxCompat.h +++ b/Sources/Tools/MaxMain/MaxCompat.h @@ -79,7 +79,7 @@ typedef TCHAR MCHAR; #endif // MAX_VERSION_MAJOR #if MAX_VERSION_MAJOR <= 11 // max 2009. Just a guess, really. 2010 doesn't need this function. -#define INIT_CUSTOM_CONTROLLS(instance) InitCustomControls(instance) +#define INIT_CUSTOM_CONTROLS(instance) InitCustomControls(instance) #else #define INIT_CUSTOM_CONTROLS(instance) #endif