Meson: Advertise HAVE_OUTB
Rename __FLASHPROG_HAVE_OUTB__ to the more canonical HAVE_OUTB
and make sure Meson sets it on x86.
Change-Id: I67106292ea19ff49d9afe7d23b29e75c8e1ae0fc
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/495
diff --git a/Makefile b/Makefile
index 9c0a336..088606c 100644
--- a/Makefile
+++ b/Makefile
@@ -844,7 +844,7 @@
USE_X86_PORT_IO := $(if $(call filter_deps,$(DEPENDS_ON_X86_PORT_IO)),yes,no)
ifeq ($(USE_X86_PORT_IO), yes)
-FEATURE_FLAGS += -D'__FLASHPROG_HAVE_OUTB__=1'
+FEATURE_FLAGS += -D'HAVE_OUTB=1'
PROGRAMMER_OBJS += hwaccess_x86_io.o
endif
diff --git a/meson.build b/meson.build
index 50412a9..f9f860c 100644
--- a/meson.build
+++ b/meson.build
@@ -134,6 +134,7 @@
if systems_hwaccess.contains(host_machine.system())
srcs += files('hwaccess_physmap.c')
if ['x86', 'x86_64'].contains(host_machine.cpu_family())
+ add_project_arguments('-DHAVE_OUTB=1', language : 'c')
srcs += files('hwaccess_x86_msr.c', 'hwaccess_x86_io.c')
endif
endif
diff --git a/pcidev.c b/pcidev.c
index e2dceb4..57bd20b 100644
--- a/pcidev.c
+++ b/pcidev.c
@@ -121,7 +121,7 @@
break;
case TYPE_IOBAR:
msg_pdbg("I/O\n");
-#if __FLASHPROG_HAVE_OUTB__
+#if HAVE_OUTB
if (!(supported_cycles & PCI_COMMAND_IO)) {
msg_perr("I/O BAR access requested, but device has I/O space accesses disabled.\n");
/* TODO: Abort here? */