projects
/
SXSI
/
xpathcomp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use the code alignment macro also in lexindex_stub.cpp
[SXSI/xpathcomp.git]
/
src
/
common_stub.hpp
diff --git
a/src/common_stub.hpp
b/src/common_stub.hpp
index
3e874b7
..
b771f33
100644
(file)
--- a/
src/common_stub.hpp
+++ b/
src/common_stub.hpp
@@
-14,9
+14,14
@@
extern "C" {
}
#include <typeinfo>
#include <cstdio>
}
#include <typeinfo>
#include <cstdio>
+#include <cassert>
#define NoAlloc
#define NoAlloc
+//Must be used in front of every function that is called from OCaml.
+
+#define ML_BINDING extern "C" __attribute__ ((force_align_arg_pointer))
+
void register_custom_(char* name,
size_t size,
void register_custom_(char* name,
size_t size,
@@
-26,6
+31,7
@@
value alloc_custom_(char* name);
template <class X> X& Obj_val(value v)
{
template <class X> X& Obj_val(value v)
{
+ assert(Tag_val(v) == Custom_tag);
return * (X*) Data_custom_val(v);
}
return * (X*) Data_custom_val(v);
}
@@
-56,8
+62,7
@@
sxsi_alloc_custom(void (*finalize)(value) = sxsi_finalize_custom<X>)
void sxsi_raise_msg(const char * msg);
void sxsi_raise_msg(const char * msg);
-extern "C" value sxsi_cpp_init(value unit);
-
+ML_BINDING value sxsi_cpp_init(value unit);
#endif
#endif