Created
July 6, 2013 15:23
-
-
Save DDuarte/5940214 to your computer and use it in GitHub Desktop.
TC override support example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From 637b254485b0768a2c74afedc8329b05883c8ba8 Mon Sep 17 00:00:00 2001 | |
| From: Nay <dnpd.dd@gmail.com> | |
| Date: Sat, 6 Jul 2013 16:22:32 +0100 | |
| Subject: [PATCH] TC override support example | |
| --- | |
| src/server/scripts/Examples/example_spell.cpp | 2 +- | |
| src/server/shared/CompilerDefs.h | 8 ++++++++ | |
| 2 files changed, 9 insertions(+), 1 deletion(-) | |
| diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp | |
| index c3a56e7..25cfdab 100644 | |
| --- a/src/server/scripts/Examples/example_spell.cpp | |
| +++ b/src/server/scripts/Examples/example_spell.cpp | |
| @@ -60,7 +60,7 @@ class spell_ex_5581 : public SpellScriptLoader | |
| // function called just after script is added to spell | |
| // we initialize local variables if needed | |
| - bool Load() | |
| + bool Load() TC_OVERRIDE | |
| { | |
| localVariable = "we're using local variable"; | |
| localVariable2 = new char(); | |
| diff --git a/src/server/shared/CompilerDefs.h b/src/server/shared/CompilerDefs.h | |
| index 10cdaf4..d8c05a1 100644 | |
| --- a/src/server/shared/CompilerDefs.h | |
| +++ b/src/server/shared/CompilerDefs.h | |
| @@ -66,4 +66,12 @@ | |
| # define COMPILER_HAS_CPP11_SUPPORT 0 | |
| #endif | |
| +#if COMPILER_HAS_CPP11_SUPPORT | |
| +# define TC_OVERRIDE override | |
| +# define TC_FINAL final | |
| +#else | |
| +# define TC_OVERRIDE | |
| +# define TC_FINAL | |
| +#endif | |
| + | |
| #endif | |
| -- | |
| 1.8.3.msysgit.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment