Browse Source

Fix FFI C bindings when GCC plugin uses Lua 5.3

Peter Colberg 2 years ago
parent
commit
6045919b38
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      hdf5/C.lua.in

+ 3
- 1
hdf5/C.lua.in View File

@@ -44,7 +44,9 @@ local handles = {
44 44
 -- Formats the given declaration as a string of C code.
45 45
 local function format(decl, id)
46 46
   if decl:class() == "constant" then
47
-    return "static const int " .. id .. " = " .. decl:value()
47
+    local value = math.floor(decl:value())
48
+    assert(value == decl:value())
49
+    return "static const int " .. id .. " = " .. value
48 50
   end
49 51
   return cdecl.declare(decl, function(node)
50 52
     if node == decl then return id end

Loading…
Cancel
Save