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:
authorAlexey Melnichuk <alexeymelnichuck@gmail.com>2019-02-23 11:25:48 +0300
committerGitHub <noreply@github.com>2019-02-23 11:25:48 +0300
commit52ffc1b40c19332d7ea19eee7f4cd41d423a880a (patch)
tree381f70400514a1fd4b6cdcdfc41589521e1968d0 /src/lua_int64.h
parentffeb14ded654e1237553c5747e60e6dc6154c4c0 (diff)
parent6892f237c5289d3980605c23e8a8b046ecaef345 (diff)
Merge pull request #4 from windirstat/warning-fixupsHEADmaster
Fixed a handful of warnings with Visual C++ and added some defines
Diffstat (limited to 'src/lua_int64.h')
-rw-r--r--src/lua_int64.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lua_int64.h b/src/lua_int64.h
index 6bed1dd..d6f84dd 100644
--- a/src/lua_int64.h
+++ b/src/lua_int64.h
@@ -15,6 +15,10 @@ INT64 lua_checkINT64(lua_State *L, int i);
int atoUINT64(const char* s, UINT64 * pv);
int atoINT64(const char* s, INT64 *pv);
+#ifndef MINGW_HAS_SECURE_API
+#define _ui64toa_s(val, buf, sz, radix) !_ui64toa(val, buf, radix)
+#endif
+
#ifdef __GNUC__
#define CONST_9007199254740992 0x20000000000000LL
#else
@@ -24,7 +28,11 @@ int atoINT64(const char* s, INT64 *pv);
#define lua_pushUINT64(L,n) \
if( n > CONST_9007199254740992 ){ \
char buf[24]; \
- lua_pushstring(L, _ui64toa(n, buf, 10)); \
+ if(_ui64toa_s(n, buf, _countof(buf), 10)){ \
+ lua_pushnil(L);return; \
+ }else{ \
+ lua_pushstring(L, buf); \
+ } \
}else{ \
lua_pushnumber(L, (lua_Number)(__int64)n); \
}