Makefile.common: use MSVC force-include syntax for the libvorbis rename

The float libvorbis TUs force-include fvorbis_rename.h to namespace their
symbols to fv_*.  The per-object CFLAGS used the GCC/clang "-include
<file>" form together with -Wno-maybe-uninitialized, both of which MSVC's
cl.exe rejects: -Wno-maybe-uninitialized trips command-line error D8021,
and -include is not understood (cl spells force-include "-FI<file>").

Select the force-include spelling by toolchain and drop the GCC-only
warning suppression on MSVC, where that diagnostic does not exist.  The
GCC/clang command line is byte-for-byte unchanged.
This commit is contained in:
libretroadmin authored and libretroadmin committed 2026-06-30 03:17:03 +02:00
1 parent eac92862b5
commit ff36964795
1 file changed
+14 -2
+14 -2
View File
@@ -240,8 +240,20 @@ LIBVORBIS_SOURCES = \
SOURCES_C += $(LIBVORBIS_SOURCES) $(CORE_DIR)/common/snd_vorbis_float.c
# Force-include syntax and the uninitialized-warning suppression differ by
# toolchain. MSVC's cl.exe spells force-include "-FI<file>" and rejects both
# the GCC/clang "-include <file>" form and "-Wno-*" outright (command-line
# error D8021); the GCC warning it suppresses does not exist there anyway.
ifneq (,$(findstring msvc,$(platform)))
LIBVORBIS_FORCE_INCLUDE := -FI$(LIBVORBIS_DIR)/lib/fvorbis_rename.h
LIBVORBIS_EXTRA_CFLAGS :=
else
LIBVORBIS_FORCE_INCLUDE := -include $(LIBVORBIS_DIR)/lib/fvorbis_rename.h
LIBVORBIS_EXTRA_CFLAGS := -Wno-maybe-uninitialized
endif
$(LIBVORBIS_SOURCES:.c=.o): CFLAGS += \
-include $(LIBVORBIS_DIR)/lib/fvorbis_rename.h \
$(LIBVORBIS_FORCE_INCLUDE) \
-I$(LIBVORBIS_DIR)/lib -I$(LIBVORBIS_DIR)/include \
-Wno-maybe-uninitialized
$(LIBVORBIS_EXTRA_CFLAGS)
endif