diff options
author | moteus <mimir@newmail.ru> | 2012-09-05 15:30:12 +0400 |
---|---|---|
committer | moteus <mimir@newmail.ru> | 2012-09-05 15:30:12 +0400 |
commit | aa8939f91a1846a8ae94c96e30eecd93e81e9ab2 (patch) | |
tree | c780ca42253a21cd56845a21f6f68f3e2fd681b5 /src/luawinmacro.h |
Fork from luaforge.net
Diffstat (limited to 'src/luawinmacro.h')
-rw-r--r-- | src/luawinmacro.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/luawinmacro.h b/src/luawinmacro.h new file mode 100644 index 0000000..fc51615 --- /dev/null +++ b/src/luawinmacro.h @@ -0,0 +1,20 @@ +#ifndef __LUAMACWIN_H__
+#define __LUAMACWIN_H__
+/* Lua useful macros for Windows */
+
+#define lua_toLONG(L,i) ((LONG)lua_tointeger(L,(i)))
+#define lua_toDWORD(L,i) ((DWORD)lua_tonumber(L,(i)))
+#define lua_toWORD(L,i) ((WORD)lua_tointeger(L,(i)))
+#define lua_checkLONG(L,i) ((LONG)luaL_checkinteger(L,(i)))
+#define lua_checkDWORD(L,i) ((DWORD)luaL_checknumber(L,(i)))
+#define lua_checkUINT(L,i) ((UINT)luaL_checknumber(L,(i)))
+#define lua_checkWORD(L,i) ((WORD)luaL_checkinteger(L,(i)))
+#define lua_checkSHORT(L,i) ((SHORT)luaL_checkinteger(L,(i)))
+#define lua_optUINT(L,i,d) ((UINT)luaL_optnumber(L,(i),(d)))
+#define lua_optDWORD(L,i,d) ((DWORD)luaL_optnumber(L,(i),(d)))
+#define lua_optSHORT(L,i,d) ((SHORT)luaL_optinteger(L,(i),(d)))
+#define lua_optWORD(L,i,d) ((WORD)luaL_optinteger(L,(i),(d)))
+
+#endif //__LUAMACWIN_H__
+
+
|