Commits

Anonymous committed 76e56f9

of_bigarray: allowing one to create cstruct on bigarray of size greater than sizeof structure

Comments (0)

Files changed (1)

lib/cstruct_codegen.ml

 
   ; str_ ""
   ; str_ "let of_bigarray t ="
-  ; str_ "  if Bigarray.Array1.dim t <> sizeof"
-  ; str_ "  then failwith \"%s.of_bigarray: size doesn't match\""
+  ; str_ "  if Bigarray.Array1.dim t < sizeof"
+  ; str_ "  then failwith \"%s.of_bigarray: structure doesn't fit bigarray\""
                   (String.capitalize csname)
   ; str_ "  else t"