diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-10-12 11:11:06 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-10-12 11:11:06 (GMT) |
commit | fa90b5749693d9f5817ad1f106334a0877171fd3 (patch) | |
tree | 8d53b5c820590cad54893bc575ef55df38f55d23 /contrib/src/swi-pl | |
parent | c36b123a60278caef5d06e8a7d0b3d338d669c75 (diff) | |
download | uscxml-fa90b5749693d9f5817ad1f106334a0877171fd3.zip uscxml-fa90b5749693d9f5817ad1f106334a0877171fd3.tar.gz uscxml-fa90b5749693d9f5817ad1f106334a0877171fd3.tar.bz2 |
Major work on PROMELA datamodel
Diffstat (limited to 'contrib/src/swi-pl')
-rw-r--r-- | contrib/src/swi-pl/SWI-cpp.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/contrib/src/swi-pl/SWI-cpp.h b/contrib/src/swi-pl/SWI-cpp.h index d32a052..22c02a8 100644 --- a/contrib/src/swi-pl/SWI-cpp.h +++ b/contrib/src/swi-pl/SWI-cpp.h @@ -25,6 +25,12 @@ #ifndef _SWI_CPP_H #define _SWI_CPP_H +#ifdef SWI_REINTERPRET_FOREIGN +# define PL_FOREIGN_TO_FUNCTION(f) reinterpret_cast<void (*)()>(f) +#else +# define PL_FOREIGN_TO_FUNCTION(f) (void *)f +#endif + #include <SWI-Prolog.h> #include <string.h> #ifndef __APPLE__ @@ -466,23 +472,23 @@ public: PlRegister(const char *module, const char *name, int arity, foreign_t (f)(term_t t0, int a, control_t ctx)) - { PL_register_foreign_in_module(module, name, arity, (void *)f, PL_FA_VARARGS); + { PL_register_foreign_in_module(module, name, arity, PL_FOREIGN_TO_FUNCTION(f), PL_FA_VARARGS); } PlRegister(const char *module, const char *name, foreign_t (*f)(PlTerm a0)) - { PL_register_foreign_in_module(module, name, 1, (void *)f, 0); + { PL_register_foreign_in_module(module, name, 1, PL_FOREIGN_TO_FUNCTION(f), 0); } PlRegister(const char *module, const char *name, foreign_t (*f)(PlTerm a0, PlTerm a1)) - { PL_register_foreign_in_module(module, name, 2, (void *)f, 0); + { PL_register_foreign_in_module(module, name, 2, PL_FOREIGN_TO_FUNCTION(f), 0); } PlRegister(const char *module, const char *name, foreign_t (*f)(PlTerm a0, PlTerm a1, PlTerm a2)) - { PL_register_foreign_in_module(module, name, 3, (void *)f, 0); + { PL_register_foreign_in_module(module, name, 3, PL_FOREIGN_TO_FUNCTION(f), 0); } // for non-deterministic calls PlRegister(const char *module, const char *name, int arity, foreign_t (f)(term_t t0, int a, control_t ctx), short flags) - { PL_register_foreign_in_module(module, name, arity, (void *)f, flags); + { PL_register_foreign_in_module(module, name, arity, PL_FOREIGN_TO_FUNCTION(f), flags); } }; |