diff --git a/SConstruct b/SConstruct index f6d826edf..60c4e1307 100644 --- a/SConstruct +++ b/SConstruct @@ -733,7 +733,7 @@ class DXXProgram(DXXCommon): objects_similar_arch_sdlmixer = DXXCommon.create_lazy_object_property([{ 'source':[os.path.join('similar', f) for f in [ 'arch/sdl/digi_mixer.cpp', -'arch/sdl/jukebox.c' +'arch/sdl/jukebox.cpp' ] ], 'transform_target':_apply_target_name, diff --git a/common/include/jukebox.h b/common/include/jukebox.h index 89d1e8768..185b4de37 100644 --- a/common/include/jukebox.h +++ b/common/include/jukebox.h @@ -1,6 +1,10 @@ #ifndef __JUKEBOX_H__ #define __JUKEBOX_H__ +#ifdef __cplusplus +extern "C" { +#endif + extern const char *const jukebox_exts[7]; void jukebox_unload(); @@ -12,4 +16,8 @@ int jukebox_is_playing(); int jukebox_numtracks(); void jukebox_list(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/common/main/songs.h b/common/main/songs.h index 54b3ab8b2..68ce99c83 100644 --- a/common/main/songs.h +++ b/common/main/songs.h @@ -7,6 +7,10 @@ #ifndef _SONGS_H #define _SONGS_H +#ifdef __cplusplus +extern "C" { +#endif + typedef struct bim_song_info { char filename[16]; } bim_song_info; @@ -45,5 +49,9 @@ void songs_set_volume(int volume); void songs_uninit(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/similar/arch/sdl/jukebox.c b/similar/arch/sdl/jukebox.cpp similarity index 98% rename from similar/arch/sdl/jukebox.c rename to similar/arch/sdl/jukebox.cpp index 3d449b4df..fec0ad3af 100644 --- a/similar/arch/sdl/jukebox.c +++ b/similar/arch/sdl/jukebox.cpp @@ -118,7 +118,7 @@ int read_m3u(void) { if (JukeboxSongs.num_songs >= JukeboxSongs.max_songs) { - char **new_list = d_realloc(JukeboxSongs.list, JukeboxSongs.max_buf*sizeof(char *)*MEM_K); + char **new_list = reinterpret_cast(d_realloc(JukeboxSongs.list, JukeboxSongs.max_buf*sizeof(char *)*MEM_K)); if (new_list == NULL) break; JukeboxSongs.max_buf *= MEM_K;