diff --git a/polymer/eduke32/build/include/baselayer.h b/polymer/eduke32/build/include/baselayer.h index e2f612b11..a972d6f11 100644 --- a/polymer/eduke32/build/include/baselayer.h +++ b/polymer/eduke32/build/include/baselayer.h @@ -8,7 +8,7 @@ #include "compat.h" #include "osd.h" -#ifdef EXTERNC +#ifdef __cplusplus extern "C" { #endif @@ -33,6 +33,7 @@ extern int32_t startwin_close(void); extern int32_t startwin_puts(const char *); extern int32_t startwin_settitle(const char *); extern int32_t startwin_idle(void *); +extern int32_t startwin_run(void); // video extern int32_t r_usenewaspect, newaspect_enable; @@ -213,7 +214,7 @@ int32_t baselayer_init(); void makeasmwriteable(void); void maybe_redirect_outputs(void); -#ifdef EXTERNC +#ifdef __cplusplus } #endif diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 9eb3ad822..2652dc5d8 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -13,7 +13,7 @@ #include "pragmas.h" #include "glbuild.h" -#ifdef EXTERNC +#ifdef __cplusplus extern "C" { #endif @@ -253,6 +253,8 @@ static inline void sector_tracker_hook(uintptr_t address); static inline void wall_tracker_hook(uintptr_t address); static inline void sprite_tracker_hook(uintptr_t address); +} + #define TRACKER_NAME_ SectorTracker #define TRACKER_GLOBAL_HOOK_ sector_tracker_hook #include "tracker.hpp" @@ -274,6 +276,8 @@ static inline void sprite_tracker_hook(uintptr_t address); #define Tracker(Container, Type) Container##Tracker #define TrackerCast(x) x.cast() +extern "C" { + #else #define Tracker(Container, Type) Type @@ -753,13 +757,7 @@ EXTERN spritetype *tspriteptr[MAXSPRITESONSCREEN + 1]; EXTERN int32_t xdim, ydim, numpages; EXTERN int32_t yxaspect, viewingrange; -#ifdef __cplusplus -extern "C" { -#endif EXTERN intptr_t *ylookup; -#ifdef __cplusplus -}; -#endif #ifndef GEKKO #define MAXVALIDMODES 256 @@ -861,14 +859,8 @@ EXTERN vec2_t tilesiz[MAXTILES]; EXTERN char picsiz[MAXTILES]; EXTERN char walock[MAXTILES]; -#ifdef __cplusplus -extern "C" { -#endif extern const char pow2char[8]; extern const int32_t pow2long[32]; -#ifdef __cplusplus -}; -#endif // picanm[].sf: // |bit(1<<7) @@ -1298,10 +1290,10 @@ static inline int32_t spriteheightofs(int16_t i, int32_t *height, int32_t alsoti int32_t screencapture(const char *filename, char inverseit, const char *versionstr) ATTRIBUTE((nonnull(1))); +int32_t getclosestcol_lim(int32_t r, int32_t g, int32_t b, int32_t lastokcol); + static inline int32_t getclosestcol(int32_t r, int32_t g, int32_t b) { - extern int32_t getclosestcol_lim(int32_t r, int32_t g, int32_t b, int32_t lastokcol); - return getclosestcol_lim(r, g, b, 255); } @@ -1495,8 +1487,13 @@ static inline void pop_nofog(void) #endif } +#ifdef LUNATIC +extern const int32_t engine_main_arrays_are_static; +extern const int32_t engine_v8; +int32_t Mulscale(int32_t a, int32_t b, int32_t sh); +#endif -#ifdef EXTERNC +#ifdef __cplusplus } #endif diff --git a/polymer/eduke32/build/include/cache1d.h b/polymer/eduke32/build/include/cache1d.h index 54804dadb..ae9c15758 100644 --- a/polymer/eduke32/build/include/cache1d.h +++ b/polymer/eduke32/build/include/cache1d.h @@ -6,7 +6,7 @@ #include "compat.h" #include "mutex.h" -#ifdef EXTERNC +#ifdef __cplusplus extern "C" { #endif @@ -24,6 +24,7 @@ void allocache(intptr_t *newhandle, int32_t newbytes, char *newlockptr); void agecache(void); extern int32_t pathsearchmode; // 0 = gamefs mode (default), 1 = localfs mode (editor's mode) +char *listsearchpath(int32_t initp); int32_t addsearchpath(const char *p); int32_t removesearchpath(const char *p); int32_t findfrompath(const char *fn, char **where); @@ -72,7 +73,7 @@ void kdfwrite(const void *buffer, bsize_t dasizeof, bsize_t count, int32_t fil); #endif void dfwrite(const void *buffer, bsize_t dasizeof, bsize_t count, BFILE *fil); -#ifdef EXTERNC +#ifdef __cplusplus } #endif diff --git a/polymer/eduke32/build/include/common.h b/polymer/eduke32/build/include/common.h index 1ea240ef0..ed05c84f1 100644 --- a/polymer/eduke32/build/include/common.h +++ b/polymer/eduke32/build/include/common.h @@ -14,7 +14,7 @@ #include "build.h" -#ifdef EXTERNC +#ifdef __cplusplus extern "C" { #endif @@ -135,7 +135,7 @@ void COMMON_clearbackground(int32_t numcols, int32_t numrows); #define EDUKE32_TMRTIC t[ti++]=getticks() #define EDUKE32_TMRPRN do { int ii=0; fprintf(stderr,"%s: ",tmrstr); for (ii=1; ii -# ifdef compat_h_macrodef__ -# include -# include -# include -# include -# endif -#else -# include -# include -#endif +#include +#include #ifdef compat_h_macrodef__ -# ifndef EXTERNC -# include -# include -# include -# include -# endif +# include +# include +# include +# include # include # include # include @@ -350,7 +338,7 @@ # define BITNESS64 #endif -#ifdef EXTERNC +#ifdef __cplusplus # ifndef SCREWED_UP_CPP // using namespace std; @@ -861,7 +849,7 @@ FORCE_INLINE void *xaligned_malloc(const bsize_t alignment, const bsize_t size) } -#ifdef EXTERNC +#ifdef __cplusplus } #endif diff --git a/polymer/eduke32/build/include/crc32.h b/polymer/eduke32/build/include/crc32.h index 217c3f7c7..28ae39d43 100644 --- a/polymer/eduke32/build/include/crc32.h +++ b/polymer/eduke32/build/include/crc32.h @@ -3,7 +3,7 @@ #include "compat.h" -#ifdef EXTERNC +#ifdef __cplusplus extern "C" { #endif @@ -18,7 +18,7 @@ extern uint32_t crc32table[4][256]; extern uint32_t Bcrc32(const void* data, size_t length, uint32_t crc); extern void initcrc32table(void); -#ifdef EXTERNC +#ifdef __cplusplus } #endif diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index b704afa31..fedbb3d94 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -7,8 +7,8 @@ #include -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif #define VERSION "2.0.0devel" @@ -394,10 +394,6 @@ enum SaveBoardFlags M32_SB_ASKOV = 2, // for NEW_MAP_FORMAT build, ask whether write map if going from V7/8 to VX }; -#ifdef EXTERNC -} -#endif - // showdebug is now used as a general informational on-screen display #define M32_SHOWDEBUG @@ -429,4 +425,8 @@ static inline void inpclamp(int32_t *x, int32_t mi, int32_t ma) if (*x +#ifdef __cplusplus +extern "C" { +#endif + int32_t osx_msgbox(const char *name, const char *msg); int32_t osx_ynbox(const char *name, const char *msg); +#ifdef __cplusplus +} +#endif + #endif diff --git a/polymer/eduke32/build/include/polymer.h b/polymer/eduke32/build/include/polymer.h index d0b6eeb94..c22d29478 100644 --- a/polymer/eduke32/build/include/polymer.h +++ b/polymer/eduke32/build/include/polymer.h @@ -13,6 +13,10 @@ # include "polymost.h" # include "pragmas.h" +#ifdef __cplusplus +extern "C" { +#endif + #define PR_LINEAR_FOG // CVARS @@ -568,4 +572,8 @@ static inline void relvec2f(GLfloat *v1, GLfloat *v2, GLfloat *out) # endif // !POLYMER_C +#ifdef __cplusplus +} +#endif + #endif // !polymer_h_ diff --git a/polymer/eduke32/build/include/pragmas.h b/polymer/eduke32/build/include/pragmas.h index 40564f43b..376885c35 100644 --- a/polymer/eduke32/build/include/pragmas.h +++ b/polymer/eduke32/build/include/pragmas.h @@ -5,7 +5,7 @@ #ifndef pragmas_h_ #define pragmas_h_ -#ifdef EXTERNC +#ifdef __cplusplus extern "C" { #endif @@ -27,7 +27,7 @@ extern "C" { #endif extern int32_t reciptable[2048], fpuasm; #if !defined(NOASM) && defined __cplusplus -}; +} #endif // break the C version of divscale out from the others @@ -259,7 +259,7 @@ static inline void swapbufreverse(void *s, void *d, int32_t c) while (c--) swapchar(dst++, src--); } -#ifdef EXTERNC +#ifdef __cplusplus } #endif diff --git a/polymer/eduke32/build/include/scriptfile.h b/polymer/eduke32/build/include/scriptfile.h index a2d008524..fd13cec6c 100644 --- a/polymer/eduke32/build/include/scriptfile.h +++ b/polymer/eduke32/build/include/scriptfile.h @@ -2,7 +2,7 @@ #ifndef BUILD_SCRIPTFILE_H_ #define BUILD_SCRIPTFILE_H_ -#ifdef EXTERNC +#ifdef __cplusplus extern "C" { #endif @@ -34,7 +34,7 @@ int32_t scriptfile_getsymbolvalue(char *name, int32_t *val); int32_t scriptfile_addsymbolvalue(char *name, int32_t val); void scriptfile_clearsymbols(void); -#ifdef EXTERNC +#ifdef __cplusplus } #endif diff --git a/polymer/eduke32/build/include/texcache.h b/polymer/eduke32/build/include/texcache.h index 3d22abd04..1f68275b6 100644 --- a/polymer/eduke32/build/include/texcache.h +++ b/polymer/eduke32/build/include/texcache.h @@ -1,6 +1,10 @@ #ifndef texcache_h_ # define texcache_h_ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef USE_OPENGL #define TEXCACHEMAGIC "LZ40" @@ -64,4 +68,9 @@ extern void texcache_checkgarbage(void); extern void texcache_setupindex(void); #endif + +#ifdef __cplusplus +} +#endif + #endif diff --git a/polymer/eduke32/build/include/winbits.h b/polymer/eduke32/build/include/winbits.h index ab606d621..ac68073bd 100644 --- a/polymer/eduke32/build/include/winbits.h +++ b/polymer/eduke32/build/include/winbits.h @@ -28,3 +28,5 @@ extern void ShowErrorBox(const char *m); extern LPTSTR GetWindowsErrorMsg(DWORD code); extern int32_t addsearchpath_ProgramFiles(const char *p); + +extern int32_t G_GetVersionFromWebsite(char *buffer); diff --git a/polymer/eduke32/build/src/baselayer.c b/polymer/eduke32/build/src/baselayer.c index b0eb57224..f27f8f07a 100644 --- a/polymer/eduke32/build/src/baselayer.c +++ b/polymer/eduke32/build/src/baselayer.c @@ -145,7 +145,7 @@ extern "C" { #endif extern intptr_t dep_begin, dep_end; #ifdef __cplusplus -}; +} #endif #endif diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 816343d18..af05c8bac 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -611,8 +611,6 @@ int32_t app_main(int32_t argc, const char **argv) #ifdef STARTUP_SETUP_WINDOW if (i || forcesetup || cmdsetup) { - extern int32_t startwin_run(void); - if (quitevent || !startwin_run()) { uninitengine(); diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 0f85bb86b..37873a2ad 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -179,7 +179,7 @@ intptr_t bufplce[4]; int32_t globaltilesizy; int32_t globalx1, globaly2, globalx3, globaly3; #if !defined(NOASM) && defined __cplusplus -}; +} #endif int32_t sloptable[16384]; @@ -249,8 +249,25 @@ static int16_t maphacklight[PR_MAXLIGHTS]; #endif // forward refs +#ifdef __cplusplus +extern "C" { +#endif +void setblendtab(int32_t blend, const char *tab); +#ifdef LUNATIC +extern const char *(getblendtab)(int32_t blend); +int32_t setpalookup(int32_t palnum, const uint8_t *shtab); +#endif +void setup_sideview_sincos(void); int32_t getscreenvdisp(int32_t bz, int32_t zoome); void screencoords(int32_t *xres, int32_t *yres, int32_t x, int32_t y, int32_t zoome); +int32_t scalescreeny(int32_t sy); +#ifdef YAX_ENABLE +void yax_tweakpicnums(int32_t bunchnum, int32_t cf, int32_t restore); +#endif +int32_t getinvdisplacement(int32_t *dx, int32_t *dy, int32_t dz); +#ifdef __cplusplus +} +#endif static void scansector(int16_t startsectnum); static void draw_rainbow_background(void); @@ -2401,7 +2418,6 @@ char palfadedelta = 0; static uint8_t numalphatabs; static char *blendtable[MAXBLENDTABS]; -void setblendtab(int32_t blend, const char *tab); #define getblendtab(blend) (blendtable[blend]) static void setpalettefade_calc(uint8_t offset); @@ -16360,7 +16376,7 @@ int32_t getscreenvdisp(int32_t bz, int32_t zoome) return mulscale32(bz,zoome*m32_sidecos); } -void setup_sideview_sincos() +void setup_sideview_sincos(void) { if (m32_sideview) { diff --git a/polymer/eduke32/build/src/engine_priv.h b/polymer/eduke32/build/src/engine_priv.h index 2fa10132c..6cbdb4748 100644 --- a/polymer/eduke32/build/src/engine_priv.h +++ b/polymer/eduke32/build/src/engine_priv.h @@ -21,7 +21,7 @@ extern "C" { extern intptr_t asm1, asm2, asm3, asm4; extern int32_t globalx1, globaly2; #if !defined(NOASM) && defined __cplusplus -}; +} #endif extern uint8_t basepalcount; diff --git a/polymer/eduke32/build/src/gtkbits.c b/polymer/eduke32/build/src/gtkbits.c index c43b20387..f9b45a3b3 100644 --- a/polymer/eduke32/build/src/gtkbits.c +++ b/polymer/eduke32/build/src/gtkbits.c @@ -10,6 +10,8 @@ #include "baselayer.h" #include "build.h" +#include "gtkbits.h" + int32_t gtkenabled = 0; static GdkPixbuf *appicon = NULL; diff --git a/polymer/eduke32/build/src/lunatic.c b/polymer/eduke32/build/src/lunatic.c index 3e09101d1..34f5dc1a9 100644 --- a/polymer/eduke32/build/src/lunatic.c +++ b/polymer/eduke32/build/src/lunatic.c @@ -18,6 +18,7 @@ extern "C" { } #endif +#include "build.h" #include "cache1d.h" #include "osd.h" @@ -139,7 +140,6 @@ void L_DestroyState(L_State *estate) static void L_OnOutOfMem(void) { - extern void uninitengine(void); OSD_Printf("Out of memory in Lunatic.\n"); uninitengine(); exit(127); diff --git a/polymer/eduke32/build/src/osd.c b/polymer/eduke32/build/src/osd.c index bb0997770..5a44e50ac 100644 --- a/polymer/eduke32/build/src/osd.c +++ b/polymer/eduke32/build/src/osd.c @@ -72,7 +72,6 @@ static int32_t (*_getrowheight)(int32_t) = _internal_getrowheight; static hashtable_t h_cvars = { OSDMAXSYMBOLS<<1, NULL }; int32_t m32_osd_tryscript=0; // whether to try executing m32script on unkown command in the osd -extern void M32RunScript(const char *s); int32_t OSD_RegisterCvar(const cvar_t *cvar) { diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 9e46c13eb..2748de633 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -47,6 +47,7 @@ int32_t startwin_close(void) { return 0; } int32_t startwin_puts(const char *s) { UNREFERENCED_PARAMETER(s); return 0; } int32_t startwin_idle(void *s) { UNREFERENCED_PARAMETER(s); return 0; } int32_t startwin_settitle(const char *s) { UNREFERENCED_PARAMETER(s); return 0; } +int32_t startwin_run(void) { return 0; } #endif /// These can be useful for debugging sometimes... diff --git a/polymer/eduke32/source/_functio.h b/polymer/eduke32/source/_functio.h index 7b925bc4f..4a4b60f68 100644 --- a/polymer/eduke32/source/_functio.h +++ b/polymer/eduke32/source/_functio.h @@ -30,8 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef function_private_h_ #define function_private_h_ -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif // KEEPINSYNC lunatic/con_lang.lua char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] = @@ -504,7 +504,7 @@ static const char * joystickdigitaldefaults[] = #endif #endif -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif diff --git a/polymer/eduke32/source/actors.h b/polymer/eduke32/source/actors.h index ac9e98282..b327e962e 100644 --- a/polymer/eduke32/source/actors.h +++ b/polymer/eduke32/source/actors.h @@ -25,6 +25,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "player.h" +#ifdef __cplusplus +extern "C" { +#endif + #define MAXSLEEPDIST 16384 #define SLEEPTIME 1536 #define ZOFFSET (1<<8) @@ -330,6 +334,14 @@ void Sect_ToggleInterpolation(int sectnum, int doset); FORCE_INLINE void Sect_ClearInterpolation(int sectnum) { Sect_ToggleInterpolation(sectnum, 0); } FORCE_INLINE void Sect_SetInterpolation(int sectnum) { Sect_ToggleInterpolation(sectnum, 1); } +#ifdef LUNATIC +int32_t G_ToggleWallInterpolation(int32_t w, int32_t doset); +#endif + +#ifdef __cplusplus +} +#endif + #include "actors_inline.h" #endif diff --git a/polymer/eduke32/source/actors_inline.h b/polymer/eduke32/source/actors_inline.h index edf173bd7..e91a9d5ee 100644 --- a/polymer/eduke32/source/actors_inline.h +++ b/polymer/eduke32/source/actors_inline.h @@ -23,6 +23,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef actors_inline_h_ #define actors_inline_h_ +#ifdef __cplusplus +extern "C" { +#endif + #if KRANDDEBUG # define ACTOR_INLINE __fastcall # define ACTOR_INLINE_HEADER extern __fastcall @@ -44,6 +48,10 @@ EXTERN_INLINE_HEADER int32_t G_CheckForSpaceFloor(int32_t sectnum); EXTERN_INLINE_HEADER int32_t A_CheckEnemySprite(const spritetype *s); +#ifdef __cplusplus +} +#endif + #ifndef DISABLE_INLINING #include "actors_inline.c" #endif diff --git a/polymer/eduke32/source/common_game.h b/polymer/eduke32/source/common_game.h index 9ea199176..5667ac7c1 100644 --- a/polymer/eduke32/source/common_game.h +++ b/polymer/eduke32/source/common_game.h @@ -7,6 +7,10 @@ #ifndef EDUKE32_COMMON_GAME_H_ #define EDUKE32_COMMON_GAME_H_ +#ifdef __cplusplus +extern "C" { +#endif + extern int32_t usecwd; #define GAMEFLAG_DUKE 0x00000001 @@ -113,4 +117,8 @@ extern uint8_t *basepaltable[BASEPALCOUNT]; extern int32_t g_firstFogPal; extern int32_t G_LoadLookups(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 6f4def489..4ce130682 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -23,10 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef duke3d_h_ #define duke3d_h_ -#ifdef EXTERNC -{ -#endif - // JBF #include "compat.h" #include "a.h" @@ -169,7 +165,4 @@ static inline int32_t G_InitialActorStrength(int32_t actortile) #endif } -#ifdef EXTERNC -} -#endif #endif diff --git a/polymer/eduke32/source/function.h b/polymer/eduke32/source/function.h index 22a9109b1..21b444150 100644 --- a/polymer/eduke32/source/function.h +++ b/polymer/eduke32/source/function.h @@ -30,8 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef function_public_h_ #define function_public_h_ -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif #define NUMKEYENTRIES 56 @@ -101,7 +101,7 @@ enum GameFunction_t gamefunc_Dpad_Select, gamefunc_Dpad_Aiming }; -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index cb03117fc..87ee08178 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -81,7 +81,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # define WIN32_LEAN_AND_MEAN # include # include -extern int32_t G_GetVersionFromWebsite(char *buffer); # define UPDATEINTERVAL 604800 // 1w # include "winbits.h" #else @@ -10785,7 +10784,6 @@ static void A_InitEnemyFlags(void) } #undef SETFLAG -extern int32_t startwin_run(void); static void G_SetupGameButtons(void); #ifdef LUNATIC diff --git a/polymer/eduke32/source/game.h b/polymer/eduke32/source/game.h index aa7a52882..43be66a38 100644 --- a/polymer/eduke32/source/game.h +++ b/polymer/eduke32/source/game.h @@ -25,6 +25,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "premap.h" +#ifdef __cplusplus +extern "C" { +#endif + // Compile game-side legacy Room over Room code? #define LEGACY_ROR 1 @@ -315,8 +319,6 @@ extern int32_t minitext_lowercase; int32_t minitext_(int32_t x,int32_t y,const char *t,int32_t s,int32_t p,int32_t sb); int32_t mpgametext(int32_t y,const char *t,int32_t s,int32_t dabits); -int32_t startwin_run(void); - #ifdef YAX_ENABLE void Yax_SetBunchZs(int32_t sectnum, int32_t cf, int32_t daz); #else @@ -399,10 +401,6 @@ static inline int32_t G_GetTeamPalette(int32_t team) return pal[team]; } -#if defined(_WIN32) -int32_t G_GetVersionFromWebsite(char *buffer); -#endif - #ifdef USE_OPENGL extern char forcegl; #endif @@ -580,4 +578,14 @@ static inline int32_t G_GetMusicIdx(const char *str) extern void G_StartMusic(void); +#ifdef LUNATIC +void El_SetCON(const char *conluacode); +void G_DrawTileGeneric(int32_t x, int32_t y, int32_t zoom, int32_t tilenum, + int32_t shade, int32_t orientation, int32_t p); +#endif + +#ifdef __cplusplus +} +#endif + #endif diff --git a/polymer/eduke32/source/game_inline.h b/polymer/eduke32/source/game_inline.h index fea78414b..deef34f7b 100644 --- a/polymer/eduke32/source/game_inline.h +++ b/polymer/eduke32/source/game_inline.h @@ -23,10 +23,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef game_inline_h_ #define game_inline_h_ +#ifdef __cplusplus +extern "C" { +#endif + EXTERN_INLINE_HEADER void G_SetStatusBarScale(int32_t sc); EXTERN_INLINE_HEADER void SetIfGreater(int32_t *variable, int32_t potentialValue); +#ifdef __cplusplus +} +#endif + #ifndef DISABLE_INLINING #include "game_inline.c" #endif diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 2f931e8b5..8bca1b7bf 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -26,6 +26,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" // hashtable_t #include "common.h" // tokenlist +#ifdef __cplusplus +extern "C" { +#endif + #define MAXGAMEEVENTS 128 #define LABEL_HASPARM2 1 #define LABEL_ISSTRING 2 @@ -102,7 +106,23 @@ typedef struct { extern vmstate_t vm; -#if !defined LUNATIC +void G_DoGameStartup(const int32_t *params); +void C_DefineMusic(int32_t vol, int32_t lev, const char *fn); + +#if defined LUNATIC +void C_DefineSound(int32_t sndidx, const char *fn, int32_t args[5]); +void C_DefineQuote(int32_t qnum, const char *qstr); +void C_DefineVolumeName(int32_t vol, const char *name); +void C_DefineSkillName(int32_t skill, const char *name); +void C_DefineLevelName(int32_t vol, int32_t lev, const char *fn, + int32_t partime, int32_t designertime, + const char *levelname); +void C_DefineGameFuncName(int32_t idx, const char *name); +void C_DefineGameType(int32_t idx, int32_t flags, const char *name); +int32_t C_SetDefName(const char *name); +void C_DefineProjectile(int32_t j, int32_t what, int32_t val); +void C_SetCfgName(const char *cfgname); +#else void C_ReportError(int32_t iError); void C_Compile(const char *filenam); @@ -948,4 +968,9 @@ enum ScriptKeywords_t }; // KEEPINSYNC with the keyword list in lunatic/con_lang.lua #endif + +#ifdef __cplusplus +} +#endif + #endif // gamedef_h_ diff --git a/polymer/eduke32/source/gamedefs.h b/polymer/eduke32/source/gamedefs.h index cdde40a7e..57c83b79d 100644 --- a/polymer/eduke32/source/gamedefs.h +++ b/polymer/eduke32/source/gamedefs.h @@ -30,8 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef gamedefs_public_h_ #define gamedefs_public_h_ -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif //**************************************************************************** @@ -128,8 +128,8 @@ enum }; -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif diff --git a/polymer/eduke32/source/gameexec.h b/polymer/eduke32/source/gameexec.h index 6817beb4a..dcbe205b5 100644 --- a/polymer/eduke32/source/gameexec.h +++ b/polymer/eduke32/source/gameexec.h @@ -32,6 +32,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # include "lunatic_game.h" #endif +#ifdef __cplusplus +extern "C" { +#endif + extern int32_t ticrandomseed; extern vmstate_t vm; @@ -92,4 +96,20 @@ void VM_ScriptInfo(void); OSD_Printf("Line %d, %s: " Text, g_errorLineNum, keyw[g_tw], ## __VA_ARGS__); \ } while (0) +void G_GetTimeDate(int32_t *vals); +int32_t G_StartTrack(int32_t level); +int32_t A_Dodge(spritetype *s); +#ifdef LUNATIC +void G_ShowView(int32_t x, int32_t y, int32_t z, int32_t a, int32_t horiz, int32_t sect, + int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t unbiasedp); +void P_AddWeaponMaybeSwitchI(int32_t snum, int32_t weap); +void VM_FallSprite(int32_t i); +int32_t VM_ResetPlayer2(int32_t snum); +int32_t VM_CheckSquished2(int32_t i, int32_t snum); +#endif + +#ifdef __cplusplus +} +#endif + #endif diff --git a/polymer/eduke32/source/global.h b/polymer/eduke32/source/global.h index 3276247c5..ab90cfc17 100644 --- a/polymer/eduke32/source/global.h +++ b/polymer/eduke32/source/global.h @@ -50,6 +50,10 @@ G_EXTERN int32_t bakipos[MAXINTERPOLATIONS]; #include "sector.h" #include "quotes.h" +#ifdef __cplusplus +extern "C" { +#endif + G_EXTERN DukeStatus_t sbar; G_EXTERN actor_t actor[MAXSPRITES]; // g_tile: tile-specific data THAT DOES NOT CHANGE during the course of a game @@ -153,4 +157,8 @@ G_EXTERN char CheatKeys[2]; G_EXTERN char setupfilename[BMAX_PATH]; #endif +#ifdef __cplusplus +} +#endif + #endif diff --git a/polymer/eduke32/source/jaudiolib/src/linklist.h b/polymer/eduke32/source/jaudiolib/src/linklist.h index 4c29e77d6..731876ac2 100644 --- a/polymer/eduke32/source/jaudiolib/src/linklist.h +++ b/polymer/eduke32/source/jaudiolib/src/linklist.h @@ -19,8 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef linklist_h_ #define linklist_h_ -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif @@ -107,7 +107,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define LL_Move LL_MoveNode -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif diff --git a/polymer/eduke32/source/jmact/_control.h b/polymer/eduke32/source/jmact/_control.h index e888da046..a8ba88149 100644 --- a/polymer/eduke32/source/jmact/_control.h +++ b/polymer/eduke32/source/jmact/_control.h @@ -34,8 +34,8 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms #ifndef control_private_h_ #define control_private_h_ -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif @@ -185,7 +185,7 @@ typedef struct // //*************************************************************************** -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif diff --git a/polymer/eduke32/source/jmact/_scrplib.h b/polymer/eduke32/source/jmact/_scrplib.h index 663a6cecf..0ac6fe7c8 100644 --- a/polymer/eduke32/source/jmact/_scrplib.h +++ b/polymer/eduke32/source/jmact/_scrplib.h @@ -31,8 +31,8 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au) #ifndef scriplib_private_h_ #define scriplib_private_h_ -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif #define SCRIPTSECTIONSTART ('[') @@ -203,7 +203,7 @@ void SCRIPT_AddEntry void SCRIPT_DecodeToken ( int32_t scripthandle, char * str ); -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif diff --git a/polymer/eduke32/source/jmact/animlib.h b/polymer/eduke32/source/jmact/animlib.h index 25289e908..d5b165a7a 100644 --- a/polymer/eduke32/source/jmact/animlib.h +++ b/polymer/eduke32/source/jmact/animlib.h @@ -33,8 +33,8 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au) #ifndef animlib_public_h_ #define animlib_public_h_ -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif //**************************************************************************** @@ -86,7 +86,7 @@ uint8_t * ANIM_DrawFrame(int32_t framenumber); uint8_t * ANIM_GetPalette(void); -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif diff --git a/polymer/eduke32/source/jmact/control.h b/polymer/eduke32/source/jmact/control.h index 9293a5e57..79e7232e6 100644 --- a/polymer/eduke32/source/jmact/control.h +++ b/polymer/eduke32/source/jmact/control.h @@ -33,8 +33,8 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au) #ifndef control_public_h_ #define control_public_h_ -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif @@ -212,7 +212,7 @@ void CONTROL_ProcessBinds(void); extern int32_t CONTROL_OSDInput[CONTROL_NUM_FLAGS]; extern int32_t CONTROL_SmoothMouse; -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif diff --git a/polymer/eduke32/source/jmact/file_lib.h b/polymer/eduke32/source/jmact/file_lib.h index cb4f52756..68263abbc 100644 --- a/polymer/eduke32/source/jmact/file_lib.h +++ b/polymer/eduke32/source/jmact/file_lib.h @@ -26,8 +26,8 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms #ifndef file_lib_public_ #define file_lib_public_ -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif enum @@ -254,7 +254,7 @@ int32_t ChangeDrive (char *drive); #endif -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif diff --git a/polymer/eduke32/source/jmact/joystick.h b/polymer/eduke32/source/jmact/joystick.h index 8fb377479..3bf70d299 100644 --- a/polymer/eduke32/source/jmact/joystick.h +++ b/polymer/eduke32/source/jmact/joystick.h @@ -2,8 +2,8 @@ #ifndef __joystick_h #define __joystick_h -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif #if defined(GEKKO) @@ -50,7 +50,7 @@ int32_t JOYSTICK_GetAxis( int32_t a ); void JOYSTICK_ClearAxis( int32_t a ); void JOYSTICK_ClearAllAxes( void ); -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif /* __joystick_h */ diff --git a/polymer/eduke32/source/jmact/keyboard.h b/polymer/eduke32/source/jmact/keyboard.h index 20844eecc..64b7b6f25 100644 --- a/polymer/eduke32/source/jmact/keyboard.h +++ b/polymer/eduke32/source/jmact/keyboard.h @@ -27,8 +27,8 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au) #ifndef keyboard_public_h_ #define keyboard_public_h_ -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif #include "baselayer.h" // for the keyboard stuff @@ -100,7 +100,7 @@ kb_scancode KB_StringToScanCode( const char * string ); // convert a string int void KB_Startup( void ); void KB_Shutdown( void ); -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif diff --git a/polymer/eduke32/source/jmact/mathutil.c b/polymer/eduke32/source/jmact/mathutil.c index b43469e85..a13ff0490 100644 --- a/polymer/eduke32/source/jmact/mathutil.c +++ b/polymer/eduke32/source/jmact/mathutil.c @@ -32,6 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #include "common.h" +#include "mathutil.h" int32_t FindDistance2D(int32_t x, int32_t y) { diff --git a/polymer/eduke32/source/jmact/mathutil.h b/polymer/eduke32/source/jmact/mathutil.h index 0b4b7fd14..66ec32f59 100644 --- a/polymer/eduke32/source/jmact/mathutil.h +++ b/polymer/eduke32/source/jmact/mathutil.h @@ -26,13 +26,13 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms */ //------------------------------------------------------------------------- -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif extern int32_t FindDistance2D(int32_t dx, int32_t dy); extern int32_t FindDistance3D(int32_t dx, int32_t dy, int32_t dz); -#ifdef EXTERNC +#ifdef __cplusplus } #endif diff --git a/polymer/eduke32/source/jmact/mouse.h b/polymer/eduke32/source/jmact/mouse.h index 4cc25890f..536fabb29 100644 --- a/polymer/eduke32/source/jmact/mouse.h +++ b/polymer/eduke32/source/jmact/mouse.h @@ -27,8 +27,8 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au) #ifndef mouse_h_ #define mouse_h_ -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif #define LEFT_MOUSE 1 @@ -50,7 +50,7 @@ int32_t MOUSE_GetButtons( void ); #define MOUSE_ClearAllButtons() mouseb = 0 #define MOUSE_GetDelta(x, y) readmousexy(x,y) -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif /* __mouse_h */ diff --git a/polymer/eduke32/source/jmact/scriplib.h b/polymer/eduke32/source/jmact/scriplib.h index 0d8247bb1..355d88578 100644 --- a/polymer/eduke32/source/jmact/scriplib.h +++ b/polymer/eduke32/source/jmact/scriplib.h @@ -28,8 +28,8 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms #ifndef scriplib_public_h_ #define scriplib_public_h_ -#ifdef EXTERNC -{ +#ifdef __cplusplus +extern "C" { #endif /* @@ -294,7 +294,7 @@ void SCRIPT_PutDouble ); -#ifdef EXTERNC -}; +#ifdef __cplusplus +} #endif #endif diff --git a/polymer/eduke32/source/lunatic/lunatic_game.c b/polymer/eduke32/source/lunatic/lunatic_game.c index 690f22080..1191bbcab 100644 --- a/polymer/eduke32/source/lunatic/lunatic_game.c +++ b/polymer/eduke32/source/lunatic/lunatic_game.c @@ -77,9 +77,6 @@ extern int luaopen_lpeg(lua_State *L); #endif -typedef struct { - uint32_t x, y, z, c; -} rng_jkiss_t; // See: Good Practice in (Pseudo) Random Number Generation for // Bioinformatics Applications, by David Jones @@ -283,12 +280,6 @@ LUNATIC_EXTERN void El_OnError(const char *str) } } -static void El_OnOutOfMem(void) -{ - extern void G_GameExit(const char *msg); - G_GameExit("Out of memory in Lunatic."); -} - void El_ClearErrors(void) { int32_t i; @@ -360,6 +351,9 @@ static int32_t SetTweakTracebackMsg_CF(lua_State *L) // http://www.freelists.org/post/luajit/intermitten-lua-pcall-crash-on-x86-64-linux,1 // Some of these are duplicate declarations: +#ifdef __cplusplus +extern "C" { +#endif extern void P_AddWeaponMaybeSwitchI(int32_t snum, int32_t weap); extern void P_CheckWeaponI(int32_t snum); extern int32_t A_ShootWithZvel(int32_t i, int32_t atwith, int32_t override_zvel); @@ -376,6 +370,10 @@ extern int32_t A_PlaySound(uint32_t num, int32_t i); extern void A_DeleteSprite(int32_t s); extern void G_ShowView(int32_t x, int32_t y, int32_t z, int32_t a, int32_t horiz, int32_t sect, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t unbiasedp); +extern void G_GameExit(const char *msg); +#ifdef __cplusplus +} +#endif #define LARG(index) lua_tointeger(L, index) @@ -487,6 +485,11 @@ static void El_StateSetup(lua_State *L) lua_pushcfunction(L, &our_traceback_CF); } +static void El_OnOutOfMem(void) +{ + G_GameExit("Out of memory in Lunatic."); +} + // 0: success, <0: failure int32_t El_CreateState(L_State *estate, const char *name) { diff --git a/polymer/eduke32/source/lunatic/lunatic_game.h b/polymer/eduke32/source/lunatic/lunatic_game.h index facf47761..bee71049c 100644 --- a/polymer/eduke32/source/lunatic/lunatic_game.h +++ b/polymer/eduke32/source/lunatic/lunatic_game.h @@ -7,6 +7,9 @@ #include "events_defs.h" // MAXEVENTS #include "actors.h" // con_move_t, con_action_t +#ifdef __cplusplus +extern "C" { +#endif extern L_State g_ElState; @@ -48,4 +51,15 @@ extern int32_t (*El_RestoreGamevars)(const char *savecode); static inline int32_t El_HaveEvent(int32_t eventidx) { return g_elEvents[eventidx]!=0; } static inline int32_t El_HaveActor(int32_t actortile) { return g_elActors[actortile].haveit!=0; } +typedef struct { + uint32_t x, y, z, c; +} rng_jkiss_t; + +uint32_t rand_jkiss_u32(rng_jkiss_t *s); +double rand_jkiss_dbl(rng_jkiss_t *s); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/polymer/eduke32/source/lunatic/lunatic_m32.h b/polymer/eduke32/source/lunatic/lunatic_m32.h index d860ec630..daad9e455 100644 --- a/polymer/eduke32/source/lunatic/lunatic_m32.h +++ b/polymer/eduke32/source/lunatic/lunatic_m32.h @@ -5,7 +5,15 @@ #include "lunatic.h" +#ifdef __cplusplus +extern "C" { +#endif + int Em_CreateState(L_State *estate); void Em_DestroyState(L_State *estate); +#ifdef __cplusplus +} +#endif + #endif diff --git a/polymer/eduke32/source/m32common.c b/polymer/eduke32/source/m32common.c index 1a64563bb..c94ecb36f 100644 --- a/polymer/eduke32/source/m32common.c +++ b/polymer/eduke32/source/m32common.c @@ -1896,6 +1896,15 @@ static void FuncMenu_Process(const StatusBarMenu *m, int32_t col, int32_t row) #ifdef LUNATIC typedef const char *(*luamenufunc_t)(void); +#ifdef __cplusplus +extern "C" { +#endif +extern void LM_Register(const char *name, luamenufunc_t funcptr, const char *description); +extern void LM_Clear(void); +#ifdef __cplusplus +} +#endif + static int32_t g_numLuaFuncs = 0; static luamenufunc_t g_LuaFuncPtrs[MENU_MAX_ENTRIES]; diff --git a/polymer/eduke32/source/menus.h b/polymer/eduke32/source/menus.h index 2b75b3abd..6d1d4c230 100644 --- a/polymer/eduke32/source/menus.h +++ b/polymer/eduke32/source/menus.h @@ -25,6 +25,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" +#ifdef __cplusplus +extern "C" { +#endif + #if defined(__ANDROID__) #define DROIDMENU #endif @@ -378,4 +382,8 @@ void M_OpenMenu(size_t playerID); void M_CloseMenu(size_t playerID); void M_DisplayMenus(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/polymer/eduke32/source/osdcmds.h b/polymer/eduke32/source/osdcmds.h index 2be78e39d..89e9e1870 100644 --- a/polymer/eduke32/source/osdcmds.h +++ b/polymer/eduke32/source/osdcmds.h @@ -23,6 +23,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef osdcmds_h_ #define osdcmds_h_ +#ifdef __cplusplus +extern "C" { +#endif + struct osdcmd_cheatsinfo { int32_t cheatnum; // -1 = none, else = see DoCheats() int32_t volume,level; @@ -44,5 +48,9 @@ typedef struct { extern const keydef_t ConsoleKeys[]; extern const char *const ConsoleButtons[]; +#ifdef __cplusplus +} +#endif + #endif // osdcmds_h_ diff --git a/polymer/eduke32/source/player.h b/polymer/eduke32/source/player.h index 605b73a5a..7629ae485 100644 --- a/polymer/eduke32/source/player.h +++ b/polymer/eduke32/source/player.h @@ -23,6 +23,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef player_h_ #define player_h_ +#ifdef __cplusplus +extern "C" { +#endif + extern int32_t playerswhenstarted; #define MOVEFIFOSIZ 2 @@ -376,6 +380,8 @@ void P_QuickKill(DukePlayer_t *p); void P_SelectNextInvItem(DukePlayer_t *p); void P_UpdateScreenPal(DukePlayer_t *p); +void P_CheckWeaponI(int32_t snum); + #if !defined LUNATIC void P_SetWeaponGamevars(int32_t snum, const DukePlayer_t *p); #else @@ -412,4 +418,8 @@ static inline int32_t P_Get(int32_t spritenum) return P_GetP(&sprite[spritenum]); } +#ifdef __cplusplus +} +#endif + #endif diff --git a/polymer/eduke32/source/premap.h b/polymer/eduke32/source/premap.h index d874d8687..04b2a5d83 100644 --- a/polymer/eduke32/source/premap.h +++ b/polymer/eduke32/source/premap.h @@ -23,6 +23,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef premap_h_ #define premap_h_ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { int32_t x1, y1; int32_t xdimen, ydimen; @@ -54,4 +58,8 @@ void G_ClearFIFO(void); void G_SetupCamTile(int32_t i,int32_t wn); void G_ResetInterpolations(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/polymer/eduke32/source/savegame.h b/polymer/eduke32/source/savegame.h index 21d24c8c0..3e1d32e45 100644 --- a/polymer/eduke32/source/savegame.h +++ b/polymer/eduke32/source/savegame.h @@ -25,6 +25,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "game.h" +#ifdef __cplusplus +extern "C" { +#endif + #ifdef LUNATIC # define SV_MAJOR_VER 2 #else @@ -95,6 +99,11 @@ void G_Util_PtrToIdx2(void *ptr, int32_t count, size_t stride, const void *base, #ifdef LUNATIC extern const char *(*El_SerializeGamevars)(int32_t *slenptr, int32_t levelnum); +void El_FreeSaveCode(void); +#endif + +#ifdef __cplusplus +} #endif #endif diff --git a/polymer/eduke32/source/sector.h b/polymer/eduke32/source/sector.h index c3a275a4f..8920b2e77 100644 --- a/polymer/eduke32/source/sector.h +++ b/polymer/eduke32/source/sector.h @@ -28,6 +28,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "player.h" // playerspawn_t #include "namesdyn.h" // for G_GetForcefieldPicnum() +#ifdef __cplusplus +extern "C" { +#endif + #define MAXCYCLERS 1024 #define MAXANIMATES 256 #define MAXANIMWALLS 512 @@ -143,6 +147,10 @@ static inline int32_t G_GetForcefieldPicnum(int32_t wallnum) return picnum; } +#ifdef __cplusplus +} +#endif + #include "sector_inline.h" #endif diff --git a/polymer/eduke32/source/sector_inline.h b/polymer/eduke32/source/sector_inline.h index 90952effb..ef447892a 100644 --- a/polymer/eduke32/source/sector_inline.h +++ b/polymer/eduke32/source/sector_inline.h @@ -23,8 +23,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef sector_inline_h_ #define sector_inline_h_ +#ifdef __cplusplus +extern "C" { +#endif + EXTERN_INLINE_HEADER int32_t G_CheckPlayerInSector(int32_t sect); +#ifdef __cplusplus +} +#endif + #ifndef DISABLE_INLINING #include "sector_inline.c" #endif diff --git a/polymer/eduke32/source/sounds.h b/polymer/eduke32/source/sounds.h index 1f3ccef0b..31a22701a 100644 --- a/polymer/eduke32/source/sounds.h +++ b/polymer/eduke32/source/sounds.h @@ -31,6 +31,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sounds_common.h" +#ifdef __cplusplus +extern "C" { +#endif + // KEEPINSYNC lunatic/con_lang.lua #define MAXSOUNDS 4096 #define MAXSOUNDINSTANCES 8 @@ -106,4 +110,8 @@ static inline int32_t S_IsAmbientSFX(int32_t i) return (sprite[i].picnum==MUSICANDSFX && sprite[i].lotag < 999); } +#ifdef __cplusplus +} +#endif + #endif diff --git a/polymer/eduke32/source/testgame/src/game.c b/polymer/eduke32/source/testgame/src/game.c index 36a020c9b..20309443b 100644 --- a/polymer/eduke32/source/testgame/src/game.c +++ b/polymer/eduke32/source/testgame/src/game.c @@ -456,8 +456,6 @@ static int osdcmd_map(const osdfuncparm_t *parm) { return OSDCMD_OK; } -extern int startwin_run(void); - int32_t app_main(int32_t argc, const char **argv) { #if defined STARTUP_SETUP_WINDOW