libbpf: Fix use #ifdef instead of #if to avoid compiler warning
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 7 Apr 2022 20:38:42 +0000 (13:38 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 7 Apr 2022 21:34:15 +0000 (23:34 +0200)
commitded6dffaed5edc68f1e64b523353da14db673460
tree9ee24f1f0152165d1c2b63dbb8a150a2cfe181a3
parente58c5c9717460851047f63b8615ea0760a6f3a2e
libbpf: Fix use #ifdef instead of #if to avoid compiler warning

As reported by Naresh:

  perf build errors on i386 [1] on Linux next-20220407 [2]

  usdt.c:1181:5: error: "__x86_64__" is not defined, evaluates to 0
  [-Werror=undef]
   1181 | #if __x86_64__
        |     ^~~~~~~~~~
  usdt.c:1196:5: error: "__x86_64__" is not defined, evaluates to 0
  [-Werror=undef]
   1196 | #if __x86_64__
        |     ^~~~~~~~~~
  cc1: all warnings being treated as errors

Use #ifdef instead of #if to avoid this.

Fixes: 4c59e584d158 ("libbpf: Add x86-specific USDT arg spec parsing logic")
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220407203842.3019904-1-andrii@kernel.org
tools/lib/bpf/usdt.c