Skip to content

Commit 2e1ad6e

Browse files
authored
Fix definition of _Py_RemoteDebug_ symbols for static linking (#135146)
1 parent a58026a commit 2e1ad6e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Python/remote_debug.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ If you need to add a new function ensure that is declared 'static'.
1313
extern "C" {
1414
#endif
1515

16+
#ifdef __clang__
17+
#define UNUSED __attribute__((unused))
18+
#elif defined(__GNUC__)
19+
#define UNUSED __attribute__((unused))
20+
#elif defined(_MSC_VER)
21+
#define UNUSED __pragma(warning(suppress: 4505))
22+
#else
23+
#define UNUSED
24+
#endif
25+
1626
#if !defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
1727
# error "this header requires Py_BUILD_CORE or Py_BUILD_CORE_MODULE define"
1828
#endif
@@ -133,7 +143,7 @@ _Py_RemoteDebug_FreePageCache(proc_handle_t *handle)
133143
}
134144
}
135145

136-
void
146+
UNUSED static void
137147
_Py_RemoteDebug_ClearCache(proc_handle_t *handle)
138148
{
139149
for (int i = 0; i < MAX_PAGES; i++) {
@@ -1059,7 +1069,7 @@ _Py_RemoteDebug_ReadRemoteMemory(proc_handle_t *handle, uintptr_t remote_address
10591069
#endif
10601070
}
10611071

1062-
int
1072+
UNUSED static int
10631073
_Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle,
10641074
uintptr_t addr,
10651075
size_t size,

0 commit comments

Comments
 (0)