Fixes for standard library changes
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
a4ac678154
commit
bc975aba53
|
@ -2,6 +2,7 @@
|
||||||
#define PKMNLIB_MISCLIBRARY_HPP
|
#define PKMNLIB_MISCLIBRARY_HPP
|
||||||
|
|
||||||
#include <CreatureLib/Battling/Library/MiscLibrary.hpp>
|
#include <CreatureLib/Battling/Library/MiscLibrary.hpp>
|
||||||
|
#include <functional>
|
||||||
#include "../../Library/Evolutions/EvolutionData.hpp"
|
#include "../../Library/Evolutions/EvolutionData.hpp"
|
||||||
#include "../../Library/Moves/MoveData.hpp"
|
#include "../../Library/Moves/MoveData.hpp"
|
||||||
#include "../Pokemon/LearnedMove.hpp"
|
#include "../Pokemon/LearnedMove.hpp"
|
||||||
|
|
|
@ -87,7 +87,7 @@ void RegisterGetter(asIScriptEngine* engine, const char* asType, const char* asD
|
||||||
}
|
}
|
||||||
|
|
||||||
#define REGISTER_GETTER(asType, asDef, cType, cFunc) \
|
#define REGISTER_GETTER(asType, asDef, cType, cFunc) \
|
||||||
RegisterGetter<cType, std::result_of<decltype (&cType::cFunc)(cType)>::type, &cType::cFunc>(engine, asType, asDef);
|
RegisterGetter<cType, decltype(std::declval<cType>().cFunc()), &cType::cFunc>(engine, asType, asDef);
|
||||||
|
|
||||||
#define REGISTER_EXPLICIT_GETTER(asType, asDef, cType, cFunc, returnType) \
|
#define REGISTER_EXPLICIT_GETTER(asType, asDef, cType, cFunc, returnType) \
|
||||||
RegisterGetter<cType, returnType, &cType::cFunc>(engine, asType, asDef);
|
RegisterGetter<cType, returnType, &cType::cFunc>(engine, asType, asDef);
|
||||||
|
|
|
@ -19,10 +19,7 @@ wasm_func_t* Species_GetFormeByHash(WebAssemblyScriptResolver* resolver) {
|
||||||
resolver,
|
resolver,
|
||||||
{[](WebAssemblyScriptResolver*, const CreatureSpecies* species, u32 variant) -> const SpeciesVariant* {
|
{[](WebAssemblyScriptResolver*, const CreatureSpecies* species, u32 variant) -> const SpeciesVariant* {
|
||||||
auto opt = species->TryGetVariant(variant);
|
auto opt = species->TryGetVariant(variant);
|
||||||
if (opt.has_value()) {
|
return opt.has_value() ? opt.value() : nullptr;
|
||||||
return opt.value();
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -211,8 +211,6 @@ private:
|
||||||
|
|
||||||
#define REGISTER_GETTER(name, cType, cFunc, resolver) \
|
#define REGISTER_GETTER(name, cType, cFunc, resolver) \
|
||||||
externs.Insert( \
|
externs.Insert( \
|
||||||
name, \
|
name, WasmHelpers::RegisterGetter<cType, decltype(std::declval<cType>().cFunc()), &cType::cFunc>(resolver));
|
||||||
WasmHelpers::RegisterGetter<cType, std::result_of<decltype (&cType::cFunc)(cType)>::type, &cType::cFunc>( \
|
|
||||||
resolver));
|
|
||||||
|
|
||||||
#endif // PKMNLIB_HELPERFILE_H
|
#endif // PKMNLIB_HELPERFILE_H
|
||||||
|
|
Loading…
Reference in New Issue