From: Dave Marchevsky Date: Sat, 19 Jun 2021 05:52:46 +0000 (-0700) Subject: libbpf-tools: Don't redefine _GNU_SOURCE to avoid redefinition warning X-Git-Tag: v0.21.0~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c60bd48a857a4099dec7dc846ab8cc27e26650a2;p=platform%2Fupstream%2Fbcc.git 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` --- 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