Skip to content

Commit 0098701

Browse files
committed
Merge branch 'pr/78' into mingw
2 parents 4afc568 + 3b16921 commit 0098701

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

cmake/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ IF(UNICODE_SUPPORT)
184184
MESSAGE(STATUS "ICU libraries found")
185185
# NOTE icudata appears to be icudt on Windows/MSVC and icudata on others
186186
# dl is included to resolve dlopen and friends symbols
187-
IF(MSVC)
187+
IF(MSVC OR MINGW)
188188
SET(ICU_LIBRARIES icuuc icudt)
189189
ADD_DEBUG_VARIANTS(ICU_LIBRARIES "${ICU_LIBRARIES}" "d")
190190
ADD_DEFINITIONS(-DU_STATIC_IMPLEMENTATION) # required for static ICU

src/ifcconvert/ColladaSerializer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void ColladaSerializer::ColladaExporter::ColladaScene::write() {
223223
closeVisualScene();
224224
closeLibrary();
225225

226-
COLLADASW::Scene scene (mSW, COLLADASW::URI ("#" + scene_id));
226+
COLLADASW::Scene scene (mSW, COLLADASW::URI ("#" + scene_id), COLLADASW::URI ("#" + scene_id));
227227
scene.add();
228228
}
229229
}

src/ifcgeomserver/IfcGeomServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <iostream>
2828
#include <boost/cstdint.hpp>
2929

30-
#if defined(_WIN32) && !defined(__CYGWIN__)
30+
#if defined(_WIN32) && defined(__CYGWIN__)
3131
#define SET_BINARY_STREAMS
3232
#endif
3333
#ifdef SET_BINARY_STREAMS

src/ifcparse/IfcParse.cpp

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ void init_locale() {
5454
locale = _create_locale(LC_NUMERIC, "C");
5555
}
5656
}
57-
#else
57+
//#else
58+
#endif
59+
5860
#ifdef __APPLE__
5961
#include <xlocale.h>
60-
#endif
62+
//#endif
6163
static locale_t locale = (locale_t) 0;
6264
void init_locale() {
6365
if (locale == (locale_t) 0) {
@@ -66,6 +68,28 @@ void init_locale() {
6668
}
6769
#endif
6870

71+
#ifdef __MINGW64__
72+
#include <locale>
73+
#include <sstream>
74+
75+
typedef void* locale_t;
76+
static locale_t locale = (locale_t) 0;
77+
78+
void init_locale() {}
79+
80+
double strtod_l(const char* start, char** end, locale_t loc) {
81+
double d;
82+
std::stringstream ss;
83+
ss.imbue(std::locale::classic());
84+
ss << start;
85+
ss >> d;
86+
size_t nread = ss.tellg();
87+
*end = const_cast<char*>(start) + nread;
88+
return d;
89+
}
90+
#endif
91+
92+
6993
//
7094
// Opens the file, gets the filesize and reads a chunk in memory
7195
//

0 commit comments

Comments
 (0)