Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/lua-winreg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoteus <mimir@newmail.ru>2012-09-05 15:30:12 +0400
committermoteus <mimir@newmail.ru>2012-09-05 15:30:12 +0400
commitaa8939f91a1846a8ae94c96e30eecd93e81e9ab2 (patch)
treec780ca42253a21cd56845a21f6f68f3e2fd681b5 /src/luawin_dllerror.h
Fork from luaforge.net
Diffstat (limited to 'src/luawin_dllerror.h')
-rw-r--r--src/luawin_dllerror.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/luawin_dllerror.h b/src/luawin_dllerror.h
new file mode 100644
index 0000000..fd1c26e
--- /dev/null
+++ b/src/luawin_dllerror.h
@@ -0,0 +1,31 @@
+#ifndef __LUAWIN_DLLERROR_H__
+#define __LUAWIN_DLLERROR_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <windows.h>
+#include <lua.h>
+
+
+#ifdef NDEBUG
+void lua_dllerror(lua_State *L, DWORD dwErr);
+# define LUA_LAST_DLL_ERROR_ASSERT(L,exp)((exp)||(lua_dllerror(L, 0),0))
+# define LUA_CHECK_DLL_ERROR(L, code) ((void)((code)&&(lua_dllerror(L, (code)),0)))
+# define LUA_CHECK_LAST_DLL_ERROR(L) lua_dllerror(L, 0)
+#else
+void lua_dllerror(lua_State *L, DWORD dwErr, const char * exp, const char * file, int line);
+# define LUA_LAST_DLL_ERROR_ASSERT(L,exp)((exp)||(lua_dllerror(L, 0, #exp, __FILE__, __LINE__),0))
+# define LUA_CHECK_DLL_ERROR(L, code) ((void)((code)&&(lua_dllerror(L, (code), NULL, __FILE__, __LINE__),0)))
+# define LUA_CHECK_LAST_DLL_ERROR(L) lua_dllerror(L, 0, NULL, __FILE__, __LINE__)
+#endif
+#define LUA_LAST_DLL_ERROR_ASSERT_RETURN_OBJECT(L,exp) LUA_CHECK_RETURN_OBJECT(L, LUA_LAST_DLL_ERROR_ASSERT(L,exp))
+#define LUA_LAST_DLL_ERROR_ASSERT_LEAVE_OBJECT(L,exp) LUA_CHECK_LEAVE_OBJECT(L, LUA_LAST_DLL_ERROR_ASSERT(L,exp))
+#define LUA_LAST_DLL_ERROR_ASSERT_PUSHBOOL(L,exp) lua_pushboolean(L, LUA_LAST_DLL_ERROR_ASSERT(L, exp)?1:0)
+#define LUA_LAST_DLL_ERROR_ASSERT_RETBOOL(L,exp) return(LUA_LAST_DLL_ERROR_ASSERT_PUSHBOOL(L,exp), 1)
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif //__LUAWIN_DLLERROR_H__ \ No newline at end of file