From ea2bb1b3e076f316a94062c93d311c990abe8340 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Wed, 18 Sep 2024 15:09:05 +0100 Subject: [PATCH] Split up variants of `_native_gvl_profiling_hook_active` to fix unused argument warning --- .../collectors_cpu_and_wall_time_worker.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c b/ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c index a04303f021d..8ba916dd759 100644 --- a/ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c +++ b/ext/datadog_profiling_native_extension/collectors_cpu_and_wall_time_worker.c @@ -1339,15 +1339,15 @@ static VALUE _native_resume_signals(DDTRACE_UNUSED VALUE self) { state->during_sample = false; } -#endif -static VALUE _native_gvl_profiling_hook_active(DDTRACE_UNUSED VALUE self, VALUE instance) { - #ifndef NO_GVL_INSTRUMENTATION + static VALUE _native_gvl_profiling_hook_active(DDTRACE_UNUSED VALUE self, VALUE instance) { struct cpu_and_wall_time_worker_state *state; TypedData_Get_Struct(instance, struct cpu_and_wall_time_worker_state, &cpu_and_wall_time_worker_typed_data, state); return state->gvl_profiling_hook != NULL ? Qtrue : Qfalse; - #else + } +#else + static VALUE _native_gvl_profiling_hook_active(DDTRACE_UNUSED VALUE self, DDTRACE_UNUSED VALUE instance) { return Qfalse; - #endif -} + } +#endif