Skip to content

Commit 629fb91

Browse files
committed
Use UNUSED macro
1 parent 6fcd698 commit 629fb91

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

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
@@ -131,7 +141,7 @@ _Py_RemoteDebug_FreePageCache(proc_handle_t *handle)
131141
}
132142
}
133143

134-
static void
144+
UNUSED static void
135145
_Py_RemoteDebug_ClearCache(proc_handle_t *handle)
136146
{
137147
for (int i = 0; i < MAX_PAGES; i++) {
@@ -989,7 +999,7 @@ _Py_RemoteDebug_ReadRemoteMemory(proc_handle_t *handle, uintptr_t remote_address
989999
#endif
9901000
}
9911001

992-
static int
1002+
UNUSED static int
9931003
_Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle,
9941004
uintptr_t addr,
9951005
size_t size,

0 commit comments

Comments
 (0)