diff --git a/Source/appfat.h b/Source/appfat.h index d0089cb53..f7d06af05 100644 --- a/Source/appfat.h +++ b/Source/appfat.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern char sz_error_buf[256]; extern BOOL terminating; extern int cleanup_thread_id; @@ -32,6 +36,10 @@ void DiskFreeDlg(char *error); void InsertCDDlg(const char *fileName); void DirErrorDlg(char *error); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __APPFAT_H__ */ diff --git a/Source/automap.h b/Source/automap.h index 85aab23b2..49cc6d307 100644 --- a/Source/automap.h +++ b/Source/automap.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern WORD automaptype[512]; extern BOOL automapflag; extern char AmShiftTab[31]; @@ -38,6 +42,10 @@ void DrawAutomapText(); void SetAutomapView(int x, int y); void AutomapZoomReset(); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __AUTOMAP_H__ */ diff --git a/Source/capture.h b/Source/capture.h index f8879e046..fa8d0934d 100644 --- a/Source/capture.h +++ b/Source/capture.h @@ -8,8 +8,16 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + void CaptureScreen(); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __CAPTURE_H__ */ diff --git a/Source/codec.h b/Source/codec.h index 78b1f780f..caf929337 100644 --- a/Source/codec.h +++ b/Source/codec.h @@ -8,11 +8,19 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + int codec_decode(BYTE *pbSrcDst, DWORD size, char *pszPassword); void codec_init_key(int unused, char *pszPassword); DWORD codec_get_encoded_len(DWORD dwSrcBytes); void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, char *pszPassword); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __CODEC_H__ */ diff --git a/Source/control.h b/Source/control.h index 5af6b989c..2266f3200 100644 --- a/Source/control.h +++ b/Source/control.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BYTE *pDurIcons; extern BYTE *pChrButtons; extern BOOL drawhpflag; @@ -139,6 +143,10 @@ extern char *PanBtnStr[8]; extern RECT32 ChrBtnsRect[4]; extern int SpellPages[6][7]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __CONTROL_H__ */ diff --git a/Source/cursor.h b/Source/cursor.h index 3501e31ed..3c77c428e 100644 --- a/Source/cursor.h +++ b/Source/cursor.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int cursW; extern int cursH; extern int pcursmonst; @@ -39,6 +43,10 @@ void CheckCursMove(); extern const int InvItemWidth[]; extern const int InvItemHeight[]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __CURSOR_H__ */ diff --git a/Source/dead.h b/Source/dead.h index 1f6160d45..16c3c5243 100644 --- a/Source/dead.h +++ b/Source/dead.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int spurtndx; extern DeadStruct dead[MAXDEAD]; extern int stonendx; @@ -16,6 +20,10 @@ void InitDead(); void AddDead(int dx, int dy, char dv, int ddir); void SetDead(); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __DEAD_H__ */ diff --git a/Source/debug.h b/Source/debug.h index 691f67a6a..1a210a41e 100644 --- a/Source/debug.h +++ b/Source/debug.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BYTE *pSquareCel; extern char dMonsDbg[NUMLEVELS][MAXDUNX][MAXDUNY]; extern char dFlagDbg[NUMLEVELS][MAXDUNX][MAXDUNY]; @@ -29,6 +33,10 @@ void GetDebugMonster(); void NextDebugMonster(); #endif +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __DEBUG_H__ */ diff --git a/Source/diablo.h b/Source/diablo.h index 572d0273f..98d4a258c 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern SDL_Window *ghMainWnd; extern DWORD glSeedTbl[NUMLEVELS]; extern int gnLevelTypeTbl[NUMLEVELS]; @@ -105,6 +109,10 @@ extern BOOL FriendlyMode; extern char *spszMsgTbl[4]; extern char *spszMsgHotKeyTbl[4]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __DIABLO_H__ */ diff --git a/Source/doom.h b/Source/doom.h index 26a50c08f..30ca5f034 100644 --- a/Source/doom.h +++ b/Source/doom.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int doom_quest_time; extern int doom_stars_drawn; extern BYTE *pDoomCel; @@ -26,6 +30,10 @@ void doom_init(); void doom_close(); void doom_draw(); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __DOOM_H__ */ diff --git a/Source/drlg_l1.h b/Source/drlg_l1.h index e6b32d1a9..a63b22db3 100644 --- a/Source/drlg_l1.h +++ b/Source/drlg_l1.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BYTE L5dungeon[80][80]; extern BYTE L5dflags[DMAXX][DMAXY]; extern BOOL L5setloadflag; @@ -40,6 +44,10 @@ extern const BYTE PWATERIN[]; /* data */ extern BYTE L5ConvTbl[16]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __DRLG_L1_H__ */ diff --git a/Source/drlg_l2.h b/Source/drlg_l2.h index 56673ba5f..5fdb0a188 100644 --- a/Source/drlg_l2.h +++ b/Source/drlg_l2.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int nSx1; extern int nSy1; extern int nSx2; @@ -147,6 +151,10 @@ extern BYTE CTRDOOR7[]; extern BYTE CTRDOOR8[]; extern int Patterns[100][10]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __DRLG_L2_H__ */ diff --git a/Source/drlg_l3.h b/Source/drlg_l3.h index b928eec39..7e75b32e9 100644 --- a/Source/drlg_l3.h +++ b/Source/drlg_l3.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BOOLEAN lavapool; extern int abyssx; extern int lockoutcnt; @@ -63,6 +67,10 @@ extern const BYTE L3XTRA4[4]; extern const BYTE L3XTRA5[4]; extern const BYTE L3ANVIL[244]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __DRLG_L3_H__ */ diff --git a/Source/drlg_l4.h b/Source/drlg_l4.h index 8e2e22c42..ef1463bbe 100644 --- a/Source/drlg_l4.h +++ b/Source/drlg_l4.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int diabquad1x; extern int diabquad1y; extern int diabquad2x; @@ -51,6 +55,10 @@ extern const BYTE L4PENTA[52]; extern const BYTE L4PENTA2[52]; extern const BYTE L4BTYPES[140]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __DRLG_L4_H__ */ diff --git a/Source/dthread.h b/Source/dthread.h index a440644ff..a695ccbc6 100644 --- a/Source/dthread.h +++ b/Source/dthread.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern SDL_threadID glpDThreadId; extern BOOLEAN dthread_running; @@ -18,6 +22,10 @@ unsigned int dthread_handler(void *data); void dthread_cleanup(); /* data */ +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __DTHREAD_H__ */ diff --git a/Source/dx.h b/Source/dx.h index f153b312d..f91206209 100644 --- a/Source/dx.h +++ b/Source/dx.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BYTE *gpBuffer; extern char gbBackBuf; extern char gbEmulate; @@ -27,6 +31,10 @@ void PaletteGetEntries(DWORD dwNumEntries, SDL_Color *lpEntries); void PaletteSetEntries(DWORD dwCount, SDL_Color *lpEntries); /* data */ +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __DX_H__ */ diff --git a/Source/effects.h b/Source/effects.h index e3e3a3ed7..7c09ce4ce 100644 --- a/Source/effects.h +++ b/Source/effects.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int sfxdelay; extern int sfxdnum; extern HANDLE sghStream; @@ -39,6 +43,10 @@ void effects_play_sound(char *snd_file); extern const char MonstSndChar[]; /* data */ +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __EFFECTS_H__ */ diff --git a/Source/encrypt.h b/Source/encrypt.h index a5a73de84..561acb1c5 100644 --- a/Source/encrypt.h +++ b/Source/encrypt.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern DWORD hashtable[5][256]; void Decrypt(DWORD *castBlock, DWORD size, DWORD key); @@ -19,6 +23,10 @@ unsigned int PkwareBufferRead(char *buf, unsigned int *size, void *param); void PkwareBufferWrite(char *buf, unsigned int *size, void *param); void PkwareDecompress(BYTE *pbInBuff, int recv_size, int dwMaxBytes); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __ENCRYPT_H__ */ diff --git a/Source/engine.h b/Source/engine.h index 0d8580193..8811043ae 100644 --- a/Source/engine.h +++ b/Source/engine.h @@ -15,6 +15,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + //offset 0 //pCelBuff->pFrameTable[0] @@ -100,6 +104,10 @@ void PlayInGameMovie(char *pszMovie); extern const int RndInc; extern const int RndMult; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __ENGINE_H__ */ diff --git a/Source/error.h b/Source/error.h index 6ca804466..49b2a9f89 100644 --- a/Source/error.h +++ b/Source/error.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern char msgtable[MAX_SEND_STR_LEN]; extern DWORD msgdelay; extern char msgflag; @@ -20,6 +24,10 @@ void DrawDiabloMsg(); /* data */ extern char *MsgStrings[]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __ERROR_H__ */ diff --git a/Source/gamemenu.h b/Source/gamemenu.h index a03cb9fd5..d39630a22 100644 --- a/Source/gamemenu.h +++ b/Source/gamemenu.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + void gamemenu_on(); void gamemenu_update_single(TMenuItem *pMenuItems); void gamemenu_update_multi(TMenuItem *pMenuItems); @@ -37,6 +41,10 @@ extern char *music_toggle_names[]; extern char *sound_toggle_names[]; extern char *color_cycling_toggle_names[]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __GAMEMENU_H__ */ diff --git a/Source/gendung.h b/Source/gendung.h index ab6727b0e..8ff64e282 100644 --- a/Source/gendung.h +++ b/Source/gendung.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BYTE dungeon[DMAXX][DMAXY]; extern BYTE pdungeon[DMAXX][DMAXY]; extern char dflags[DMAXX][DMAXY]; @@ -91,6 +95,10 @@ void DRLG_HoldThemeRooms(); BOOL SkipThemeRoom(int x, int y); void InitLevels(); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __GENDUNG_H__ */ diff --git a/Source/gmenu.h b/Source/gmenu.h index c2549c6f5..336b85ec6 100644 --- a/Source/gmenu.h +++ b/Source/gmenu.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BYTE *optbar_cel; extern BOOLEAN mouseNavigation; extern BYTE *PentSpin_cel; @@ -45,6 +49,10 @@ void gmenu_slider_steps(TMenuItem *pItem, int dwTicks); extern const BYTE lfontframe[]; extern const BYTE lfontkern[]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __GMENU_H__ */ diff --git a/Source/help.h b/Source/help.h index 61a0c4312..75e60446f 100644 --- a/Source/help.h +++ b/Source/help.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int help_select_line; extern int dword_634494; extern BOOL helpflag; @@ -24,6 +28,10 @@ void HelpScrollDown(); /* rdata */ extern const char gszHelpText[]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __HELP_H__ */ diff --git a/Source/init.h b/Source/init.h index eadfb69ef..6c33f488c 100644 --- a/Source/init.h +++ b/Source/init.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern _SNETVERSIONDATA fileinfo; extern int gbActive; extern char diablo_exe_path[MAX_PATH]; @@ -38,6 +42,10 @@ extern BOOL was_window_init; /** defined in dx.cpp */ extern char gszVersionNumber[MAX_PATH]; extern char gszProductName[MAX_PATH]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __INIT_H__ */ diff --git a/Source/interfac.h b/Source/interfac.h index b47ac443c..e0835732c 100644 --- a/Source/interfac.h +++ b/Source/interfac.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int progress_id; void interface_msg_pump(); @@ -23,6 +27,10 @@ void InitCutscene(unsigned int uMsg); extern const BYTE BarColor[3]; extern const int BarPos[3][2]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __INTERFAC_H__ */ diff --git a/Source/inv.h b/Source/inv.h index 3feb1bd14..779d9c0ef 100644 --- a/Source/inv.h +++ b/Source/inv.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BOOL invflag; extern BOOL drawsbarflag; extern const InvXY InvRect[73]; @@ -57,6 +61,10 @@ BOOL DropItemBeforeTrig(); extern int AP2x2Tbl[10]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __INV_H__ */ diff --git a/Source/itemdat.h b/Source/itemdat.h index 8ac826e39..f67e826fa 100644 --- a/Source/itemdat.h +++ b/Source/itemdat.h @@ -8,11 +8,19 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern ItemDataStruct AllItemsList[]; extern const PLStruct PL_Prefix[]; extern const PLStruct PL_Suffix[]; extern const UItemStruct UniqueItemList[]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __ITEMDAT_H__ */ diff --git a/Source/items.h b/Source/items.h index bacb74111..6d43bd70f 100644 --- a/Source/items.h +++ b/Source/items.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int itemactive[MAXITEMS]; extern BOOL uitemflag; extern int itemavail[MAXITEMS]; @@ -142,6 +146,10 @@ extern int ItemInvSnds[]; extern int idoppely; extern int premiumlvladd[6]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __ITEMS_H__ */ diff --git a/Source/lighting.h b/Source/lighting.h index 4ee959290..bceb0e80d 100644 --- a/Source/lighting.h +++ b/Source/lighting.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern LightListStruct VisionList[MAXVISION]; extern BYTE lightactive[MAXLIGHTS]; extern LightListStruct LightList[MAXLIGHTS]; @@ -58,6 +62,10 @@ extern BYTE vCrawlTable[23][30]; extern BYTE byte_49463C[18][18]; extern BYTE RadiusAdj[23]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __LIGHTING_H__ */ diff --git a/Source/loadsave.h b/Source/loadsave.h index 7c03e8c4d..2ff97c212 100644 --- a/Source/loadsave.h +++ b/Source/loadsave.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BYTE *tbuff; void LoadGame(BOOL firstflag); @@ -47,6 +51,10 @@ void SavePortal(int i); void SaveLevel(); void LoadLevel(); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __LOADSAVE_H__ */ diff --git a/Source/mainmenu.h b/Source/mainmenu.h index 995d174ba..f147a0ed4 100644 --- a/Source/mainmenu.h +++ b/Source/mainmenu.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern char gszHero[16]; void mainmenu_refresh_music(); @@ -33,6 +37,10 @@ void mainmenu_play_intro(); extern int menu_music_track_id; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __MAINMENU_H__ */ diff --git a/Source/minitext.h b/Source/minitext.h index 3749005c6..e9ff0cd36 100644 --- a/Source/minitext.h +++ b/Source/minitext.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int qtexty; extern char *qtextptr; extern BOOLEAN qtextflag; @@ -30,6 +34,10 @@ extern const BYTE mfontkern[56]; extern int qscroll_spd_tbl[9]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __MINITEXT_H__ */ diff --git a/Source/misdat.h b/Source/misdat.h index 6de69171f..0744f640d 100644 --- a/Source/misdat.h +++ b/Source/misdat.h @@ -8,9 +8,17 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern MissileData missiledata[]; extern MisFileData misfiledata[]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __MISDAT_H__ */ diff --git a/Source/missiles.h b/Source/missiles.h index dfbfe2abc..941110d56 100644 --- a/Source/missiles.h +++ b/Source/missiles.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int missileactive[MAXMISSILES]; extern int missileavail[MAXMISSILES]; extern MissileStruct missile[MAXMISSILES]; @@ -157,6 +161,10 @@ void ClearMissileSpot(int mi); extern int XDirAdd[8]; extern int YDirAdd[8]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __MISSILES_H__ */ diff --git a/Source/monstdat.h b/Source/monstdat.h index 491654d60..35738ac03 100644 --- a/Source/monstdat.h +++ b/Source/monstdat.h @@ -8,11 +8,19 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern MonsterData monsterdata[]; extern BYTE MonstConvTbl[]; extern BYTE MonstAvailTbl[]; extern UniqMonstStruct UniqMonst[]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __MONSTDAT_H__ */ diff --git a/Source/monster.h b/Source/monster.h index fb544292b..7ba21589d 100644 --- a/Source/monster.h +++ b/Source/monster.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int MissileFileFlag; extern int monstkills[MAXMONSTERS]; extern int monstactive[MAXMONSTERS]; @@ -191,6 +195,10 @@ extern int rnd60[4]; extern void (*AiProc[])(int i); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __MONSTER_H__ */ diff --git a/Source/movie.h b/Source/movie.h index bcd88798f..9c4e2a1b7 100644 --- a/Source/movie.h +++ b/Source/movie.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BYTE movie_playing; extern BOOL loop_movie; @@ -16,6 +20,10 @@ LRESULT MovieWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); /* rdata */ +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __MOVIE_H__ */ diff --git a/Source/mpqapi.h b/Source/mpqapi.h index 2d420181f..608dea57b 100644 --- a/Source/mpqapi.h +++ b/Source/mpqapi.h @@ -10,6 +10,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BYTE mpq_buf[4096]; extern BOOL save_archive_modified; extern BOOLEAN save_archive_open; @@ -31,6 +35,10 @@ BOOL mpqapi_flush_and_close(const char *pszArchive, BOOL bFree, DWORD dwChar); /* rdata */ /* data */ +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __MPQAPI_H__ */ diff --git a/Source/msg.h b/Source/msg.h index deab58434..15aedd112 100644 --- a/Source/msg.h +++ b/Source/msg.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BOOL deltaload; extern BYTE gbBufferMsgs; extern int dwRecCount; @@ -148,6 +152,10 @@ DWORD On_NOVA(TCmd *pCmd, int pnum); DWORD On_SETSHIELD(TCmd *pCmd, int pnum); DWORD On_REMSHIELD(TCmd *pCmd, int pnum); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __MSG_H__ */ diff --git a/Source/multi.h b/Source/multi.h index 4d47fb018..754374dd6 100644 --- a/Source/multi.h +++ b/Source/multi.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BOOLEAN gbSomebodyWonGameKludge; extern char szPlayerDescript[128]; extern WORD sgwPackPlrOffsetTbl[MAX_PLRS]; @@ -62,6 +66,10 @@ void recv_plrinfo(int pnum, TCmdPlrInfoHdr *p, BOOL recv); extern const int event_types[3]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __MULTI_H__ */ diff --git a/Source/nthread.h b/Source/nthread.h index 367b86561..c416e6cd5 100644 --- a/Source/nthread.h +++ b/Source/nthread.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BYTE sgbNetUpdateRate; extern DWORD gdwMsgLenTbl[MAX_PLRS]; extern DWORD gdwDeltaBytesSec; @@ -32,6 +36,10 @@ void nthread_ignore_mutex(BOOL bStart); BOOL nthread_has_500ms_passed(BOOL unused); /* rdata */ +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __NTHREAD_H__ */ diff --git a/Source/objdat.h b/Source/objdat.h index 5fed8a71b..a0f00b09c 100644 --- a/Source/objdat.h +++ b/Source/objdat.h @@ -4,10 +4,18 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int ObjTypeConv[]; extern ObjDataStruct AllObjects[99]; extern char *ObjMasterLoadList[56]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __OBJDAT_H__ */ diff --git a/Source/objects.h b/Source/objects.h index 528c4b65a..bb2e95100 100644 --- a/Source/objects.h +++ b/Source/objects.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int trapid; extern int trapdir; extern BYTE *pObjCels[40]; @@ -165,6 +169,10 @@ extern BYTE shrineavail[NUM_SHRINETYPE]; extern char *StoryBookName[9]; extern int StoryText[3][3]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __OBJECTS_H__ */ diff --git a/Source/pack.h b/Source/pack.h index 16c8447a0..87f601893 100644 --- a/Source/pack.h +++ b/Source/pack.h @@ -4,11 +4,19 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + void PackPlayer(PkPlayerStruct *pPack, int pnum, BOOL manashield); void VerifyGoldSeeds(PlayerStruct *pPlayer); void UnPackPlayer(PkPlayerStruct *pPack, int pnum, BOOL killok); /* rdata */ +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __PACK_H__ */ diff --git a/Source/palette.h b/Source/palette.h index b47a2de0d..91f863481 100644 --- a/Source/palette.h +++ b/Source/palette.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern SDL_Color logical_palette[256]; extern SDL_Color system_palette[256]; extern SDL_Color orig_palette[256]; @@ -34,6 +38,10 @@ BOOL palette_set_color_cycling(BOOL enabled); extern int gamma_correction; extern BOOL color_cycling_enabled; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __PALETTE_H__ */ diff --git a/Source/path.h b/Source/path.h index 0a9baf17e..dfc25062f 100644 --- a/Source/path.h +++ b/Source/path.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern PATHNODE path_nodes[MAXPATHNODES]; extern int gdwCurPathStep; extern int gdwCurNodes; @@ -40,6 +44,10 @@ extern const char pathydir[8]; /* data */ extern char path_directions[9]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __PATH_H__ */ diff --git a/Source/pfile.h b/Source/pfile.h index b8dde2c72..a49080635 100644 --- a/Source/pfile.h +++ b/Source/pfile.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BOOL gbValidSaveFile; void pfile_init_save_directory(); @@ -44,6 +48,10 @@ BYTE *pfile_read(const char *pszName, DWORD *pdwLen); void pfile_update(BOOL force_save); /* rdata */ +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __PFILE_H__ */ diff --git a/Source/player.h b/Source/player.h index f3508d50b..f97a12ebe 100644 --- a/Source/player.h +++ b/Source/player.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int plr_lframe_size; extern int plr_wframe_size; extern BYTE plr_gfx_flag; @@ -137,6 +141,10 @@ extern int ExpLvlsTbl[MAXCHARLEVEL]; extern char *ClassStrTbl[]; extern BYTE fix[9]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __PLAYER_H__ */ diff --git a/Source/plrmsg.h b/Source/plrmsg.h index 3f2aa6cfd..121576da2 100644 --- a/Source/plrmsg.h +++ b/Source/plrmsg.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern _plrmsg plr_msgs[PMSG_COUNT]; void plrmsg_delay(BOOL delay); @@ -19,6 +23,10 @@ void PrintPlrMsg(DWORD x, DWORD y, DWORD width, const char *str, BYTE col); extern const char text_color_from_player_num[MAX_PLRS + 1]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __PLRMSG_H__ */ diff --git a/Source/portal.h b/Source/portal.h index fa309d22a..5f8b25097 100644 --- a/Source/portal.h +++ b/Source/portal.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern PortalStruct portal[MAXPORTAL]; extern int portalindex; @@ -25,6 +29,10 @@ BOOL PosOkPortal(int lvl, int x, int y); extern int WarpDropX[MAXPORTAL]; extern int WarpDropY[MAXPORTAL]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __PORTAL_H__ */ diff --git a/Source/quests.h b/Source/quests.h index c21b0b875..5bb10701c 100644 --- a/Source/quests.h +++ b/Source/quests.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int qtopline; extern BOOL questlog; extern BYTE *pQLogCel; @@ -54,6 +58,10 @@ extern int QuestGroup2[3]; extern int QuestGroup3[3]; extern int QuestGroup4[2]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __QUESTS_H__ */ diff --git a/Source/render.h b/Source/render.h index 5a8fc6f69..c80fcad97 100644 --- a/Source/render.h +++ b/Source/render.h @@ -3,10 +3,18 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + void RenderTile(BYTE *pBuff); void world_draw_black_tile(int sx, int sy); void trans_rect(int sx, int sy, int width, int height); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __RENDER_H__ */ diff --git a/Source/restrict.h b/Source/restrict.h index 09e5096d1..b7584ccff 100644 --- a/Source/restrict.h +++ b/Source/restrict.h @@ -4,8 +4,16 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + void ReadOnlyTest(); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __RESTRICT_H__ */ diff --git a/Source/scrollrt.h b/Source/scrollrt.h index 8b619ab64..eb455e43c 100644 --- a/Source/scrollrt.h +++ b/Source/scrollrt.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern bool sgbControllerActive; extern int light_table_index; extern BYTE *gpBufStart; @@ -35,6 +39,10 @@ void DrawAndBlit(); extern char *szMonModeAssert[18]; extern char *szPlrModeAssert[12]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __SCROLLRT_H__ */ diff --git a/Source/setmaps.h b/Source/setmaps.h index 256e5a4ba..7df8c2230 100644 --- a/Source/setmaps.h +++ b/Source/setmaps.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + int ObjIndex(int x, int y); void AddSKingObjs(); void AddSChamObjs(); @@ -21,6 +25,10 @@ extern BYTE SkelChamTrans2[8]; extern BYTE SkelChamTrans3[36]; extern char *quest_level_names[]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __SETMAPS_H__ */ diff --git a/Source/sha.h b/Source/sha.h index e940d8e78..25be6a279 100644 --- a/Source/sha.h +++ b/Source/sha.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + #define SHA1HashSize 20 //sha @@ -16,6 +20,10 @@ void SHA1ProcessMessageBlock(SHA1Context *context); void SHA1Reset(int n); void SHA1Init(SHA1Context *context); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __SHA_H__ */ diff --git a/Source/sound.h b/Source/sound.h index 10cf37668..2595023c1 100644 --- a/Source/sound.h +++ b/Source/sound.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern SoundSample *DSBs[8]; extern BOOLEAN gbSndInited; extern HMODULE hDsound_dll; @@ -37,6 +41,10 @@ extern BOOLEAN gbSoundOn; extern BOOLEAN gbDupSounds; extern char unk_volume[4][2]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __SOUND_H__ */ diff --git a/Source/spelldat.h b/Source/spelldat.h index 1db3eb1ec..7edfa60a4 100644 --- a/Source/spelldat.h +++ b/Source/spelldat.h @@ -4,8 +4,16 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern SpellData spelldata[]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __SPELLDAT_H__ */ diff --git a/Source/spells.h b/Source/spells.h index a83b12ca0..a59b87a67 100644 --- a/Source/spells.h +++ b/Source/spells.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + int GetManaAmount(int id, int sn); void UseMana(int id, int sn); BOOL CheckSpell(int id, int sn, char st, BOOL manaonly); @@ -11,6 +15,10 @@ void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, int caster, int void DoResurrect(int pnum, int rid); void DoHealOther(int pnum, int rid); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __SPELLS_H__ */ diff --git a/Source/stores.h b/Source/stores.h index 28e8f8811..f3358b6f2 100644 --- a/Source/stores.h +++ b/Source/stores.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int stextup; extern int storenumh; extern int stextlhold; @@ -138,6 +142,10 @@ void ReleaseStoreBtn(); /* rdata */ extern char *talkname[9]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __STORES_H__ */ diff --git a/Source/sync.h b/Source/sync.h index a3e0bd95d..f3d98d073 100644 --- a/Source/sync.h +++ b/Source/sync.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern WORD sync_word_6AA708[MAXMONSTERS]; extern int sgnMonsters; extern WORD sgwLRU[MAXMONSTERS]; @@ -19,6 +23,10 @@ DWORD sync_update(int pnum, const BYTE *pbBuf); void sync_monster(int pnum, const TSyncMonster *p); void sync_init(); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __SYNC_H__ */ diff --git a/Source/textdat.h b/Source/textdat.h index e31208eb2..fff83b05e 100644 --- a/Source/textdat.h +++ b/Source/textdat.h @@ -4,8 +4,17 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern const TextDataStruct alltext[]; extern const DWORD gdwAllTextEntries; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE + #endif /* __TEXTDAT_H__ */ diff --git a/Source/themes.h b/Source/themes.h index 042d04130..9a852ea1e 100644 --- a/Source/themes.h +++ b/Source/themes.h @@ -8,6 +8,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern int numthemes; extern BOOL armorFlag; extern BOOL ThemeGoodIn[4]; @@ -65,5 +69,10 @@ extern int trm5y[25]; extern int trm3x[9]; extern int trm3y[9]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE + #endif /* __THEMES_H__ */ diff --git a/Source/tmsg.h b/Source/tmsg.h index aee6936f5..d8d674d25 100644 --- a/Source/tmsg.h +++ b/Source/tmsg.h @@ -4,10 +4,19 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + int tmsg_get(BYTE *pbMsg, DWORD dwMaxLen); void tmsg_add(BYTE *pbMsg, BYTE bLen); void tmsg_start(); void tmsg_cleanup(); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE + #endif /* __TMSG_H__ */ diff --git a/Source/town.h b/Source/town.h index 8898471b3..2f4bd952f 100644 --- a/Source/town.h +++ b/Source/town.h @@ -4,11 +4,20 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + void SetTownMicros(); void T_FillSector(BYTE *P3Tiles, BYTE *pSector, int xi, int yi, int w, int h); void T_FillTile(BYTE *P3Tiles, int xx, int yy, int t); void T_Pass3(); void CreateTown(int entry); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE + #endif /* __TOWN_H__ */ diff --git a/Source/towners.h b/Source/towners.h index 050c264ee..4a1e1776e 100644 --- a/Source/towners.h +++ b/Source/towners.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern TownerStruct towner[16]; int GetActiveTowner(int t); @@ -43,6 +47,10 @@ void CowSFX(int pnum); /* data */ extern QuestTalkData Qtalklist[]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __TOWNERS_H__ */ diff --git a/Source/track.h b/Source/track.h index 5bafb7fd2..99c42082a 100644 --- a/Source/track.h +++ b/Source/track.h @@ -4,10 +4,18 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + void track_process(); void track_repeat_walk(BOOL rep); BOOL track_isscrolling(); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __TRACK_H__ */ diff --git a/Source/trigs.h b/Source/trigs.h index a51930dbe..2bad3b8c4 100644 --- a/Source/trigs.h +++ b/Source/trigs.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + extern BOOL townwarps[3]; extern BOOL trigflag; extern int numtrigs; @@ -49,5 +53,10 @@ extern int L4DownList[6]; extern int L4TWarpUpList[4]; extern int L4PentaList[33]; +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE + #endif /* __TRIGS_H__ */ diff --git a/Source/wave.h b/Source/wave.h index 1805e2637..e77a2538a 100644 --- a/Source/wave.h +++ b/Source/wave.h @@ -4,6 +4,10 @@ DEVILUTION_BEGIN_NAMESPACE +#ifdef __cplusplus +extern "C" { +#endif + void WCloseFile(HANDLE file); LONG WGetFileSize(HANDLE hsFile, DWORD *lpFileSizeHigh, const char *FileName); void WGetFileArchive(HANDLE hsFile, DWORD *retry, const char *FileName); @@ -11,6 +15,10 @@ BOOL WOpenFile(const char *FileName, HANDLE *phsFile, BOOL mayNotExist); void WReadFile(HANDLE hsFile, LPVOID buf, DWORD to_read, const char *FileName); int WSetFilePointer(HANDLE file1, int offset, HANDLE file2, int whence); +#ifdef __cplusplus +} +#endif + DEVILUTION_END_NAMESPACE #endif /* __WAVE_H__ */