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]>
This commit is contained in:
Joseph MattielloandClaude Opus 5 authored and Joe Mattiello committed 2026-08-26 19:37:58 -04:00
1 parent 96d0b1852f
commit 616edf0b17
1 file changed
-52
@@ -1,52 +0,0 @@
/* Copyright (C) 2010-2020 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (vfs_implementation_cdrom.h).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __LIBRETRO_SDK_VFS_IMPLEMENTATION_CDROM_H
#define __LIBRETRO_SDK_VFS_IMPLEMENTATION_CDROM_H
#include <vfs/vfs.h>
#include <cdrom/cdrom.h>
RETRO_BEGIN_DECLS
int64_t retro_vfs_file_seek_cdrom(libretro_vfs_implementation_file *stream, int64_t offset, int whence);
void retro_vfs_file_open_cdrom(
libretro_vfs_implementation_file *stream,
const char *path, unsigned mode, unsigned hints);
int retro_vfs_file_close_cdrom(libretro_vfs_implementation_file *stream);
int64_t retro_vfs_file_tell_cdrom(libretro_vfs_implementation_file *stream);
int64_t retro_vfs_file_read_cdrom(libretro_vfs_implementation_file *stream,
void *s, uint64_t len);
int retro_vfs_file_error_cdrom(libretro_vfs_implementation_file *stream);
const cdrom_toc_t* retro_vfs_file_get_cdrom_toc(void);
const vfs_cdrom_t* retro_vfs_file_get_cdrom_position(const libretro_vfs_implementation_file *stream);
RETRO_END_DECLS
#endif