I have a c++ macro that looks like this
#define lua_tpushstring(L,n,f) \
(lua_pushstring(L, n), lua_pushstring(L, f))
I want to modify it so it works like this
#define lua_tpush(TYPE,L,n,f) \
(lua_pushstring(L, n), lua_pushTYPE(L, f))
lua_tpush(boolean, L, "a", true);
lua_tpush(string, L, "a", "");
What is the simple change?
Token concatenation:
#define lua_tpush(TYPE,L,n,f) (lua_pushstring(L, n), lua_push##TYPE(L, f))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With