From c60bd48a857a4099dec7dc846ab8cc27e26650a2 Mon Sep 17 00:00:00 2001 From: Dave Marchevsky Date: Fri, 18 Jun 2021 22:52:46 -0700 Subject: [PATCH] libbpf-tools: Don't redefine _GNU_SOURCE to avoid redefinition warning Similar to past commits like 667988ce9e2a051ff608b727f6c89a5baa01fa67, my toolchain complains that `_GNU_SOURCE` is redefined. Let's only define it when it passes `ifndef` --- libbpf-tools/trace_helpers.c | 2 ++ libbpf-tools/uprobe_helpers.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libbpf-tools/trace_helpers.c b/libbpf-tools/trace_helpers.c index 0e9b0192..f37015e7 100644 --- a/libbpf-tools/trace_helpers.c +++ b/libbpf-tools/trace_helpers.c @@ -3,7 +3,9 @@ // // Based on ksyms improvements from Andrii Nakryiko, add more helpers. // 28-Feb-2020 Wenbo Zhang Created this. +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include #include #include diff --git a/libbpf-tools/uprobe_helpers.c b/libbpf-tools/uprobe_helpers.c index 4a627a91..9f6e3b54 100644 --- a/libbpf-tools/uprobe_helpers.c +++ b/libbpf-tools/uprobe_helpers.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) /* Copyright (c) 2021 Google LLC. */ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include #include #include -- 2.34.1