comparison dep/animia/src/util/osx.cc @ 194:8548dc425697

sys/osx: remove all objective-c++ stuff mmmm :)
author Paper <mrpapersonic@gmail.com>
date Thu, 07 Dec 2023 03:17:05 -0500
parents 2d5823df870f
children a7d0d543b334
comparison
equal deleted inserted replaced
193:0ad2507c3e60 194:8548dc425697
97 bool StringFromCFString(CFStringRef string, std::string& result) { 97 bool StringFromCFString(CFStringRef string, std::string& result) {
98 if (!string) 98 if (!string)
99 return false; 99 return false;
100 100
101 result.resize(CFStringGetMaximumSizeForEncoding(CFStringGetLength(string), kCFStringEncodingUTF8) + 1); 101 result.resize(CFStringGetMaximumSizeForEncoding(CFStringGetLength(string), kCFStringEncodingUTF8) + 1);
102 if (!CFStringGetCString(string, &result.front(), result.length(), result.length())) 102 if (!CFStringGetCString(string, &result.front(), result.length(), kCFStringEncodingUTF8))
103 return false; 103 return false;
104 104
105 return true; 105 return true;
106 } 106 }
107 #endif // HAVE_COREFOUNDATION 107 #endif // HAVE_COREFOUNDATION