core: guard the public header with extern "C" for C++ consumers 7c83b415d7cc
The Mednafen fork's per-system glue (pcfx_control.cpp) is C++, so it needs the core API declared with C linkage or the calls into retro_control.c (compiled as C) fail to link. Wrap the declarations in #ifdef __cplusplus / extern "C"; inert for the existing C consumers (x16-emulator, neo6502). Git-Commit: bc55bf3df8901d4b7e18b8c563d5978d77062f98 Git-Author: Andy McCall <[email protected]>
- Author
- Andy McCall @andymccall <[email protected]>
- When
- · 2026-07-21 19:29 UTC
- Signature
- ◈ sealed by Andy McCall
- Hash
7c83b415d7cccc720775586617f9af01f0dcb25908ef823cc3d234499b904b45- Depends on
- 674b8447022b 961b3c610c66
- Depended on by
- nothing yet
- In bookmarks
- main perf-6
- Edits
- 2 atoms, 0 tree operations, 1 file
Browse the tree at this change
modified core/retro_control.h +8 −0
| … | 23 unchanged lines |
||
| 24 | 24 | #include <stdint.h> |
|
| 25 | 25 | #include <stddef.h> |
|
| 26 | 26 | ||
| 27 | + | #ifdef __cplusplus |
|
| 28 | + | extern "C" { |
|
| 29 | + | #endif |
|
| 30 | + | ||
| 27 | 31 | /* Highest contract the core implements. The server advertises the highest level |
|
| 28 | 32 | * whose backend callbacks are all present: 0.3.0 needs inject_key + write_mem + |
|
| 29 | 33 | * capture_audio; 0.2.0 needs inject_key; else 0.1.0. Keeps a partial backend |
|
| … | 84 unchanged lines |
||
| 114 | 118 | ||
| 115 | 119 | /* Stop the server (optional; process exit is fine too). */ |
|
| 116 | 120 | void retro_control_stop(void); |
|
| 121 | + | ||
| 122 | + | #ifdef __cplusplus |
|
| 123 | + | } |
|
| 124 | + | #endif |
|
| 117 | 125 | ||
| 118 | 126 | #endif /* RETRO_CONTROL_H */ |