aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'lauxlib.h')
-rw-r--r--lauxlib.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/lauxlib.h b/lauxlib.h
index 65714911..9058e262 100644
--- a/lauxlib.h
+++ b/lauxlib.h
@@ -122,6 +122,10 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname,
122** =============================================================== 122** ===============================================================
123*/ 123*/
124 124
125#if !defined(l_likely)
126#define l_likely(x) x
127#endif
128
125 129
126#define luaL_newlibtable(L,l) \ 130#define luaL_newlibtable(L,l) \
127 lua_createtable(L, 0, sizeof(l)/sizeof((l)[0]) - 1) 131 lua_createtable(L, 0, sizeof(l)/sizeof((l)[0]) - 1)
@@ -130,10 +134,10 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname,
130 (luaL_checkversion(L), luaL_newlibtable(L,l), luaL_setfuncs(L,l,0)) 134 (luaL_checkversion(L), luaL_newlibtable(L,l), luaL_setfuncs(L,l,0))
131 135
132#define luaL_argcheck(L, cond,arg,extramsg) \ 136#define luaL_argcheck(L, cond,arg,extramsg) \
133 ((void)((cond) || luaL_argerror(L, (arg), (extramsg)))) 137 ((void)(l_likely(cond) || luaL_argerror(L, (arg), (extramsg))))
134 138
135#define luaL_argexpected(L,cond,arg,tname) \ 139#define luaL_argexpected(L,cond,arg,tname) \
136 ((void)((cond) || luaL_typeerror(L, (arg), (tname)))) 140 ((void)(l_likely(cond) || luaL_typeerror(L, (arg), (tname))))
137 141
138#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) 142#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
139#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) 143#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))