libxl: ocaml: fix the handling of enums in the bindings generator
authorRob Hoes <rob.hoes@citrix.com>
Wed, 6 Nov 2013 17:49:52 +0000 (17:49 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 11 Nov 2013 15:39:39 +0000 (15:39 +0000)
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: David Scott <dave.scott@eu.citrix.com>
tools/ocaml/libs/xl/genwrap.py

index 4206c87c27770b29e1f01fe3af4d33ad185a0f43..5a3fd8d1eb2c44e027651ccce5abf82486e9da07 100644 (file)
@@ -340,7 +340,7 @@ def ocaml_Val(ty, o, c, indent="", parent = None):
         n = 0
         s += "switch(%s) {\n" % c
         for e in ty.values:
-            s += "    case %s: %s = Int_val(%d); break;\n" % (e.name, o, n)
+            s += "    case %s: %s = Val_int(%d); break;\n" % (e.name, o, n)
             n += 1
         s += "    default: failwith_xl(ERROR_FAIL, \"cannot convert value from %s\"); break;\n" % ty.typename
         s += "}"