From 6d0622c0bb8f0e52589c82252f2cc1eb847ad9bf Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Sat, 12 Jan 2013 16:22:45 +0100 Subject: Started to fix Windows compilation issues --- .gitignore | 2 ++ config.h.in | 3 +++ contrib/cmake/FunctionExists.cmake | 2 ++ contrib/cmake/HeaderExists.cmake | 2 ++ contrib/local/compress_and_upload_deps.sh | 14 ++++++++++---- src/uscxml/URL.cpp | 4 ++++ src/uscxml/concurrency/tinythread.cpp | 7 +++---- src/uscxml/concurrency/tinythread.h | 2 +- 8 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 contrib/cmake/FunctionExists.cmake create mode 100644 contrib/cmake/HeaderExists.cmake diff --git a/.gitignore b/.gitignore index 18c09fc..402fed2 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ contrib/prebuilt/android* package/linux* package/darwin* package/windows* + +*.tgz diff --git a/config.h.in b/config.h.in index 4bd5a5a..333b8a0 100644 --- a/config.h.in +++ b/config.h.in @@ -56,4 +56,7 @@ #cmakedefine SWI_FOUND #cmakedefine OPENSCENEGRAPH_FOUND +/** Header files we found */ +#cmakedefine HAS_UNISTD_H + #endif \ No newline at end of file diff --git a/contrib/cmake/FunctionExists.cmake b/contrib/cmake/FunctionExists.cmake new file mode 100644 index 0000000..d2877a1 --- /dev/null +++ b/contrib/cmake/FunctionExists.cmake @@ -0,0 +1,2 @@ +include(CheckFunctionExists) +CHECK_FUNCTION_EXISTS(strndup HAS_STRNDUP) diff --git a/contrib/cmake/HeaderExists.cmake b/contrib/cmake/HeaderExists.cmake new file mode 100644 index 0000000..09eabbe --- /dev/null +++ b/contrib/cmake/HeaderExists.cmake @@ -0,0 +1,2 @@ +include(CheckIncludeFile) +CHECK_INCLUDE_FILE(unistd.h HAS_UNISTD_H) diff --git a/contrib/local/compress_and_upload_deps.sh b/contrib/local/compress_and_upload_deps.sh index 641219d..9f64118 100755 --- a/contrib/local/compress_and_upload_deps.sh +++ b/contrib/local/compress_and_upload_deps.sh @@ -22,11 +22,17 @@ if [ ! -d $1 ]; then exit fi -PLATFORM=`basename $1` VERSION=$2 cd ../prebuilt -tar cvzf uscxml-prebuilt-${PLATFORM}.tgz ${PLATFORM} -scp uscxml-prebuilt-${PLATFORM}.tgz ${UMUNDO_PREBUILT_HOST}/${VERSION} -rm uscxml-prebuilt-${PLATFORM}.tgz \ No newline at end of file +PLATFORMS=`find . -maxdepth 1 -type d -regex ./[^\.].*` +for FILE in ${PLATFORMS}; do + PLATFORM=`basename $FILE` + if [ "$PLATFORM" != "include" ]; then + echo $FILE + tar cvzf uscxml-prebuilt-${PLATFORM}.tgz ${FILE} + scp uscxml-prebuilt-${PLATFORM}.tgz ${UMUNDO_PREBUILT_HOST}/${VERSION} + rm uscxml-prebuilt-${PLATFORM}.tgz + fi +done \ No newline at end of file diff --git a/src/uscxml/URL.cpp b/src/uscxml/URL.cpp index 4461308..592c0c6 100644 --- a/src/uscxml/URL.cpp +++ b/src/uscxml/URL.cpp @@ -17,8 +17,12 @@ #include "uscxml/Common.h" #include "URL.h" +#include "uscxml/config.h" + #include // mkstemp +#ifdef HAS_UNISTD_H #include // mkstemp legacy +#endif namespace uscxml { diff --git a/src/uscxml/concurrency/tinythread.cpp b/src/uscxml/concurrency/tinythread.cpp index 56363b7..4a99259 100644 --- a/src/uscxml/concurrency/tinythread.cpp +++ b/src/uscxml/concurrency/tinythread.cpp @@ -31,15 +31,14 @@ freely, subject to the following restrictions: #include #endif - namespace tthread { -uint64_t timeStamp() { - uint64_t time = 0; +unsigned long long int timeStamp() { + unsigned long long int time = 0; #ifdef WIN32 FILETIME tv; GetSystemTimeAsFileTime(&tv); - time = (((uint64_t) tv.dwHighDateTime) << 32) + tv.dwLowDateTime; + time = (((unsigned long long int) tv.dwHighDateTime) << 32) + tv.dwLowDateTime; time /= 10000; #else struct timeval tv; diff --git a/src/uscxml/concurrency/tinythread.h b/src/uscxml/concurrency/tinythread.h index 537cc04..aa8335b 100644 --- a/src/uscxml/concurrency/tinythread.h +++ b/src/uscxml/concurrency/tinythread.h @@ -152,7 +152,7 @@ freely, subject to the following restrictions: /// the std::mutex class. namespace tthread { -uint64_t timeStamp(); +unsigned long long int timeStamp(); /// Mutex class. /// This is a mutual exclusion object for synchronizing access to shared -- cgit v0.12