Skip to content

Commit 687f754

Browse files
committed
Rename the runtime function to 'namespace' it in 'win32'
1 parent e199f0b commit 687f754

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

stdlib/public/runtime/Errors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static bool getSymbolNameAddr(llvm::StringRef libraryName,
9999
#if defined(_WIN32)
100100
char szUndName[1024];
101101
DWORD dwResult;
102-
dwResult = _swift_withWin32DbgHelpLibrary([&] (HANDLE hProcess) -> DWORD {
102+
dwResult = _swift_win32_withDbgHelpLibrary([&] (HANDLE hProcess) -> DWORD {
103103
if (!hProcess) {
104104
return 0;
105105
}

stdlib/public/runtime/ImageInspection.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ int lookupSymbol(const void *address, SymbolInfo *info);
132132
/// their old value before returning. \a body can also call \c SymSetOptions()
133133
/// if needed.
134134
SWIFT_RUNTIME_STDLIB_SPI
135-
void _swift_withWin32DbgHelpLibrary(
135+
void _swift_win32_withDbgHelpLibrary(
136136
void (* body)(HANDLE hProcess, void *context), void *context);
137137

138138
/// Configure the environment to allow calling into the Debug Help library.
@@ -150,9 +150,9 @@ void _swift_withWin32DbgHelpLibrary(
150150
/// \c SymSetOptions() before \a body is invoked, and then resets them back to
151151
/// their old value before returning. \a body can also call \c SymSetOptions()
152152
/// if needed.
153-
static inline void _swift_withWin32DbgHelpLibrary(
153+
static inline void _swift_win32_withDbgHelpLibrary(
154154
const std::function<void(HANDLE /*hProcess*/)> &body) {
155-
_swift_withWin32DbgHelpLibrary([](HANDLE hProcess, void *context) {
155+
_swift_win32_withDbgHelpLibrary([](HANDLE hProcess, void *context) {
156156
auto bodyp = reinterpret_cast<std::function<void(bool)> *>(context);
157157
(* bodyp)(hProcess);
158158
}, const_cast<void *>(reinterpret_cast<const void *>(&body)));
@@ -180,10 +180,10 @@ template <
180180
typename R = typename std::result_of_t<F&(HANDLE /*hProcess*/)>,
181181
typename = typename std::enable_if_t<!std::is_same<void, R>::value>
182182
>
183-
static inline R _swift_withWin32DbgHelpLibrary(const F& body) {
183+
static inline R _swift_win32_withDbgHelpLibrary(const F& body) {
184184
R result;
185185

186-
_swift_withWin32DbgHelpLibrary([&body, &result] (HANDLE hProcess) {
186+
_swift_win32_withDbgHelpLibrary([&body, &result] (HANDLE hProcess) {
187187
result = body(hProcess);
188188
});
189189

stdlib/public/runtime/ImageInspectionCOFF.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int swift::lookupSymbol(const void *address, SymbolInfo *info) {
4040
info->symbolAddress = dli_saddr;
4141
return 1;
4242
#elif defined(_WIN32)
43-
return _swift_withWin32DbgHelpLibrary([&] (HANDLE hProcess) {
43+
return _swift_win32_withDbgHelpLibrary([&] (HANDLE hProcess) {
4444
static const constexpr size_t kSymbolMaxNameLen = 1024;
4545

4646
if (!hProcess) {
@@ -71,7 +71,7 @@ int swift::lookupSymbol(const void *address, SymbolInfo *info) {
7171
static LazyMutex mutex;
7272
static HANDLE dbgHelpHandle = nullptr;
7373

74-
void swift::_swift_withWin32DbgHelpLibrary(
74+
void swift::_swift_win32_withDbgHelpLibrary(
7575
void (* body)(HANDLE hProcess, void *context), void *context) {
7676
mutex.withLock([=] () {
7777
// If we have not previously created a handle to use with the library, do so

0 commit comments

Comments
 (0)