summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-10-08 00:24:59 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-10-08 00:24:59 (GMT)
commit8daf2ea0a7192e556cc059c2220469ea22155380 (patch)
tree20494f647dad5dbea56f9c0a5b7241d1e9e3c7f7
parent3a8a7a56ab604c3cca49792973c8b0c6d8a089b9 (diff)
downloaduscxml-8daf2ea0a7192e556cc059c2220469ea22155380.zip
uscxml-8daf2ea0a7192e556cc059c2220469ea22155380.tar.gz
uscxml-8daf2ea0a7192e556cc059c2220469ea22155380.tar.bz2
More fixes for MSVC
-rw-r--r--CMakeLists.txt5
-rw-r--r--src/uscxml/Common.h2
-rw-r--r--src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp3
-rw-r--r--test/CMakeLists.txt13
-rw-r--r--test/src/test-w3c.cpp24
5 files changed, 16 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 077368a..b1d5bcf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -688,6 +688,9 @@ SET(USCXML_LANGUAGE_BINDINGS)
add_subdirectory(src/uscxml)
include_directories(${USCXML_INCLUDE_DIRS})
+if (WIN32)
+ list(APPEND USCXML_FILES "${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c")
+endif()
if (UNIX AND NOT APPLE)
list (APPEND USCXML_CORE_LIBS "rt")
@@ -757,7 +760,7 @@ if (NOT CMAKE_CROSSCOMPILING)
endif()
if (NOT CMAKE_CROSSCOMPILING)
- add_executable(uscxml-browser apps/uscxml-browser.cpp ${PROJECT_SOURCE_DIR}/contrib/src/getopt/XGetopt.cpp)
+ add_executable(uscxml-browser apps/uscxml-browser.cpp)
target_link_libraries(uscxml-browser uscxml)
set_target_properties(uscxml-browser PROPERTIES FOLDER "Apps")
install_executable(TARGETS uscxml-browser COMPONENT tools)
diff --git a/src/uscxml/Common.h b/src/uscxml/Common.h
index f73e8bd..09785be 100644
--- a/src/uscxml/Common.h
+++ b/src/uscxml/Common.h
@@ -5,7 +5,9 @@
#include <winsock2.h>
// see http://stackoverflow.com/questions/1372480/c-redefinition-header-files
#define _WINSOCKAPI_ // stops windows.h including winsock.h
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
#else
#include <sys/socket.h>
#endif
diff --git a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp
index ee74a5f..c155644 100644
--- a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp
+++ b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp
@@ -211,7 +211,7 @@ Data XPathDataModel::getStringAsData(const std::string& content) {
switch (result.type()) {
case ANY:
break;
- case BOOL:
+ case Arabica::XPath::BOOL:
ss << result.asBool();
break;
case NUMBER:
@@ -225,7 +225,6 @@ Data XPathDataModel::getStringAsData(const std::string& content) {
for (int i = 0; i < ns.size(); i++) {
ss << ns[i];
}
- ss << result;
break;
}
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 51fe962..4fba8a5 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -68,11 +68,12 @@ if (NOT WIN32)
add_test(test-stress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-stress ${CMAKE_SOURCE_DIR}/test/samples/w3c)
set_target_properties(test-stress PROPERTIES FOLDER "Tests")
- add_executable(test-instant-messaging src/test-instant-messaging.cpp)
- target_link_libraries(test-instant-messaging uscxml)
- add_test(test-instant-messaging ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-instant-messaging)
- set_target_properties(test-instant-messaging PROPERTIES FOLDER "Tests")
-
+ if (LIBPURPLE_FOUND)
+ add_executable(test-instant-messaging src/test-instant-messaging.cpp)
+ target_link_libraries(test-instant-messaging uscxml)
+ add_test(test-instant-messaging ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-instant-messaging)
+ set_target_properties(test-instant-messaging PROPERTIES FOLDER "Tests")
+ endif()
endif()
add_executable(test-url src/test-url.cpp)
@@ -113,7 +114,7 @@ set_target_properties(scxml-test-framework-client PROPERTIES FOLDER "Tests")
# add_test(test-curl-multi-api ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-completion)
# set_target_properties(test-curl-multi-api PROPERTIES FOLDER "Tests")
- add_executable(test-w3c src/test-w3c.cpp ${PROJECT_SOURCE_DIR}/contrib/src/getopt/XGetopt.cpp)
+ add_executable(test-w3c src/test-w3c.cpp)
target_link_libraries(test-w3c uscxml)
set_target_properties(test-w3c PROPERTIES FOLDER "Tests")
diff --git a/test/src/test-w3c.cpp b/test/src/test-w3c.cpp
index e89ab2c..94cafa4 100644
--- a/test/src/test-w3c.cpp
+++ b/test/src/test-w3c.cpp
@@ -123,32 +123,12 @@ int main(int argc, char** argv) {
google::InitGoogleLogging(argv[0]);
google::LogToStderr();
-#ifndef _WIN32
- opterr = 0;
-#endif
- int option;
- while ((option = getopt(argc, argv, "vl:p:")) != -1) {
- switch(option) {
- case 'l':
- google::InitGoogleLogging(optarg);
- break;
- case 'p':
- uscxml::Factory::pluginPath = optarg;
- break;
- case '?':
- break;
- default:
- printUsageAndExit();
- break;
- }
- }
-
// for (int i = 0; i < argc; i++)
// std::cout << argv[i] << std::endl;
// std::cout << optind << std::endl;
- LOG(INFO) << "Processing " << argv[optind];
- Interpreter interpreter = Interpreter::fromURI(argv[optind]);
+ LOG(INFO) << "Processing " << argv[1];
+ Interpreter interpreter = Interpreter::fromURI(argv[1]);
if (interpreter) {
// interpreter.setCmdLineOptions(argc, argv);
// interpreter->setCapabilities(Interpreter::CAN_NOTHING);