mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Merge branch 'master' into dynamic_lib_fixes
# Conflicts: # cmake/CMakeLists.txt
This commit is contained in:
@@ -195,7 +195,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
|
||||
@@ -328,7 +328,12 @@ IF(MSVC)
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
ElSE()
|
||||
ADD_DEFINITIONS(-fPIC -Wno-non-virtual-dtor -Wall -Wextra)
|
||||
IF(WIN32)
|
||||
# -fPIC is not relevant on Windows and create pointless warnings
|
||||
ADD_DEFINITIONS(-Wno-non-virtual-dtor -Wall -Wextra)
|
||||
ELSE()
|
||||
ADD_DEFINITIONS(-fPIC -Wno-non-virtual-dtor -Wall -Wextra)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${OCC_INCLUDE_DIR} ${OPENCOLLADA_INCLUDE_DIRS}
|
||||
|
||||
@@ -27,9 +27,12 @@
|
||||
#include <iostream>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
// NB: Streams are only re-opened as binary when compiled with MSVC currently.
|
||||
// It is unclear what the correct behaviour would be compiled with e.g MinGW
|
||||
#if defined(_MSC_VER)
|
||||
#define SET_BINARY_STREAMS
|
||||
#endif
|
||||
|
||||
#ifdef SET_BINARY_STREAMS
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
@@ -217,7 +220,7 @@ protected:
|
||||
std::vector<int32_t> indices;
|
||||
const std::vector<int>& faces = geom->geometry().faces();
|
||||
indices.reserve(faces.size());
|
||||
for (std::vector<int>::const_iterator it = indices.begin(); it != indices.end(); ++it) {
|
||||
for (std::vector<int>::const_iterator it = faces.begin(); it != faces.end(); ++it) {
|
||||
indices.push_back(*it);
|
||||
}
|
||||
swrite(s, std::string((char*) indices.data(), indices.size() * sizeof(int32_t)));
|
||||
@@ -269,7 +272,7 @@ protected:
|
||||
swrite(s, std::string((char*) material_indices.data(), material_indices.size() * sizeof(int32_t))); }
|
||||
}
|
||||
public:
|
||||
Entity(const IfcGeom::TriangulationElement<float>* geom) : Command(ENTITY), geom(geom), append_line_data(true) {};
|
||||
Entity(const IfcGeom::TriangulationElement<float>* geom) : Command(ENTITY), geom(geom), append_line_data(false) {};
|
||||
};
|
||||
|
||||
class Next : public Command {
|
||||
@@ -359,7 +362,7 @@ int main () {
|
||||
settings.set(IfcGeom::IteratorSettings::USE_WORLD_COORDS, false);
|
||||
settings.set(IfcGeom::IteratorSettings::WELD_VERTICES, false);
|
||||
settings.set(IfcGeom::IteratorSettings::CONVERT_BACK_UNITS, true);
|
||||
settings.set(IfcGeom::IteratorSettings::INCLUDE_CURVES, true);
|
||||
// settings.set(IfcGeom::IteratorSettings::INCLUDE_CURVES, true);
|
||||
|
||||
std::vector< std::pair<uint32_t, uint32_t> >::const_iterator it = setting_pairs.begin();
|
||||
for (; it != setting_pairs.end(); ++it) {
|
||||
|
||||
@@ -47,23 +47,53 @@ using namespace IfcParse;
|
||||
// strtod_l() is used and a reference to the "C" locale is obtained here. The alternative is
|
||||
// to use std::istringstream::imbue(std::locale::classic()), but there are subtleties in
|
||||
// parsing in MSVC2010 and it appears to be much slower.
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
static _locale_t locale = (_locale_t) 0;
|
||||
void init_locale() {
|
||||
if (locale == (_locale_t) 0) {
|
||||
locale = _create_locale(LC_NUMERIC, "C");
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if defined(__MINGW64__) || defined(__MINGW32__)
|
||||
#include <locale>
|
||||
#include <sstream>
|
||||
|
||||
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<char*>(start) + nread;
|
||||
return d;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <xlocale.h>
|
||||
#endif
|
||||
static locale_t locale = (locale_t) 0;
|
||||
#include <locale.h>
|
||||
|
||||
static locale_t locale = (locale_t)0;
|
||||
void init_locale() {
|
||||
if (locale == (locale_t) 0) {
|
||||
locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
|
||||
if (locale == (locale_t)0) {
|
||||
locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user