Expose love.markDeprecated.

Arguments are (level, name, apitype, deprecationtype [, replacementname]). Call it inside a function.
This commit is contained in:
Alex Szpakowski
2021-06-06 18:16:56 -03:00
parent 199632e791
commit 5ef1709c02
7 changed files with 66 additions and 13 deletions
+20
View File
@@ -108,6 +108,8 @@ std::string getDeprecationNotice(const DeprecationInfo &info, bool usewhere)
notice += "function ";
else if (info.apiType == API_METHOD)
notice += "method ";
else if (info.apiType == API_CALLBACK)
notice += "callback ";
else if (info.apiType == API_FIELD)
notice += "field ";
else if (info.apiType == API_CONSTANT)
@@ -184,4 +186,22 @@ MarkDeprecated::~MarkDeprecated()
mutex->unlock();
}
STRINGMAP_BEGIN(APIType, API_MAX_ENUM, apiType)
{
{ "function", API_FUNCTION },
{ "method", API_METHOD },
{ "callback", API_CALLBACK },
{ "field", API_FIELD },
{ "constant", API_CONSTANT },
}
STRINGMAP_END(APIType, API_MAX_ENUM, apiType)
STRINGMAP_BEGIN(DeprecationType, DEPRECATED_MAX_ENUM, deprecationType)
{
{ "noreplacement", DEPRECATED_NO_REPLACEMENT },
{ "replaced", DEPRECATED_REPLACED },
{ "renamed", DEPRECATED_RENAMED },
}
STRINGMAP_END(DeprecationType, DEPRECATED_MAX_ENUM, deprecationType)
} // love