summaryrefslogtreecommitdiff
path: root/libs/liblua/src/lauxlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/liblua/src/lauxlib.h')
-rw-r--r--libs/liblua/src/lauxlib.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/libs/liblua/src/lauxlib.h b/libs/liblua/src/lauxlib.h
index 59fef6af13..72f70e7d9d 100644
--- a/libs/liblua/src/lauxlib.h
+++ b/libs/liblua/src/lauxlib.h
@@ -12,6 +12,7 @@
#include <stddef.h>
#include <stdio.h>
+#include "luaconf.h"
#include "lua.h"
@@ -130,10 +131,10 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname,
(luaL_checkversion(L), luaL_newlibtable(L,l), luaL_setfuncs(L,l,0))
#define luaL_argcheck(L, cond,arg,extramsg) \
- ((void)((cond) || luaL_argerror(L, (arg), (extramsg))))
+ ((void)(luai_likely(cond) || luaL_argerror(L, (arg), (extramsg))))
#define luaL_argexpected(L,cond,arg,tname) \
- ((void)((cond) || luaL_typeerror(L, (arg), (tname))))
+ ((void)(luai_likely(cond) || luaL_typeerror(L, (arg), (tname))))
#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))
#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))
@@ -158,6 +159,22 @@ LUALIB_API void (luaL_requiref) (lua_State *L, const char *modname,
/*
+** Internal assertions for in-house debugging
+*/
+#if !defined(lua_assert)
+
+#if defined LUAI_ASSERT
+ #include <assert.h>
+ #define lua_assert(c) assert(c)
+#else
+ #define lua_assert(c) ((void)0)
+#endif
+
+#endif
+
+
+
+/*
** {======================================================
** Generic Buffer manipulation
** =======================================================