Skip to content

Commit

Permalink
treat gfloat identically to gdouble
Browse files Browse the repository at this point in the history
  • Loading branch information
martindemello committed Feb 5, 2023
1 parent 925c19d commit ebc4023
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions generate_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,8 @@ def ml_to_c_type(typ, ns):
return Types('int64', 'Int64_val(%s)', 'gint64', 'int64', '%s')
elif name == 'gdouble':
return Types('float', 'Double_val(%s)', 'gdouble', 'float', '%s')
elif name == 'gfloat':
return Types('float', 'Double_val(%s)', 'gfloat', 'float', '%s')
ns_elem = ns.local_env.get(name, None)
if ns_elem is not None:
if ns_elem.xml.tag == t_enumeration or ns_elem.xml.tag == t_bitfield:
Expand Down Expand Up @@ -573,6 +575,8 @@ def c_to_ml_type(typ, ns):
return Types('bool', '(%s ? Val_true : Val_false)', 'gboolean', 'bool', '%s')
elif name == 'gdouble':
return Types('float', 'caml_copy_double(%s)', 'gdouble', 'float', '%s')
elif name == 'gfloat':
return Types('float', 'caml_copy_double(%s)', 'gfloat', 'float', '%s')
elif name == 'utf8':
if typ.allow_none:
return Types('string option', 'Val_string_option(%s)', 'const char *', 'string option', '%s')
Expand Down

0 comments on commit ebc4023

Please sign in to comment.