From 39da2d9fbd3e68610c2b8aeca968ae43cd9cff3b Mon Sep 17 00:00:00 2001 From: _Redstone_c_ Date: Wed, 1 Dec 2021 22:55:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=9B=AE=E5=BD=95=20NS=20?= =?UTF-8?q?=E5=AE=8F=E6=94=B9=E4=B8=BA=20NAMESPACE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Redcraft.Utility/Public/Misc/CoreDefines.h | 38 ------------------ .../Source/Public/Misc/CoreDefines.h | 39 +++++++++++++++++++ .../Public/Misc/PreprocessorHelpers.h | 0 3 files changed, 39 insertions(+), 38 deletions(-) delete mode 100644 Redcraft.Utility/Public/Misc/CoreDefines.h create mode 100644 Redcraft.Utility/Source/Public/Misc/CoreDefines.h rename Redcraft.Utility/{ => Source}/Public/Misc/PreprocessorHelpers.h (100%) diff --git a/Redcraft.Utility/Public/Misc/CoreDefines.h b/Redcraft.Utility/Public/Misc/CoreDefines.h deleted file mode 100644 index ce39c81..0000000 --- a/Redcraft.Utility/Public/Misc/CoreDefines.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -// Define the normal namespace -#define NS_BEGIN(Name) namespace Name { -#define NS_END(Name) } -#define NS_USING(Name) using namespace Name; - -// Define the redcraft master namespace -#define NS_REDCRAFT RFur -#define NS_REDCRAFT_BEGIN NS_BEGIN(NS_REDCRAFT) -#define NS_REDCRAFT_END NS_END(NS_REDCRAFT) -#define NS_REDCRAFT_USING NS_USING(NS_REDCRAFT) - -// Define the private namespace - Used to hide the realization of something -#define NS_PRIVATE Private -#define NS_PRIVATE_BEGIN NS_BEGIN(NS_PRIVATE) -#define NS_PRIVATE_END NS_END(NS_PRIVATE) - -// Define the STD namespace -#define NS_STD_BEGIN NS_BEGIN(std) -#define NS_STD_END NS_END(std) -#define NS_STD_USING NS_USING(std) - -// Define the unnamed namespace -#define NS_UNNAMED_BEGIN namespace { -#define NS_UNNAMED_END } - -// Create an alias for the namespace - like typedef -#define NS_DEFINE(Source, Target) NS_BEGIN(Target) NS_USING(Source) NS_END(Target) - -NS_REDCRAFT_BEGIN - -enum { INDEX_NONE = -1 }; -enum { UNICODE_BOM = 0xfeff }; - -enum EForceInit { ForceInit }; - -NS_REDCRAFT_END diff --git a/Redcraft.Utility/Source/Public/Misc/CoreDefines.h b/Redcraft.Utility/Source/Public/Misc/CoreDefines.h new file mode 100644 index 0000000..746f8ae --- /dev/null +++ b/Redcraft.Utility/Source/Public/Misc/CoreDefines.h @@ -0,0 +1,39 @@ +#pragma once + +// Define the normal namespace +#define NAMESPACE_BEGIN(Name) namespace Name { +#define NAMESPACE_END(Name) } +#define NAMESPACE_USING(Name) using namespace Name; + +// Define the redcraft master namespace +#define NAMESPACE_REDCRAFT RFur +#define NAMESPACE_REDCRAFT_BEGIN NAMESPACE_BEGIN(NAMESPACE_REDCRAFT) +#define NAMESPACE_REDCRAFT_END NAMESPACE_END(NAMESPACE_REDCRAFT) +#define NAMESPACE_REDCRAFT_USING NAMESPACE_USING(NAMESPACE_REDCRAFT) + +// Define the private namespace - Used to hide the realization of something +#define NAMESPACE_PRIVATE Private +#define NAMESPACE_PRIVATE_BEGIN NAMESPACE_BEGIN(NAMESPACE_PRIVATE) +#define NAMESPACE_PRIVATE_END NAMESPACE_END(NAMESPACE_PRIVATE) + +// Define the STD namespace +#define NAMESPACE_STD std +#define NAMESPACE_STD_BEGIN NAMESPACE_BEGIN(NAMESPACE_STD) +#define NAMESPACE_STD_END NAMESPACE_END(NAMESPACE_STD) +#define NAMESPACE_STD_USING NAMESPACE_USING(NAMESPACE_STD) + +// Define the unnamed namespace +#define NAMESPACE_UNNAMED_BEGIN namespace { +#define NAMESPACE_UNNAMED_END } + +// Create an alias for the namespace - like typedef +#define NAMESPACE_DEFINE(Source, Target) NAMESPACE_BEGIN(Target) NAMESPACE_USING(Source) NAMESPACE_END(Target) + +NAMESPACE_REDCRAFT_BEGIN + +enum { INDEX_NONE = -1 }; +enum { UNICODE_BOM = 0xfeff }; + +enum EForceInit { ForceInit }; + +NAMESPACE_REDCRAFT_END diff --git a/Redcraft.Utility/Public/Misc/PreprocessorHelpers.h b/Redcraft.Utility/Source/Public/Misc/PreprocessorHelpers.h similarity index 100% rename from Redcraft.Utility/Public/Misc/PreprocessorHelpers.h rename to Redcraft.Utility/Source/Public/Misc/PreprocessorHelpers.h