On 4/24/25 02:46, Philippe Mathieu-Daudé wrote:
+++ b/include/accel/tcg/probe.h
@@ -0,0 +1,110 @@
+/*
+ * Probe guest virtual addresses for access permissions.
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+#ifndef ACCEL_TCG_PROBE_H
+#define ACCEL_TCG_PROBE_H
+
+#ifndef CONFIG_TCG
+#error Can only include this header with TCG
+#endif
Please don't add these.
All these do is force extra #ifdefs in the users.
As another example, this patch set produces
https://gitlab.com/rth7680/qemu/-/jobs/9819262393
https://gitlab.com/rth7680/qemu/-/jobs/9819262193
aarch64-linux-gnu-gcc -Ilibqemu-aarch64-softmmu.a.p -I. -I.. -Itarget/arm -I../target/arm
-Iqapi -Itrace -Iui -Iui/shader -I/usr/include/glib-2.0
-I/usr/lib/aarch64-linux-gnu/glib-2.0/include -fdiagnostics-color=auto -Wall -Winvalid-pch
-Werror -std=gnu11 -O2 -g -Wempty-body -Wendif-labels -Wexpansion-to-defined
-Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit-fallthrough=2 -Winit-self
-Wmissing-format-attribute -Wmissing-prototypes -Wnested-externs -Wold-style-declaration
-Wold-style-definition -Wredundant-decls -Wshadow=local -Wstrict-prototypes -Wtype-limits
-Wundef -Wvla -Wwrite-strings -Wno-missing-include-dirs -Wno-psabi
-Wno-shift-negative-value -isystem /builds/rth7680/qemu/linux-headers -isystem
linux-headers -iquote . -iquote /builds/rth7680/qemu -iquote /builds/rth7680/qemu/include
-iquote /builds/rth7680/qemu/host/include/aarch64 -iquote
/builds/rth7680/qemu/host/include/generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -ftrivial-auto-var-init=zero
-fzero-call-used-regs=used-gpr -fPIE -isystem../linux-headers -isystemlinux-headers
-DCOMPILING_PER_TARGET '-DCONFIG_TARGET="aarch64-softmmu-config-target.h"'
'-DCONFIG_DEVICES="aarch64-softmmu-config-devices.h"' -MD -MQ
libqemu-aarch64-softmmu.a.p/target_arm_debug_helper.c.o -MF
libqemu-aarch64-softmmu.a.p/target_arm_debug_helper.c.o.d -o
libqemu-aarch64-softmmu.a.p/target_arm_debug_helper.c.o -c ../target/arm/debug_helper.c
In file included from
/builds/rth7680/qemu/include/exec/helper-proto-common.h:16,
from /builds/rth7680/qemu/include/exec/helper-proto.h:10,
from ../target/arm/debug_helper.c:14:
/builds/rth7680/qemu/include/accel/tcg/getpc.h:12:2: error: #error Can only include this
header with TCG
12 | #error Can only include this header with TCG
| ^~~~~
r~