diff --git a/Source/Engine/Content/Asset.h b/Source/Engine/Content/Asset.h
index 15c5cae6f..125abdda2 100644
--- a/Source/Engine/Content/Asset.h
+++ b/Source/Engine/Content/Asset.h
@@ -184,8 +184,20 @@ public:
/// The output collection of the asset ids referenced by this asset.
/// The output list of file paths referenced by this asset. Files might come from project Content folder (relative path is preserved in cooked game), or external location (copied into Content root folder of cooked game).
virtual void GetReferences(Array& assets, Array& files) const;
- // [Deprecated in v1.9]
- DEPRECATED virtual void GetReferences(Array& output) const;
+
+
+ ///
+ /// Gets the asset references. Supported only in Editor.
+ /// [Deprecated in v1.9]
+ ///
+ ///
+ /// For some asset types (e.g. scene or prefab) it may contain invalid asset ids due to not perfect gather method,
+ /// which is optimized to perform scan very quickly. Before using those ids perform simple validation via Content cache API.
+ /// The result collection contains only 1-level-deep references (only direct ones) and is invalid if asset is not loaded.
+ /// Also, the output data may have duplicated asset ids or even invalid ids (Guid::Empty).
+ ///
+ /// The output collection of the asset ids referenced by this asset.
+ DEPRECATED("Use GetReferences with assets and files parameter instead") virtual void GetReferences(Array& output) const;
///
/// Gets the asset references. Supported only in Editor.
diff --git a/Source/Engine/Core/Compiler.h b/Source/Engine/Core/Compiler.h
index 9c736aa14..3e178143a 100644
--- a/Source/Engine/Core/Compiler.h
+++ b/Source/Engine/Core/Compiler.h
@@ -21,7 +21,6 @@
#define ALIGN_BEGIN(_align)
#define ALIGN_END(_align) __attribute__( (aligned(_align) ) )
#define OFFSET_OF(X, Y) __builtin_offsetof(X, Y)
-#define DEPRECATED [[deprecated]]
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
@@ -53,7 +52,6 @@
#define ALIGN_BEGIN(_align)
#define ALIGN_END(_align) __attribute__( (aligned(_align) ) )
#define OFFSET_OF(X, Y) __builtin_offsetof(X, Y)
-#define DEPRECATED [[deprecated]]
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
@@ -80,7 +78,6 @@
#define ALIGN_BEGIN(_align) __declspec(align(_align))
#define ALIGN_END(_align)
#define OFFSET_OF(X, Y) offsetof(X, Y)
-#define DEPRECATED __declspec(deprecated)
#undef __PRETTY_FUNCTION__
#define __PRETTY_FUNCTION__ __FUNCSIG__
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS \
@@ -100,6 +97,11 @@
#define PACK_STRUCT(_declaration) PACK_BEGIN() _declaration PACK_END()
+#define _DEPRECATED_0() [[deprecated]]
+#define _DEPRECATED_1(msg) [[deprecated(msg)]]
+#define _DEPRECATED(_0, _1, LASTARG, ...) LASTARG
+#define DEPRECATED(...) _DEPRECATED(, ##__VA_ARGS__, _DEPRECATED_1(__VA_ARGS__), _DEPRECATED_0())
+
// C++ 17
#if __cplusplus >= 201703L
#define IF_CONSTEXPR constexpr
diff --git a/Source/Engine/Core/Config/GraphicsSettings.h b/Source/Engine/Core/Config/GraphicsSettings.h
index 9fef78f74..4f837fd52 100644
--- a/Source/Engine/Core/Config/GraphicsSettings.h
+++ b/Source/Engine/Core/Config/GraphicsSettings.h
@@ -64,7 +64,7 @@ public:
/// [Deprecated in v1.9]
///
API_FIELD(Attributes="EditorOrder(1320), DefaultValue(false), EditorDisplay(\"Quality\", \"Allow CSM Blending\")")
- DEPRECATED bool AllowCSMBlending = false;
+ DEPRECATED() bool AllowCSMBlending = false;
///
/// Default probes cubemap resolution (use for Environment Probes, can be overriden per-actor).
diff --git a/Source/Engine/Core/Math/Matrix.h b/Source/Engine/Core/Math/Matrix.h
index b7f5ef8cf..0ee31df4f 100644
--- a/Source/Engine/Core/Math/Matrix.h
+++ b/Source/Engine/Core/Math/Matrix.h
@@ -481,7 +481,7 @@ public:
/// When the method completes, contains the translation component of the decomposed matrix.
/// This method is designed to decompose an SRT transformation matrix only.
void Decompose(Float3& scale, Matrix3x3& rotation, Float3& translation) const;
- DEPRECATED void Decompose(Float3& scale, Matrix& rotation, Float3& translation) const;
+ DEPRECATED("Use Decompose with 'Matrix3x3& rotation' parameter instead") void Decompose(Float3& scale, Matrix& rotation, Float3& translation) const;
public:
Matrix operator*(const float scale) const
diff --git a/Source/Engine/Core/Types/StringView.h b/Source/Engine/Core/Types/StringView.h
index 052bc1d54..2e9e9aaf5 100644
--- a/Source/Engine/Core/Types/StringView.h
+++ b/Source/Engine/Core/Types/StringView.h
@@ -115,7 +115,7 @@ public:
/// Gets the pointer to the string or to the static empty text if string is null. Returned pointer is always non-null, but is not null-terminated.
/// [Deprecated on 26.10.2022, expires on 26.10.2024] Use GetText()
///
- DEPRECATED const T* GetNonTerminatedText() const
+ DEPRECATED("Use GetText instead") const T* GetNonTerminatedText() const
{
return _data ? _data : (const T*)TEXT("");
}
diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h
index 30e4c905f..93718abe0 100644
--- a/Source/Engine/Debug/DebugDraw.h
+++ b/Source/Engine/Debug/DebugDraw.h
@@ -96,7 +96,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw
/// The color.
/// The duration (in seconds). Use 0 to draw it only once.
/// If set to true depth test will be performed, otherwise depth will be ignored.
- API_FUNCTION() DEPRECATED static void DrawRay(const Vector3& origin, const Vector3& direction, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true);
+ API_FUNCTION() DEPRECATED("Use DrawRay with length parameter instead") static void DrawRay(const Vector3& origin, const Vector3& direction, const Color& color, float duration, bool depthTest);
///
/// Draws the line in a direction.
diff --git a/Source/Engine/Graphics/Graphics.h b/Source/Engine/Graphics/Graphics.h
index 55ded56e5..be9ec9ac3 100644
--- a/Source/Engine/Graphics/Graphics.h
+++ b/Source/Engine/Graphics/Graphics.h
@@ -52,7 +52,7 @@ public:
/// Enables cascades splits blending for directional light shadows.
/// [Deprecated in v1.9]
///
- API_FIELD() DEPRECATED static bool AllowCSMBlending;
+ API_FIELD() DEPRECATED() static bool AllowCSMBlending;
///
/// The Global SDF quality. Controls the volume texture resolution and amount of cascades to use.
diff --git a/Source/Engine/Graphics/RenderView.h b/Source/Engine/Graphics/RenderView.h
index f2411ae2a..0b9f931e7 100644
--- a/Source/Engine/Graphics/RenderView.h
+++ b/Source/Engine/Graphics/RenderView.h
@@ -161,13 +161,13 @@ public:
/// The model LOD bias. Default is 0. Applied to all the objects in the shadow maps render views. Can be used to improve shadows rendering performance or increase quality.
/// [Deprecated on 26.10.2022, expires on 26.10.2024]
///
- API_FIELD() DEPRECATED int32 ShadowModelLODBias = 0;
+ API_FIELD() DEPRECATED() int32 ShadowModelLODBias = 0;
///
/// The model LOD distance scale factor. Default is 1. Applied to all the objects in the shadow maps render views. Higher values increase LODs quality. Can be used to improve shadows rendering performance or increase quality.
/// [Deprecated on 26.10.2022, expires on 26.10.2024]
///
- API_FIELD() DEPRECATED float ShadowModelLODDistanceFactor = 1.0f;
+ API_FIELD() DEPRECATED() float ShadowModelLODDistanceFactor = 1.0f;
///
/// Temporal Anti-Aliasing jitter frame index.
diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h
index dc77cdbee..5a792858d 100644
--- a/Source/Engine/Level/Actor.h
+++ b/Source/Engine/Level/Actor.h
@@ -164,13 +164,13 @@ public:
/// [Deprecated in v1.5]
///
API_PROPERTY(Attributes="HideInEditor, NoSerialize, NoAnimate")
- DEPRECATED const String& GetTag() const;
+ DEPRECATED("Use HasTag instead") const String& GetTag() const;
///
/// Sets the name of the tag.
/// [Deprecated in v1.5]
///
- API_PROPERTY() DEPRECATED void SetTag(const StringView& value);
+ API_PROPERTY() DEPRECATED("Use AddTag instead") void SetTag(const StringView& value);
///
/// Gets the actor name.
diff --git a/Source/Engine/Level/Actors/AnimatedModel.h b/Source/Engine/Level/Actors/AnimatedModel.h
index bb4b3a8f0..cf70ec220 100644
--- a/Source/Engine/Level/Actors/AnimatedModel.h
+++ b/Source/Engine/Level/Actors/AnimatedModel.h
@@ -160,7 +160,7 @@ public:
/// [Deprecated on 26.10.2022, expires on 26.10.2024]
///
API_FIELD(Attributes="EditorOrder(110), DefaultValue(ShadowsCastingMode.All), EditorDisplay(\"Skinned Model\")")
- DEPRECATED ShadowsCastingMode ShadowsMode = ShadowsCastingMode::All;
+ DEPRECATED() ShadowsCastingMode ShadowsMode = ShadowsCastingMode::All;
///
/// The animation root motion apply target. If not specified the animated model will apply it itself.
diff --git a/Source/Engine/Navigation/NavMeshRuntime.h b/Source/Engine/Navigation/NavMeshRuntime.h
index 40ea0959e..a3d7d9d53 100644
--- a/Source/Engine/Navigation/NavMeshRuntime.h
+++ b/Source/Engine/Navigation/NavMeshRuntime.h
@@ -160,7 +160,7 @@ public:
/// The source point.
/// The result position on the navmesh (valid only if method returns true).
/// True if found valid location on the navmesh, otherwise false.
- API_FUNCTION() DEPRECATED bool ProjectPoint(const Vector3& point, API_PARAM(Out) Vector3& result) const
+ API_FUNCTION() DEPRECATED("Use FindClosestPoint instead") bool ProjectPoint(const Vector3& point, API_PARAM(Out) Vector3& result) const
{
return FindClosestPoint(point, result);
}
diff --git a/Source/Engine/Navigation/Navigation.h b/Source/Engine/Navigation/Navigation.h
index 7628aa59a..4f920b673 100644
--- a/Source/Engine/Navigation/Navigation.h
+++ b/Source/Engine/Navigation/Navigation.h
@@ -54,7 +54,7 @@ public:
/// The source point.
/// The result position on the navmesh (valid only if method returns true).
/// True if found valid location on the navmesh, otherwise false.
- API_FUNCTION() DEPRECATED static bool ProjectPoint(const Vector3& point, API_PARAM(Out) Vector3& result)
+ API_FUNCTION() DEPRECATED("Use FindClosestPoint instead") static bool ProjectPoint(const Vector3& point, API_PARAM(Out) Vector3& result)
{
return FindClosestPoint(point, result);
}
diff --git a/Source/Engine/Networking/NetworkConfig.h b/Source/Engine/Networking/NetworkConfig.h
index e9827e536..0559dd34b 100644
--- a/Source/Engine/Networking/NetworkConfig.h
+++ b/Source/Engine/Networking/NetworkConfig.h
@@ -10,7 +10,7 @@ class ScriptingObject;
/// Network driver implementations enum.
/// [Deprecated in v1.3]
///
-API_ENUM(Namespace="FlaxEngine.Networking") enum class DEPRECATED NetworkDriverType
+API_ENUM(Namespace="FlaxEngine.Networking") enum class DEPRECATED() NetworkDriverType
{
///
/// Invalid network driver implementation.
@@ -36,7 +36,7 @@ API_STRUCT(Namespace="FlaxEngine.Networking") struct FLAXENGINE_API NetworkConfi
/// [Deprecated in v1.3]
///
API_FIELD()
- DEPRECATED NetworkDriverType NetworkDriverType;
+ DEPRECATED("Use NetworkDriver field instead") NetworkDriverType NetworkDriverType;
///
/// The network driver instance (implements INetworkDriver) that will be used to create and manage the peer, send and receive messages.
diff --git a/Source/Engine/Platform/Base/PlatformBase.h b/Source/Engine/Platform/Base/PlatformBase.h
index 35cfd8d17..d5ff4c59f 100644
--- a/Source/Engine/Platform/Base/PlatformBase.h
+++ b/Source/Engine/Platform/Base/PlatformBase.h
@@ -753,7 +753,7 @@ public:
/// True if start process with hidden window
/// True if wait for process competition
/// Retrieves the termination status of the specified process. Valid only if processed ended.
- API_FUNCTION() DEPRECATED static int32 StartProcess(const StringView& filename, const StringView& args, const StringView& workingDir, bool hiddenWindow = false, bool waitForEnd = false);
+ API_FUNCTION() DEPRECATED("Use CreateProcess instead") static int32 StartProcess(const StringView& filename, const StringView& args, const StringView& workingDir, bool hiddenWindow = false, bool waitForEnd = false);
///
/// Starts a new process (runs commandline). Waits for it's end and captures its output.
@@ -763,7 +763,7 @@ public:
/// The custom path of the working directory.
/// True if start process with hidden window.
/// Retrieves the termination status of the specified process. Valid only if processed ended.
- API_FUNCTION() DEPRECATED static int32 RunProcess(const StringView& cmdLine, const StringView& workingDir, bool hiddenWindow = true);
+ API_FUNCTION() DEPRECATED("Use CreateProcess instead") static int32 RunProcess(const StringView& cmdLine, const StringView& workingDir, bool hiddenWindow = true);
///
/// Starts a new process (runs commandline). Waits for it's end and captures its output.
@@ -774,7 +774,7 @@ public:
/// The process environment variables. If null the current process environment is used.
/// True if start process with hidden window.
/// Retrieves the termination status of the specified process. Valid only if processed ended.
- API_FUNCTION() DEPRECATED static int32 RunProcess(const StringView& cmdLine, const StringView& workingDir, const Dictionary& environment, bool hiddenWindow = true);
+ API_FUNCTION() DEPRECATED("Use CreateProcess instead") static int32 RunProcess(const StringView& cmdLine, const StringView& workingDir, const Dictionary& environment, bool hiddenWindow = true);
///
/// Creates a new process.
diff --git a/Source/Tools/Flax.Build/Bindings/ApiTypeInfo.cs b/Source/Tools/Flax.Build/Bindings/ApiTypeInfo.cs
index ee1004213..9c3fe6dd8 100644
--- a/Source/Tools/Flax.Build/Bindings/ApiTypeInfo.cs
+++ b/Source/Tools/Flax.Build/Bindings/ApiTypeInfo.cs
@@ -21,7 +21,7 @@ namespace Flax.Build.Bindings
public string Attributes;
public string[] Comment;
public bool IsInBuild;
- public bool IsDeprecated;
+ public string DeprecatedMessage;
public TypeInfo MarshalAs;
internal bool IsInited;
internal TypedefInfo Instigator;
@@ -34,6 +34,7 @@ namespace Flax.Build.Bindings
public virtual bool IsScriptingObject => false;
public virtual bool IsPod => false;
public virtual bool SkipGeneration => IsInBuild;
+ public virtual bool IsDeprecated => DeprecatedMessage != null;
public FileInfo File
{
@@ -154,7 +155,7 @@ namespace Flax.Build.Bindings
BindingsGenerator.Write(writer, Comment);
BindingsGenerator.Write(writer, MarshalAs);
writer.Write(IsInBuild);
- writer.Write(IsDeprecated);
+ BindingsGenerator.Write(writer, DeprecatedMessage);
BindingsGenerator.Write(writer, Tags);
BindingsGenerator.Write(writer, Children);
}
@@ -168,7 +169,7 @@ namespace Flax.Build.Bindings
Comment = BindingsGenerator.Read(reader, Comment);
MarshalAs = BindingsGenerator.Read(reader, MarshalAs);
IsInBuild = reader.ReadBoolean();
- IsDeprecated = reader.ReadBoolean();
+ DeprecatedMessage = BindingsGenerator.Read(reader, DeprecatedMessage);
Tags = BindingsGenerator.Read(reader, Tags);
Children = BindingsGenerator.Read(reader, Children);
diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs
index 70b23502b..5274ad43b 100644
--- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs
+++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs
@@ -829,7 +829,7 @@ namespace Flax.Build.Bindings
}
}
- private static void GenerateCSharpAttributes(BuildData buildData, StringBuilder contents, string indent, ApiTypeInfo apiTypeInfo, string attributes = null, string[] comment = null, bool canUseTooltip = false, bool useUnmanaged = false, string defaultValue = null, bool isDeprecated = false, TypeInfo defaultValueType = null)
+ private static void GenerateCSharpAttributes(BuildData buildData, StringBuilder contents, string indent, ApiTypeInfo apiTypeInfo, string attributes = null, string[] comment = null, bool canUseTooltip = false, bool useUnmanaged = false, string defaultValue = null, string deprecatedMessage = null, TypeInfo defaultValueType = null)
{
#if AUTO_DOC_TOOLTIPS
var writeTooltip = true;
@@ -853,10 +853,15 @@ namespace Flax.Build.Bindings
// Skip boilerplate code when using debugger
//contents.Append(indent).AppendLine("[System.Diagnostics.DebuggerStepThrough]");
}
- if (isDeprecated || apiTypeInfo.IsDeprecated)
+ if (deprecatedMessage != null || apiTypeInfo.IsDeprecated)
{
// Deprecated type
- contents.Append(indent).AppendLine("[Obsolete]");
+ if (!string.IsNullOrEmpty(apiTypeInfo.DeprecatedMessage))
+ contents.Append(indent).AppendLine($"[Obsolete(\"{apiTypeInfo.DeprecatedMessage}\")]");
+ else if (!string.IsNullOrEmpty(deprecatedMessage))
+ contents.Append(indent).AppendLine($"[Obsolete(\"{deprecatedMessage}\")]");
+ else
+ contents.Append(indent).AppendLine("[Obsolete]");
}
#if AUTO_DOC_TOOLTIPS
@@ -901,12 +906,12 @@ namespace Flax.Build.Bindings
private static void GenerateCSharpAttributes(BuildData buildData, StringBuilder contents, string indent, ApiTypeInfo apiTypeInfo, bool useUnmanaged, string defaultValue = null, TypeInfo defaultValueType = null)
{
- GenerateCSharpAttributes(buildData, contents, indent, apiTypeInfo, apiTypeInfo.Attributes, apiTypeInfo.Comment, true, useUnmanaged, defaultValue, false, defaultValueType);
+ GenerateCSharpAttributes(buildData, contents, indent, apiTypeInfo, apiTypeInfo.Attributes, apiTypeInfo.Comment, true, useUnmanaged, defaultValue, null, defaultValueType);
}
private static void GenerateCSharpAttributes(BuildData buildData, StringBuilder contents, string indent, ApiTypeInfo apiTypeInfo, MemberInfo memberInfo, bool useUnmanaged, string defaultValue = null, TypeInfo defaultValueType = null)
{
- GenerateCSharpAttributes(buildData, contents, indent, apiTypeInfo, memberInfo.Attributes, memberInfo.Comment, true, useUnmanaged, defaultValue, memberInfo.IsDeprecated, defaultValueType);
+ GenerateCSharpAttributes(buildData, contents, indent, apiTypeInfo, memberInfo.Attributes, memberInfo.Comment, true, useUnmanaged, defaultValue, memberInfo.DeprecatedMessage, defaultValueType);
}
private static bool GenerateCSharpStructureUseDefaultInitialize(BuildData buildData, StructureInfo structureInfo)
diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cache.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cache.cs
index d9fca9fca..a94307ed6 100644
--- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cache.cs
+++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cache.cs
@@ -19,7 +19,7 @@ namespace Flax.Build.Bindings
partial class BindingsGenerator
{
private static readonly Dictionary TypeCache = new Dictionary();
- private const int CacheVersion = 22;
+ private const int CacheVersion = 23;
internal static void Write(BinaryWriter writer, string e)
{
diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Parsing.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Parsing.cs
index 46eeeb572..15fe42bfd 100644
--- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Parsing.cs
+++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Parsing.cs
@@ -589,7 +589,13 @@ namespace Flax.Build.Bindings
token = context.Tokenizer.NextToken();
if (!desc.IsDeprecated && token.Value == "DEPRECATED")
{
- desc.IsDeprecated = true;
+ token = context.Tokenizer.NextToken();
+ string message = "";
+ if (token.Type == TokenType.LeftParent)
+ context.Tokenizer.SkipUntil(TokenType.RightParent, out message);
+ else
+ context.Tokenizer.PreviousToken();
+ desc.DeprecatedMessage = message.Trim('"');
}
else
{
@@ -698,7 +704,13 @@ namespace Flax.Build.Bindings
token = context.Tokenizer.NextToken();
if (!desc.IsDeprecated && token.Value == "DEPRECATED")
{
- desc.IsDeprecated = true;
+ token = context.Tokenizer.NextToken();
+ string message = "";
+ if (token.Type == TokenType.LeftParent)
+ context.Tokenizer.SkipUntil(TokenType.RightParent, out message);
+ else
+ context.Tokenizer.PreviousToken();
+ desc.DeprecatedMessage = message.Trim('"');
}
else
{
@@ -797,8 +809,14 @@ namespace Flax.Build.Bindings
}
else if (!desc.IsDeprecated && token.Value == "DEPRECATED")
{
- desc.IsDeprecated = true;
- context.Tokenizer.NextToken();
+ token = context.Tokenizer.NextToken();
+ string message = "";
+ if (token.Type == TokenType.LeftParent)
+ {
+ context.Tokenizer.SkipUntil(TokenType.RightParent, out message);
+ context.Tokenizer.NextToken();
+ }
+ desc.DeprecatedMessage = message.Trim('"');
}
else
{
@@ -960,7 +978,7 @@ namespace Flax.Build.Bindings
propertyInfo.Getter = functionInfo;
else
propertyInfo.Setter = functionInfo;
- propertyInfo.IsDeprecated |= functionInfo.IsDeprecated;
+ propertyInfo.DeprecatedMessage = functionInfo.DeprecatedMessage;
propertyInfo.IsHidden |= functionInfo.IsHidden;
if (propertyInfo.Getter != null && propertyInfo.Setter != null)
@@ -1025,7 +1043,13 @@ namespace Flax.Build.Bindings
token = context.Tokenizer.NextToken();
if (!desc.IsDeprecated && token.Value == "DEPRECATED")
{
- desc.IsDeprecated = true;
+ token = context.Tokenizer.NextToken();
+ string message = "";
+ if (token.Type == TokenType.LeftParent)
+ context.Tokenizer.SkipUntil(TokenType.RightParent, out message);
+ else
+ context.Tokenizer.PreviousToken();
+ desc.DeprecatedMessage = message.Trim('"');
}
else
{
@@ -1300,8 +1324,14 @@ namespace Flax.Build.Bindings
}
else if (!desc.IsDeprecated && token.Value == "DEPRECATED")
{
- desc.IsDeprecated = true;
- context.Tokenizer.NextToken();
+ token = context.Tokenizer.NextToken();
+ string message = "";
+ if (token.Type == TokenType.LeftParent)
+ {
+ context.Tokenizer.SkipUntil(TokenType.RightParent, out message);
+ context.Tokenizer.NextToken();
+ }
+ desc.DeprecatedMessage = message.Trim('"');
}
else
{
diff --git a/Source/Tools/Flax.Build/Bindings/MemberInfo.cs b/Source/Tools/Flax.Build/Bindings/MemberInfo.cs
index b0eb00313..5d2a5644d 100644
--- a/Source/Tools/Flax.Build/Bindings/MemberInfo.cs
+++ b/Source/Tools/Flax.Build/Bindings/MemberInfo.cs
@@ -14,12 +14,14 @@ namespace Flax.Build.Bindings
public string[] Comment;
public bool IsStatic;
public bool IsConstexpr;
- public bool IsDeprecated;
+ public string DeprecatedMessage;
public bool IsHidden;
public AccessLevel Access;
public string Attributes;
public Dictionary Tags;
+ public virtual bool IsDeprecated => DeprecatedMessage != null;
+
public bool HasAttribute(string name)
{
return Attributes != null && Attributes.Contains(name);
@@ -46,7 +48,7 @@ namespace Flax.Build.Bindings
BindingsGenerator.Write(writer, Comment);
writer.Write(IsStatic);
writer.Write(IsConstexpr);
- writer.Write(IsDeprecated);
+ BindingsGenerator.Write(writer, DeprecatedMessage);
writer.Write(IsHidden);
writer.Write((byte)Access);
BindingsGenerator.Write(writer, Attributes);
@@ -59,7 +61,7 @@ namespace Flax.Build.Bindings
Comment = BindingsGenerator.Read(reader, Comment);
IsStatic = reader.ReadBoolean();
IsConstexpr = reader.ReadBoolean();
- IsDeprecated = reader.ReadBoolean();
+ DeprecatedMessage = BindingsGenerator.Read(reader, DeprecatedMessage);
IsHidden = reader.ReadBoolean();
Access = (AccessLevel)reader.ReadByte();
Attributes = BindingsGenerator.Read(reader, Attributes);
diff --git a/Source/Tools/Flax.Build/Bindings/TypedefInfo.cs b/Source/Tools/Flax.Build/Bindings/TypedefInfo.cs
index 661ca51a4..3d85fb1b3 100644
--- a/Source/Tools/Flax.Build/Bindings/TypedefInfo.cs
+++ b/Source/Tools/Flax.Build/Bindings/TypedefInfo.cs
@@ -76,7 +76,7 @@ namespace Flax.Build.Bindings
if (Comment != null && Comment.Length != 0)
typedef.Comment = Comment;
typedef.IsInBuild |= IsInBuild;
- typedef.IsDeprecated |= IsDeprecated;
+ typedef.DeprecatedMessage = DeprecatedMessage;
if (typedef is ClassStructInfo typedefClassStruct && typedefClassStruct.IsTemplate)
{
// Inflate template type
diff --git a/Source/Tools/Flax.Build/Platforms/Windows/WindowsToolchainBase.cs b/Source/Tools/Flax.Build/Platforms/Windows/WindowsToolchainBase.cs
index 252d9134d..adda38e93 100644
--- a/Source/Tools/Flax.Build/Platforms/Windows/WindowsToolchainBase.cs
+++ b/Source/Tools/Flax.Build/Platforms/Windows/WindowsToolchainBase.cs
@@ -617,6 +617,9 @@ namespace Flax.Build.Platforms
commonArgs.Add(string.Format("/FU\"{0}\\platform.winmd\"", dir));
}
}
+
+ // Preprocessor conformance mode
+ commonArgs.Add("/Zc:preprocessor");
}
// Add preprocessor definitions