diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index da61955508..9b314c259a 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -184,7 +184,7 @@ IF(UNICODE_SUPPORT) MESSAGE(STATUS "ICU libraries found") # NOTE icudata appears to be icudt on Windows/MSVC and icudata on others # dl is included to resolve dlopen and friends symbols - IF(MSVC) + IF(MSVC OR MINGW) SET(ICU_LIBRARIES icuuc icudt) ADD_DEBUG_VARIANTS(ICU_LIBRARIES "${ICU_LIBRARIES}" "d") ADD_DEFINITIONS(-DU_STATIC_IMPLEMENTATION) # required for static ICU diff --git a/src/ifcconvert/ColladaSerializer.cpp b/src/ifcconvert/ColladaSerializer.cpp index c8272aba64..1bf31a3153 100644 --- a/src/ifcconvert/ColladaSerializer.cpp +++ b/src/ifcconvert/ColladaSerializer.cpp @@ -223,7 +223,7 @@ void ColladaSerializer::ColladaExporter::ColladaScene::write() { closeVisualScene(); closeLibrary(); - COLLADASW::Scene scene (mSW, COLLADASW::URI ("#" + scene_id)); + COLLADASW::Scene scene (mSW, COLLADASW::URI ("#" + scene_id), COLLADASW::URI ("#" + scene_id)); scene.add(); } } diff --git a/src/ifcgeomserver/IfcGeomServer.cpp b/src/ifcgeomserver/IfcGeomServer.cpp index 8a81efbb36..83c1febe9d 100644 --- a/src/ifcgeomserver/IfcGeomServer.cpp +++ b/src/ifcgeomserver/IfcGeomServer.cpp @@ -27,7 +27,7 @@ #include #include -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && defined(__CYGWIN__) #define SET_BINARY_STREAMS #endif #ifdef SET_BINARY_STREAMS diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index bffdfcb10a..fc23aa8351 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -54,10 +54,12 @@ void init_locale() { locale = _create_locale(LC_NUMERIC, "C"); } } -#else +//#else +#endif + #ifdef __APPLE__ #include -#endif +//#endif static locale_t locale = (locale_t) 0; void init_locale() { if (locale == (locale_t) 0) { @@ -66,6 +68,28 @@ void init_locale() { } #endif +#ifdef __MINGW64__ +#include +#include + +typedef void* locale_t; +static locale_t locale = (locale_t) 0; + +void init_locale() {} + +double strtod_l(const char* start, char** end, locale_t loc) { + double d; + std::stringstream ss; + ss.imbue(std::locale::classic()); + ss << start; + ss >> d; + size_t nread = ss.tellg(); + *end = const_cast(start) + nread; + return d; +} +#endif + + // // Opens the file, gets the filesize and reads a chunk in memory //