Mac OS X support

This commit is contained in:
Benjamin Navarro
2015-10-11 18:31:30 +02:00
parent faa74047db
commit a09d5c3c95
28 changed files with 2223 additions and 154 deletions

View File

@@ -284,7 +284,7 @@ namespace nana
std::u32string utf32str = std::wstring_convert<std::codecvt_utf16<char32_t>, char32_t>().from_bytes(bytes, bytes + sizeof(wchar_t) * wcstr.size());
return std::string(reinterpret_cast<const char*>(utf32str.c_str()), sizeof(char32_t) * utf32str.size());
}
#elif defined(NANA_LINUX)
#elif defined(NANA_LINUX) || defined(NANA_MACOS)
return std::string(reinterpret_cast<const char*>(wcstr.c_str()), sizeof(wchar_t) * wcstr.size());
#else
throw std::runtime_error("Bad charset");
@@ -376,7 +376,7 @@ namespace nana
std::u32string utf32str = std::wstring_convert<std::codecvt_utf16<char32_t>, char32_t>().from_bytes(bytes, bytes + sizeof(wchar_t) * data_.size());
return std::string(reinterpret_cast<const char*>(utf32str.c_str()), sizeof(char32_t) * utf32str.size());
}
#elif defined(NANA_LINUX)
#elif defined(NANA_LINUX) || defined(NANA_MACOS)
return std::string(reinterpret_cast<const char*>(data_.c_str()), data_.size() * sizeof(wchar_t));
#else
throw std::runtime_error("Bad charset");