X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fcommon_stub.hpp;h=ae672dada8b3943ae59fdb0947827de3f6df03d0;hb=744e0c89a77d0eb82c64a98d8a8a6860af875653;hp=45aa0caedb58613b858c66f86bd1a974ffc552a1;hpb=eb9a6467cb0860abf57f773a82da526aedc9802a;p=SXSI%2Fxpathcomp.git diff --git a/src/common_stub.hpp b/src/common_stub.hpp index 45aa0ca..ae672da 100644 --- a/src/common_stub.hpp +++ b/src/common_stub.hpp @@ -18,6 +18,13 @@ extern "C" { #define NoAlloc +//Must be used in front of every function that is called from OCaml. +#if _M_IX86 || __i386 +#define ML_BINDING extern "C" __attribute__ ((force_align_arg_pointer)) +#else +#define ML_BINDING extern "C" +#endif + void register_custom_(char* name, size_t size, @@ -58,8 +65,7 @@ sxsi_alloc_custom(void (*finalize)(value) = sxsi_finalize_custom) void sxsi_raise_msg(const char * msg); -extern "C" value sxsi_cpp_init(value unit); - +ML_BINDING value sxsi_cpp_init(value unit); #endif