diff options
Diffstat (limited to 'src/uscxml/plugins/datamodel/prolog')
-rw-r--r-- | src/uscxml/plugins/datamodel/prolog/swi/SWIConfig.h.in | 3 | ||||
-rw-r--r-- | src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp | 6 | ||||
-rw-r--r-- | src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIConfig.h.in b/src/uscxml/plugins/datamodel/prolog/swi/SWIConfig.h.in new file mode 100644 index 0000000..2c0dc72 --- /dev/null +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIConfig.h.in @@ -0,0 +1,3 @@ +#cmakedefine SWI_HAS_PL_NIL +#cmakedefine SWI_HAS_PL_DICT +#cmakedefine SWI_HAS_PL_LIST_PAIR
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp index de94088..b52daa9 100644 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp @@ -408,9 +408,12 @@ Data SWIDataModel::termAsData(PlTerm term) { data.atom = std::string(term); data.type = Data::VERBATIM; break; +#ifdef SWI_HAS_PL_NIL case PL_NIL: data.array.push_back(Data("", Data::VERBATIM)); break; +#endif +#ifdef SWI_HAS_PL_LIST_PAIR case PL_LIST_PAIR: { PlTail tail(term); PlTerm item; @@ -419,6 +422,8 @@ Data SWIDataModel::termAsData(PlTerm term) { } break; } +#endif +#ifdef SWI_HAS_DICT case PL_DICT: { std::string key(term); size_t curlyPos = key.find_first_of("{"); @@ -432,6 +437,7 @@ Data SWIDataModel::termAsData(PlTerm term) { } break; } +#endif default: LOG(ERROR) << "Prolog type " << term.type() << " at '" << (char*)term << "' not supported"; break; diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h index 66a9257..0855d89 100644 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h @@ -24,6 +24,8 @@ #include <list> #include <SWI-cpp.h> +#include "uscxml/SWIConfig.h" + #ifdef BUILD_AS_PLUGINS #include "uscxml/plugins/Plugins.h" #endif |