summaryrefslogtreecommitdiff
path: root/upb/bindings
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2015-06-04 13:07:43 -0700
committerJosh Haberman <jhaberman@gmail.com>2015-06-04 13:07:43 -0700
commit19a973a85ef5a2eaf1ca59d09ec2d6e972c0cd24 (patch)
tree4c94177912ba195508e488b1b1e8fda853385394 /upb/bindings
parente5bcdc2a3fdc0c38bf09a596efd951d5aaab1148 (diff)
Fixes from Google-internal.
Diffstat (limited to 'upb/bindings')
-rw-r--r--upb/bindings/lua/upb.c2
-rw-r--r--upb/bindings/lua/upb.lua5
2 files changed, 5 insertions, 2 deletions
diff --git a/upb/bindings/lua/upb.c b/upb/bindings/lua/upb.c
index 87b39e6..9629314 100644
--- a/upb/bindings/lua/upb.c
+++ b/upb/bindings/lua/upb.c
@@ -53,7 +53,7 @@ static size_t lupb_msgdef_sizeof();
* compatibility code can help hide the difference. Not too many people still
* use Lua 5.1 but LuaJIT uses the Lua 5.1 API in some ways. */
-#if lua_version_num == 501
+#if LUA_VERSION_NUM == 501
/* taken from lua 5.2's source. */
void *luaL_testudata(lua_State *L, int ud, const char *tname) {
diff --git a/upb/bindings/lua/upb.lua b/upb/bindings/lua/upb.lua
index 4090b37..8b32cff 100644
--- a/upb/bindings/lua/upb.lua
+++ b/upb/bindings/lua/upb.lua
@@ -14,7 +14,10 @@
-- This has to happen *before* the require call, because if the module
-- is loaded RTLD_LOCAL first, a subsequent load as RTLD_GLOBAL won't
-- have the proper effect, at least on some platforms.
-package.loadlib(package.searchpath("upb_c", package.cpath), "*")
+local so = package.searchpath and package.searchpath("upb_c", package.cpath)
+if so then
+ package.loadlib(so, "*")
+end
local upb = require("upb_c")
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback