diff --git a/include/os/osString.h b/include/os/osString.h index 09a697d834..995aa4a591 100644 --- a/include/os/osString.h +++ b/include/os/osString.h @@ -22,7 +22,7 @@ extern "C" { typedef wchar_t TdWchar; typedef int32_t TdUcs4; -#ifndef DISALLOW_NCHAR_WITHOUT_ICONV +#if !defined(DISALLOW_NCHAR_WITHOUT_ICONV) && defined(DARWIN) #include "iconv.h" #else typedef void *iconv_t; diff --git a/source/os/src/osString.c b/source/os/src/osString.c index 7960f84369..18da778227 100644 --- a/source/os/src/osString.c +++ b/source/os/src/osString.c @@ -17,6 +17,10 @@ #define _DEFAULT_SOURCE #include "os.h" +#ifndef DISALLOW_NCHAR_WITHOUT_ICONV +#include "iconv.h" +#endif + extern int wcwidth(wchar_t c); extern int wcswidth(const wchar_t *s, size_t n);