From 0ba1ac7df328a77d63f19c343c2c4aa3212fedb7 Mon Sep 17 00:00:00 2001 From: Stefan Boeykens Date: Sun, 17 Jun 2018 15:15:52 +0200 Subject: [PATCH 1/2] Add ICU header and namespace in IfcCharacterDecoder To compile on macOS with a recent ICU, we have to add the correct header and refer to the right namespace in IfcCharacterDecoder --- src/ifcparse/IfcCharacterDecoder.cpp | 4 ++-- src/ifcparse/IfcCharacterDecoder.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ifcparse/IfcCharacterDecoder.cpp b/src/ifcparse/IfcCharacterDecoder.cpp index cbf8e2f6f8..e8de98d3dc 100644 --- a/src/ifcparse/IfcCharacterDecoder.cpp +++ b/src/ifcparse/IfcCharacterDecoder.cpp @@ -77,7 +77,7 @@ void IfcCharacterDecoder::addChar(std::stringstream& s,const UChar32& ch) { maximum length in bytes is 4. We add 1 for the NUL character. In other encodings the length could be higher, but we have not taken that into account. */ char extraction_buffer[5] = {}; - UnicodeString(ch).extract(extraction_buffer,5,destination,status); + icu::UnicodeString(ch).extract(extraction_buffer,5,destination,status); extraction_buffer[4] = '\0'; s << extraction_buffer; } else { @@ -386,4 +386,4 @@ IfcCharacterEncoder::operator std::string() { #ifdef HAVE_ICU UErrorCode IfcCharacterEncoder::status = U_ZERO_ERROR; UConverter* IfcCharacterEncoder::converter = 0; -#endif \ No newline at end of file +#endif diff --git a/src/ifcparse/IfcCharacterDecoder.h b/src/ifcparse/IfcCharacterDecoder.h index 39e851be0d..a24e9744d8 100644 --- a/src/ifcparse/IfcCharacterDecoder.h +++ b/src/ifcparse/IfcCharacterDecoder.h @@ -1,4 +1,4 @@ -/******************************************************************************** +/******************************************************************************** * * * This file is part of IfcOpenShell. * * * @@ -32,6 +32,7 @@ #ifdef HAVE_ICU #include "unicode/ucnv.h" +#include "unicode/unistr.h" #else typedef unsigned int UChar32; #endif From 58ce86d538971fc1815d56368d7077aa85e0592c Mon Sep 17 00:00:00 2001 From: Stefan Boeykens Date: Tue, 19 Jun 2018 09:45:16 +0200 Subject: [PATCH 2/2] Pushing cmake to enforce C++ 11 To be able to compile with a recent ICU version (for Unicode) C++11 is required. This enforces this in the main CMakeLists.txt --- cmake/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index b157cd56eb..a63ed10bb5 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -17,7 +17,11 @@ # # ################################################################################ -cmake_minimum_required (VERSION 2.8.5) +# cmake_minimum_required (VERSION 2.8.5) + +cmake_minimum_required(VERSION 3.1.3) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) # not necessary, but encouraged project (IfcOpenShell)