diff --git a/SConstruct b/SConstruct index 378ae5605..3baf7cac1 100644 --- a/SConstruct +++ b/SConstruct @@ -613,7 +613,7 @@ class DXXArchive(DXXCommon): '3d/points.cpp', '3d/rod.cpp', '3d/setup.cpp', -'arch/sdl/joy.c', +'arch/sdl/joy.cpp', 'arch/sdl/rbaudio.c', 'arch/sdl/window.c', 'maths/fixc.c', diff --git a/common/arch/sdl/joy.c b/common/arch/sdl/joy.cpp similarity index 100% rename from common/arch/sdl/joy.c rename to common/arch/sdl/joy.cpp diff --git a/common/include/console.h b/common/include/console.h index 534b00bb7..636a7c78e 100644 --- a/common/include/console.h +++ b/common/include/console.h @@ -6,6 +6,10 @@ #include "pstypes.h" #include "dxxsconf.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Priority levels */ #define CON_CRITICAL -3 #define CON_URGENT -2 @@ -34,5 +38,9 @@ void con_init(void); void con_printf(int level, const char *fmt, ...) __attribute_format_printf(2, 3); void con_showup(void); +#ifdef __cplusplus +} +#endif + #endif /* _CONSOLE_H_ */ diff --git a/common/include/dxxerror.h b/common/include/dxxerror.h index 4e86d71b1..cd1987e43 100644 --- a/common/include/dxxerror.h +++ b/common/include/dxxerror.h @@ -24,6 +24,10 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "dxxsconf.h" #include +#ifdef __cplusplus +extern "C" { +#endif + #ifdef __GNUC__ #define __noreturn __attribute__ ((noreturn)) #else @@ -52,4 +56,8 @@ extern void Debugger(void); // Avoids some name clashes #define Int3() ((void)0) #endif +#ifdef __cplusplus +} +#endif + #endif /* _ERROR_H */ diff --git a/common/include/event.h b/common/include/event.h index 5ca39c3f7..389302e21 100644 --- a/common/include/event.h +++ b/common/include/event.h @@ -4,6 +4,10 @@ #define _EVENT_H #include "maths.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef enum event_type { EVENT_IDLE = 0, @@ -66,4 +70,8 @@ void event_toggle_focus(int activate_focus); void event_reset_idle_seconds(); fix event_get_idle_seconds(); +#ifdef __cplusplus +} +#endif + #endif diff --git a/common/include/joy.h b/common/include/joy.h index fdc9e9af6..2c643b83d 100644 --- a/common/include/joy.h +++ b/common/include/joy.h @@ -11,6 +11,10 @@ #include "fix.h" #include +#ifdef __cplusplus +extern "C" { +#endif + struct d_event; #define MAX_JOYSTICKS 8 @@ -30,4 +34,8 @@ extern void joy_button_handler(SDL_JoyButtonEvent *jbe); extern void joy_hat_handler(SDL_JoyHatEvent *jhe); extern int joy_axis_handler(SDL_JoyAxisEvent *jae); +#ifdef __cplusplus +} +#endif + #endif // _JOY_H diff --git a/common/include/strutil.h b/common/include/strutil.h index 8659206d8..46c6b1513 100644 --- a/common/include/strutil.h +++ b/common/include/strutil.h @@ -1,6 +1,10 @@ #ifndef _STRUTILS_H #define _STRUTILS_H +#ifdef __cplusplus +extern "C" { +#endif + #if defined(macintosh) extern void snprintf(char *out_string, int size, const char * format, ... ); #endif @@ -39,4 +43,8 @@ int string_array_sort_func(char **e0, char **e1); // reallocate pointers to save memory, sort list alphabetically and remove duplicates according to 'comp' void string_array_tidy(char ***list, char **list_buf, int *num_str, int *max_str, int *max_buf, int offset, int (*comp)( const char *, const char * )); +#ifdef __cplusplus +} +#endif + #endif /* _STRUTILS_H */