moteus / lua-winreg

Lua binary module to Access Microsoft(R) Windows(R) Registry
8 stars 5 forks source link

Fixed a handful of warnings and added LUA_REG_NO_DLL define for embed… #2

Closed assarbad closed 6 years ago

assarbad commented 6 years ago

Fixed a handful of warnings and added LUA_REG_NO_DLL define for embedding the library without DLL.

This fixes a handful of warnings. In particular I am now using the safer _ui64toa_s as opposed to _ui64toa and checking the result. And if it fails nil is pushed instead of the retrieved value.

Furthermore I added a missing argument to the lua_opentablemt declaration in the header.

lua_assert is conditionally defined now. Probably not something that is absolutely needed, but it does offer flexibility.

The define LUA_REG_NO_DLL can be used to hide DllMain and make luaopen_winreg a simple extern function.

_stricmp is being used instead of stricmp again, but a better approach would be to check for whatever old MSC version has been used for some of the builds and #define _stricmp stricmp there (or something along those lines).

The functions that shouldn't be available with LUA_REG_NO_HIVEOPS defined are now conditionally excluded if LUA_REG_NO_HIVEOPS is defined.

assarbad commented 6 years ago

I'll send another one. Found an issue.