Oh boy, new compatibility files...!

This commit is contained in:
ThePhD 2016-10-15 18:36:30 -04:00
parent ebc8d0ffc3
commit 391f29afb1
3 changed files with 71 additions and 2 deletions

View File

@ -20,8 +20,8 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script.
// Generated 2016-10-15 21:59:41.897573 UTC
// This header was generated with sol v2.14.10 (revision f3fbd24)
// Generated 2016-10-15 22:36:09.229006 UTC
// This header was generated with sol v2.14.10 (revision ebc8d0f)
// https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_HPP
@ -2138,6 +2138,31 @@ int luaL_fileresult(lua_State *L, int stat, const char *fname);
#ifndef SOL_5_X_X_INL
#define SOL_5_X_X_INL
// beginning of sol/compatibility/5.2.0.h
#ifndef SOL_5_2_0_H
#define SOL_5_2_0_H
#if SOL_LUA_VERSION < 503
int lua_isinteger(lua_State* L, int idx) {
if (lua_type(L, idx) != LUA_TNUMBER)
return 0;
// This is a very slipshod way to do the testing
// but lua_totingerx doesn't play ball nicely
// on older versions...
lua_Number n = lua_tonumber(L, idx);
lua_Integer i = lua_tointeger(L, idx);
if (i != n)
return 0;
// it's DEFINITELY an integer
return 1;
}
#endif // SOL_LUA_VERSION == 502
#endif // SOL_5_2_0_H
// end of sol/compatibility/5.2.0.h
#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM == 501
#include <errno.h>

43
sol/compatibility/5.2.0.h Normal file
View File

@ -0,0 +1,43 @@
// The MIT License (MIT)
// Copyright (c) 2013-2016 Rapptz, ThePhD and contributors
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef SOL_5_2_0_H
#define SOL_5_2_0_H
#include "version.hpp"
#if SOL_LUA_VERSION < 503
int lua_isinteger(lua_State* L, int idx) {
if (lua_type(L, idx) != LUA_TNUMBER)
return 0;
// This is a very slipshod way to do the testing
// but lua_totingerx doesn't play ball nicely
// on older versions...
lua_Number n = lua_tonumber(L, idx);
lua_Integer i = lua_tointeger(L, idx);
if (i != n)
return 0;
// it's DEFINITELY an integer
return 1;
}
#endif // SOL_LUA_VERSION == 502
#endif // SOL_5_2_0_H

View File

@ -23,6 +23,7 @@
#define SOL_5_X_X_INL
#include "version.hpp"
#include "5.2.0.h"
#include "5.1.0.h"
#include "5.0.0.h"
#include "5.x.x.h"