Files
Joseph MattielloandClaude Opus 5 616edf0b17 build: drop the dangling vendored vfs_implementation_cdrom.h
libretro-common/include/vfs/vfs_implementation_cdrom.h includes
<cdrom/cdrom.h>, and libretro-common/include/cdrom/ was never vendored --
this repo carries a subset. So the header cannot compile.

It goes unnoticed because its only consumer is guarded:

  /* libretro-common/vfs/vfs_implementation.c:210 */
  #ifdef HAVE_CDROM
  #include <vfs/vfs_implementation_cdrom.h>
  #endif

This core never defines HAVE_CDROM and never will -- it has its own CD stack
under src/cd/. The header is therefore simultaneously dead (nothing includes
it) and broken (it could not compile if anything did).

Any build that parses headers rather than only compiling translation units
trips over it. Clang module maps do exactly that, which is how the SwiftPM
build finds it:

  libretro-common/include/vfs/vfs_implementation_cdrom.h:27:10:
    fatal error: 'cdrom/cdrom.h' file not found
  src/core/log.h:6:10: fatal error: could not build module 'libretro_common'

Deleting rather than vendoring the missing dependency (which would add
unused code for a path we never take) or wrapping the body in
#ifdef HAVE_CDROM (which makes it parse but leaves a header that still
cannot work, turning today's clear missing-include error into link errors).
After this, setting HAVE_CDROM fails at vfs_implementation.c:211 with "no
such file", which correctly says "vendor the cdrom bits first".

A wholesale libretro-common re-sync will bring it back; that is true of
every file the vendored subset omits.

Deliberately NOT paired with deleting src/core/boolean.h, which the
downstream fork branch does alongside this. Measured, that deletion is
unnecessary -- with only this header removed, swift build completes clean
with src/core/boolean.h in place, and the cyclic module import it was blamed
for does not occur. It would also not be behaviour-neutral: src/core's shim
applies the `#define bool unsigned char` hack for ALL _MSC_VER, while
libretro-common's applies it only below 1800, and src/core precedes
libretro-common on the include path. Removing it would flip msvc2015/msvc2017
to real <stdbool.h> _Bool, changing assignment semantics (_Bool b = 4 stores
1; unsigned char b = 4 stores 4) on a path CI cannot fully verify.

Fixes #621

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-26 19:37:58 -04:00
..