Skip to content

Commit

Permalink
pragma warning(disable) is only valid for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
th-otto committed Mar 24, 2024
1 parent 77e2da0 commit 7d10a4b
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 2 deletions.
2 changes: 2 additions & 0 deletions common/field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
#include "endianness.h"

// ST - 12/18/2018 10:14AM
#ifdef _MSC_VER
#pragma warning(disable : 4996)
#endif

FieldClass::FieldClass(const char* id, char data)
{
Expand Down
2 changes: 2 additions & 0 deletions common/graphicsviewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,9 @@ unsigned int GraphicViewPortClass::Print(char const* str, int x, int y, int fcol
return (return_code);
}

#ifdef _MSC_VER
#pragma warning(disable : 4996)
#endif

/***************************************************************************
* GVPC::PRINT -- Stub function to print an integer *
Expand Down
2 changes: 2 additions & 0 deletions common/packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ bool PacketClass::Get_Field(const char* id, int& data)
* HISTORY: *
* 04/23/1996 PWG : Created. *
*========================================================================*/
#ifdef _MSC_VER
#pragma warning(disable : 4996)
#endif
bool PacketClass::Get_Field(const char* id, char* data)
{
FieldClass* field = Find_Field(id);
Expand Down
2 changes: 2 additions & 0 deletions common/shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ typedef struct
/*
------------------------------- Shape block ---------------------------------
*/
#ifdef _MSC_VER
#pragma warning(disable : 4200)
#endif
#pragma pack(push, 2)
typedef struct
{
Expand Down
6 changes: 5 additions & 1 deletion redalert/dllinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
*/

// Exception handling isn't enabled
#ifdef _MSC_VER
#pragma warning(disable : 4530) // warning C4530: C++ exception handler used, but unwind semantics are not enabled.
#endif

#include <string>
#include <vector>
Expand Down Expand Up @@ -73,7 +75,9 @@ typedef __int64 int64;
**
*/
// For compatibility with Watcom in audio enums
#ifdef _MSC_VER
#pragma warning(disable : 4091)
#endif

// From RedAlert\Audio.cpp
typedef enum
Expand Down Expand Up @@ -8749,4 +8753,4 @@ void DLL_Code_Pointers(void)
void DLL_Decode_Pointers(void)
{
DLLExportClass::Decode_Pointers();
}
}
2 changes: 2 additions & 0 deletions tiberiandawn/conquer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3613,7 +3613,9 @@ static bool Change_Local_Dir(int cd)
* 07/11/1995 JLB : Created. *
* 05/22/1996 ST : Handles multiple CD drives / CD changers *
*=============================================================================================*/
#ifdef _MSC_VER
#pragma warning(disable : 4101)
#endif
bool Force_CD_Available(int cd)
{

Expand Down
4 changes: 4 additions & 0 deletions tiberiandawn/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@
// typedef enums with -1 will show this warning, even when the type of the enum is signed. It's a compiler bug,
// apparently ST - 1/8/2019 9:23AM
//
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4341)
#endif

/**********************************************************************
** These enumerations are used to implement RTTI.
Expand Down Expand Up @@ -3042,6 +3044,8 @@ typedef enum StrategyType : unsigned char

#endif // USE_RA_AI

#ifdef _MSC_VER
#pragma warning(pop)
#endif

#endif
4 changes: 3 additions & 1 deletion tiberiandawn/dllinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ typedef __int64 int64;
**
*/
// For compatibility with Watcom in audio enums
#ifdef _MSC_VER
#pragma warning(disable : 4091)
#endif

// From TiberianDawn\Audio.cpp
typedef enum
Expand Down Expand Up @@ -7721,4 +7723,4 @@ void DLL_Code_Pointers(void)
void DLL_Decode_Pointers(void)
{
DLLExportClass::Decode_Pointers();
}
}
2 changes: 2 additions & 0 deletions tiberiandawn/iomap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@

#include "function.h"

#ifdef _MSC_VER
#pragma warning(disable : 4302) // Truncation from pointer to TARGET
#endif

/***********************************************************************************************
* CellClass::Should_Save -- Should the cell be written to disk? *
Expand Down
2 changes: 2 additions & 0 deletions tiberiandawn/ioobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@

#include "function.h"

#ifdef _MSC_VER
#pragma warning(disable : 4302) // Truncation from pointer to TARGET
#endif

/***********************************************************************************************
* TeamTypeClass::Load -- Loads from a save game file. *
Expand Down

0 comments on commit 7d10a4b

Please sign in to comment.