Skip to content

Commit

Permalink
add contant: luahs.UINT_MAX
Browse files Browse the repository at this point in the history
  • Loading branch information
starius committed Jun 13, 2016
1 parent 56bb150 commit beda479
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/constants_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe("constants", function()
assert.equal(4, luahs.cpu_features.HS_CPU_FEATURES_AVX2)
assert.equal(2, luahs.cpu_tuning.HS_TUNE_FAMILY_IVB)
assert.equal(-1, luahs.HS_OFFSET_PAST_HORIZON)
assert.truthy(luahs.UINT_MAX > 0)
end)

it("decodes constants", function()
Expand Down
4 changes: 4 additions & 0 deletions src/luahs/constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright (C) 2016 Boris Nagaev
// See the LICENSE file for terms of use.

#include <limits.h>

#include "luahs.h"

typedef struct luahs_Constant {
Expand Down Expand Up @@ -160,4 +162,6 @@ void luahs_addConstants(lua_State* L) {
lua_setfield(L, -2, "decodeError");
lua_pushinteger(L, HS_OFFSET_PAST_HORIZON);
lua_setfield(L, -2, "HS_OFFSET_PAST_HORIZON");
lua_pushinteger(L, UINT_MAX);
lua_setfield(L, -2, "UINT_MAX");
}

0 comments on commit beda479

Please sign in to comment.