From 04ef9efcdf1de5de7fc17cdc3aa6411757df9dd8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 12 Jul 2014 19:03:01 +0300 Subject: Simplify assignFunction and add two args function assignFunction2. --- src/render/mglfunctions.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/render/mglfunctions.h') diff --git a/src/render/mglfunctions.h b/src/render/mglfunctions.h index bfddb5a2c..569f4aac4 100644 --- a/src/render/mglfunctions.h +++ b/src/render/mglfunctions.h @@ -36,7 +36,16 @@ reinterpret_cast(name)) #endif -#define assignFunction(func, name) \ +#define assignFunction(func) \ + { \ + m##func = reinterpret_cast(getFunction(#func)); \ + if (m##func == nullptr) \ + logger->log("function not found: " #func); \ + else \ + logger->log("assigned function: " #func); \ + } + +#define assignFunction2(func, name) \ { \ m##func = reinterpret_cast(getFunction(name)); \ if (m##func == nullptr) \ @@ -45,7 +54,7 @@ logger->log(std::string("assigned function: ") + name); \ } -#define assignFunctionEmu(func, name) \ +#define assignFunctionEmu2(func, name) \ { \ m##func = reinterpret_cast(getFunction(name)); \ if (m##func == nullptr) \ -- cgit v1.2.3-70-g09d2