File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1174,7 +1174,11 @@ SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
11741174const char *swift_keyPath_copySymbolName(void *address) {
11751175 if (auto info = SymbolInfo::lookup (address)) {
11761176 if (info->getSymbolName ()) {
1177+ #if defined(_WIN32)
1178+ return _strdup (info->getSymbolName ());
1179+ #else
11771180 return strdup (info->getSymbolName ());
1181+ #endif
11781182 }
11791183 }
11801184 return nullptr ;
@@ -1192,9 +1196,12 @@ SWIFT_RUNTIME_STDLIB_INTERNAL const
11921196 std::string mangledName = keyPathSourceString (name, length);
11931197 if (mangledName == " " ) {
11941198 return 0 ;
1195- } else {
1196- return strdup (mangledName.c_str ());
11971199 }
1200+ #if defined(_WIN32)
1201+ return _strdup (mangledName.c_str ());
1202+ #else
1203+ return strdup (mangledName.c_str ());
1204+ #endif
11981205}
11991206
12001207#endif // SWIFT_ENABLE_REFLECTION
You can’t perform that action at this time.
0 commit comments