Skip to content

Commit 0814c16

Browse files
committed
Fix compilation errors of IfcCharacterEncoder in case ICU is not available
1 parent cb6884b commit 0814c16

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/ifcparse/IfcCharacterDecoder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,17 @@ char IfcCharacterDecoder::substitution_character = '_';
300300

301301

302302
IfcCharacterEncoder::IfcCharacterEncoder(const std::string& input) {
303+
#ifdef HAVE_ICU
303304
if ( !converter) converter = ucnv_open("utf-8", &status);
305+
#endif
304306
str = input;
305307
}
306308

307309
IfcCharacterEncoder::~IfcCharacterEncoder() {
310+
#ifdef HAVE_ICU
308311
if ( !converter) ucnv_close(converter);
309312
converter = 0;
313+
#endif
310314
}
311315

312316
IfcCharacterEncoder::operator std::string() {

src/ifcparse/IfcCharacterDecoder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ namespace IfcWrite {
7777

7878
class IfcCharacterEncoder {
7979
private:
80+
std::string str;
8081
#ifdef HAVE_ICU
8182
static UErrorCode status;
8283
static UConverter* converter;
83-
std::string str;
8484
#endif
8585
public:
8686
IfcCharacterEncoder(const std::string& input);

0 commit comments

Comments
 (0)