summaryrefslogtreecommitdiff
path: root/otherlibs/bigarray/bigarray.h
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2014-03-31 17:58:53 +0000
committerDamien Doligez <damien.doligez-inria.fr>2014-03-31 17:58:53 +0000
commit8643356b8542e0dcab358716f1e04d47b08b1a6d (patch)
treee10cc5a03f7ead69a2d4ed563cbd021df5770ef2 /otherlibs/bigarray/bigarray.h
parentcd1bf4b9fc898cee2f4886ed18ddf6271ec522e8 (diff)
parent989ac0b2635443b9c0f183ee6343b663c854f4ea (diff)
downloadocaml-ephemeron.tar.gz
merge with trunk at rev 14512ephemeron
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ephemeron@14514 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/bigarray/bigarray.h')
-rw-r--r--otherlibs/bigarray/bigarray.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/otherlibs/bigarray/bigarray.h b/otherlibs/bigarray/bigarray.h
index 26fdcc9ed1..c10e20cfb3 100644
--- a/otherlibs/bigarray/bigarray.h
+++ b/otherlibs/bigarray/bigarray.h
@@ -44,15 +44,25 @@ enum caml_ba_kind {
CAML_BA_NATIVE_INT, /* Platform-native long integers (32 or 64 bits) */
CAML_BA_COMPLEX32, /* Single-precision complex */
CAML_BA_COMPLEX64, /* Double-precision complex */
+ CAML_BA_CHAR, /* Characters */
CAML_BA_KIND_MASK = 0xFF /* Mask for kind in flags field */
};
+#define Caml_ba_kind_val(v) Int_val(v)
+
+#define Val_caml_ba_kind(k) Val_int(k)
+
enum caml_ba_layout {
CAML_BA_C_LAYOUT = 0, /* Row major, indices start at 0 */
CAML_BA_FORTRAN_LAYOUT = 0x100, /* Column major, indices start at 1 */
- CAML_BA_LAYOUT_MASK = 0x100 /* Mask for layout in flags field */
+ CAML_BA_LAYOUT_MASK = 0x100, /* Mask for layout in flags field */
+ CAML_BA_LAYOUT_SHIFT = 8 /* Bit offset of layout flag */
};
+#define Caml_ba_layout_val(v) (Int_val(v) << CAML_BA_LAYOUT_SHIFT)
+
+#define Val_caml_ba_layout(l) Val_int(l >> CAML_BA_LAYOUT_SHIFT)
+
enum caml_ba_managed {
CAML_BA_EXTERNAL = 0, /* Data is not allocated by OCaml */
CAML_BA_MANAGED = 0x200, /* Data is allocated by OCaml */