Commit a906492
committed
libretro-common/md5: skip built-in implementation on Apple
lrc_hash.h has two MD5_CTX definitions behind an __APPLE__ fence:
* Apple: typedef to CC_MD5_CTX (struct CC_MD5state_st) with
MD5_Init/Update/Final #define'd to the CommonCrypto CC_*
equivalents.
* Everyone else: the Solar Designer plain-C struct with explicit
a/b/c/d/lo/hi/buffer/block members, matched by the implementation
in libretro-common/utils/md5.c.
md5.c was still being compiled unconditionally on Apple, which
produced a hard build failure on macOS command-line builds:
libretro-common/utils/md5.c:95:20: error: no member named 'a'
in 'struct CC_MD5state_st'
libretro-common/utils/md5.c:107:31: error: no member named
'block' in 'struct CC_MD5state_st'
(... 20 errors, ferror-limit ...)
The file's contents are unreachable on Apple anyway -- the #defines
in lrc_hash.h remap every call site to CC_* before md5.c's
declarations are seen, so the symbols it defines are orphans on
Apple builds even when they do compile. The right fix is to skip
the translation unit entirely, matching the Apple branch in the
header.
Scope:
* One file touched (libretro-common/utils/md5.c).
* Two lines of real change: `#ifndef __APPLE__` right before the
first #include, matching `#endif` at EOF.
* No behavioural change on non-Apple platforms; the preprocessor
fence is a no-op there.
* No Makefile change needed -- md5.c stays in the sources list on
every platform, it just compiles to an empty object on Apple.
Local build check:
[pass] `make clean && make -j16` on macOS arm64 (Darwin 24,
Apple clang) now reaches the link stage past md5.o
instead of failing at CC libretro-common/utils/md5.c.
[pass] No change to the compile log on a Linux x86_64 build --
md5.c still compiles to the same object.1 parent acd0b89 commit a906492
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| |||
287 | 295 | | |
288 | 296 | | |
289 | 297 | | |
| 298 | + | |
| 299 | + | |
0 commit comments