diff --git a/common/studiobyteswap.cpp b/common/studiobyteswap.cpp index e8d39427..c305542f 100644 --- a/common/studiobyteswap.cpp +++ b/common/studiobyteswap.cpp @@ -22,9 +22,11 @@ #define ALIGN64( a ) a = (byte *)((int)((byte *)a + 63) & ~ 63) // Fixup macros create variables that may not be referenced +#ifdef _WIN32 #pragma warning( push ) #pragma warning( disable:4189 ) // local variable is initialized but not referenced #pragma warning( disable:4366 ) // The result of the unary '&' operator may be unaligned +#endif namespace StudioByteSwap { @@ -2433,7 +2435,9 @@ void ProcessMDLFields( void *pDataBase, datadescProcessFunc_t pfnProcessFunc ) } +#ifdef _WIN32 #pragma warning( pop ) // local variable is initialized but not referenced +#endif } // namespace StudioByteSwap diff --git a/fgdlib/gamedata.cpp b/fgdlib/gamedata.cpp index cd94b23d..bc5a147f 100644 --- a/fgdlib/gamedata.cpp +++ b/fgdlib/gamedata.cpp @@ -16,7 +16,9 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" +#ifdef _WIN32 #pragma warning(disable:4244) +#endif const int MAX_ERRORS = 5; diff --git a/game/client/animatedtextureproxy.cpp b/game/client/animatedtextureproxy.cpp index 8856435a..cf9ecf0c 100644 --- a/game/client/animatedtextureproxy.cpp +++ b/game/client/animatedtextureproxy.cpp @@ -20,7 +20,9 @@ public: EXPOSE_INTERFACE( CAnimatedTextureProxy, IMaterialProxy, "AnimatedTexture" IMATERIAL_PROXY_INTERFACE_VERSION ); +#ifdef _WIN32 #pragma warning (disable : 4100) +#endif float CAnimatedTextureProxy::GetAnimationStartTime( void* pBaseEntity ) { diff --git a/game/client/baseanimatedtextureproxy.h b/game/client/baseanimatedtextureproxy.h index 49107e0d..9ae5fa53 100644 --- a/game/client/baseanimatedtextureproxy.h +++ b/game/client/baseanimatedtextureproxy.h @@ -13,7 +13,9 @@ class IMaterial; class IMaterialVar; +#ifdef _WIN32 #pragma warning (disable : 4100) +#endif class CBaseAnimatedTextureProxy : public IMaterialProxy { diff --git a/game/client/camomaterialproxy.cpp b/game/client/camomaterialproxy.cpp index 0e0d5df0..bbad3933 100644 --- a/game/client/camomaterialproxy.cpp +++ b/game/client/camomaterialproxy.cpp @@ -8,7 +8,9 @@ #include "cbase.h" // identifier was truncated to '255' characters in the debug information +#ifdef _WIN32 #pragma warning(disable: 4786) +#endif #include "proxyentity.h" #include "materialsystem/imaterialvar.h" @@ -113,8 +115,9 @@ void CCamoTextureRegen::RegenerateTextureBits( ITexture *pTexture, IVTFTexture * m_pProxy->GenerateCamoTexture( pTexture, pVTFTexture ); } - +#ifdef _WIN32 #pragma warning (disable:4355) +#endif CCamoMaterialProxy::CCamoMaterialProxy() : m_TextureRegen(this) { @@ -136,7 +139,9 @@ CCamoMaterialProxy::CCamoMaterialProxy() : m_TextureRegen(this) m_pEnt = NULL; } +#ifdef _WIN32 #pragma warning (default:4355) +#endif CCamoMaterialProxy::~CCamoMaterialProxy() { diff --git a/game/client/detailobjectsystem.cpp b/game/client/detailobjectsystem.cpp index ede990de..a6e08d3a 100644 --- a/game/client/detailobjectsystem.cpp +++ b/game/client/detailobjectsystem.cpp @@ -247,13 +247,17 @@ protected: static CUtlMap gm_LightStylesMap; +#ifdef _WIN32 #pragma warning( disable : 4201 ) //warning C4201: nonstandard extension used : nameless struct/union +#endif union { model_t* m_pModel; SptrintInfo_t m_SpriteInfo; }; +#ifdef _WIN32 #pragma warning( default : 4201 ) +#endif #ifdef USE_DETAIL_SHAPES // pointer to advanced properties diff --git a/game/client/entity_client_tools.cpp b/game/client/entity_client_tools.cpp index 32261841..5861022d 100644 --- a/game/client/entity_client_tools.cpp +++ b/game/client/entity_client_tools.cpp @@ -17,7 +17,9 @@ #include "PortalRender.h" #endif +#ifdef _WIN32 #pragma warning( disable: 4355 ) // warning C4355: 'this' : used in base member initializer list +#endif class CClientTools; diff --git a/game/client/game_controls/baseviewport.cpp b/game/client/game_controls/baseviewport.cpp index ad07f4c7..5a711d62 100644 --- a/game/client/game_controls/baseviewport.cpp +++ b/game/client/game_controls/baseviewport.cpp @@ -11,7 +11,9 @@ // $NoKeywords: $ //=============================================================================// +#ifdef _WIN32 #pragma warning( disable : 4800 ) // disable forcing int to bool performance warning +#endif #include "cbase.h" #include diff --git a/game/client/interpolatedvar.cpp b/game/client/interpolatedvar.cpp index 582ef915..4f2e2af0 100644 --- a/game/client/interpolatedvar.cpp +++ b/game/client/interpolatedvar.cpp @@ -10,8 +10,10 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" +#ifdef _WIN32 // warning C4660: template-class specialization 'CInterpolatedVar' is already instantiated #pragma warning( disable : 4660 ) +#endif template class CInterpolatedVar; template class CInterpolatedVar; diff --git a/game/client/sdk/vgui/sdkviewport.cpp b/game/client/sdk/vgui/sdkviewport.cpp index 02bf368f..e9da5a1d 100644 --- a/game/client/sdk/vgui/sdkviewport.cpp +++ b/game/client/sdk/vgui/sdkviewport.cpp @@ -13,7 +13,9 @@ #include "cbase.h" +#ifdef _WIN32 #pragma warning( disable : 4800 ) // disable forcing int to bool performance warning +#endif // VGUI panel includes #include diff --git a/game/client/toggletextureproxy.h b/game/client/toggletextureproxy.h index 91b13f08..441af02c 100644 --- a/game/client/toggletextureproxy.h +++ b/game/client/toggletextureproxy.h @@ -13,7 +13,9 @@ class IMaterial; class IMaterialVar; +#ifdef _WIN32 #pragma warning (disable : 4100) +#endif class CBaseToggleTextureProxy : public IMaterialProxy { diff --git a/game/client/vgui_bitmapbutton.cpp b/game/client/vgui_bitmapbutton.cpp index 82969803..25c323d7 100644 --- a/game/client/vgui_bitmapbutton.cpp +++ b/game/client/vgui_bitmapbutton.cpp @@ -6,7 +6,10 @@ // $NoKeywords: $ //=============================================================================// #include "cbase.h" + +#ifdef _WIN32 #pragma warning (disable: 4514) +#endif #include "vgui_bitmapimage.h" #include "vgui_bitmapbutton.h" diff --git a/game/client/vgui_bitmappanel.cpp b/game/client/vgui_bitmappanel.cpp index 8fcb9f60..6b86cb29 100644 --- a/game/client/vgui_bitmappanel.cpp +++ b/game/client/vgui_bitmappanel.cpp @@ -6,7 +6,11 @@ // $NoKeywords: $ //=============================================================================// #include "cbase.h" + +#ifdef _WIN32 #pragma warning (disable: 4514) +#endif + #include "vgui_bitmappanel.h" #include #include "panelmetaclassmgr.h" diff --git a/game/server/ai_behavior.h b/game/server/ai_behavior.h index 87383683..94ced75d 100644 --- a/game/server/ai_behavior.h +++ b/game/server/ai_behavior.h @@ -15,11 +15,15 @@ #include "networkvar.h" #ifdef DEBUG +#ifdef _WIN32 #pragma warning(push) +#endif // _WIN32 #include +#ifdef _WIN32 #pragma warning(pop) #pragma warning(disable:4290) -#endif +#endif // _WIN32 +#endif // DEBUG #if defined( _WIN32 ) #pragma once diff --git a/game/server/ai_motor.cpp b/game/server/ai_motor.cpp index 4c1e03b1..36b1ccd1 100644 --- a/game/server/ai_motor.cpp +++ b/game/server/ai_motor.cpp @@ -34,8 +34,10 @@ void DebugNoteMovementFailure() } // a place to put breakpoints +#ifdef _WIN32 #pragma warning(push) #pragma warning(disable:4189) +#endif AIMoveResult_t DbgResult( AIMoveResult_t result ) { if ( result < AIMR_OK ) diff --git a/game/server/episodic/npc_advisor.cpp b/game/server/episodic/npc_advisor.cpp index b70ab7ea..32c90081 100644 --- a/game/server/episodic/npc_advisor.cpp +++ b/game/server/episodic/npc_advisor.cpp @@ -433,8 +433,10 @@ int __cdecl AdvisorStagingComparator(const EHANDLE *pe1, const EHANDLE *pe2) //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +#ifdef _WIN32 #pragma warning(push) #pragma warning(disable : 4706) +#endif void CNPC_Advisor::Activate() { @@ -468,7 +470,9 @@ void CNPC_Advisor::Activate() AssertMsg(m_hvStagingPositions.Count() > 0, "You did not specify any staging positions in the advisor's staging_ent_names !"); #endif } +#ifdef _WIN32 #pragma warning(pop) +#endif //----------------------------------------------------------------------------- diff --git a/game/server/hl2mp/hl2mp_player.cpp b/game/server/hl2mp/hl2mp_player.cpp index fa828031..9cfc920f 100644 --- a/game/server/hl2mp/hl2mp_player.cpp +++ b/game/server/hl2mp/hl2mp_player.cpp @@ -94,7 +94,9 @@ const char *g_ppszRandomCombineModels[] = #define HL2MPPLAYER_PHYSDAMAGE_SCALE 4.0f +#ifdef _WIN32 #pragma warning( disable : 4355 ) +#endif CHL2MP_Player::CHL2MP_Player() : m_PlayerAnimState( this ) { diff --git a/game/server/npc_talker.h b/game/server/npc_talker.h index 5ba3a768..e8ca3576 100644 --- a/game/server/npc_talker.h +++ b/game/server/npc_talker.h @@ -18,10 +18,14 @@ #ifndef _XBOX #undef min #undef max +#ifdef _WIN32 #pragma warning(push) +#endif // _WIN32 #include +#ifdef _WIN32 #pragma warning(pop) -#endif +#endif // _WIN32 +#endif // _XBOX #ifdef _WIN32 #pragma once diff --git a/game/server/vehicle_base.cpp b/game/server/vehicle_base.cpp index 73b46b99..9e506215 100644 --- a/game/server/vehicle_base.cpp +++ b/game/server/vehicle_base.cpp @@ -71,12 +71,16 @@ LINK_ENTITY_TO_CLASS( prop_vehicle, CPropVehicle ); //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- +#ifdef _WIN32 #pragma warning (disable:4355) +#endif CPropVehicle::CPropVehicle() : m_VehiclePhysics( this ) { SetVehicleType( VEHICLE_TYPE_CAR_WHEELS ); } +#ifdef _WIN32 #pragma warning (default:4355) +#endif //----------------------------------------------------------------------------- // Purpose: diff --git a/game/shared/animation.cpp b/game/shared/animation.cpp index 9d5183c8..b7649da6 100644 --- a/game/shared/animation.cpp +++ b/game/shared/animation.cpp @@ -25,7 +25,10 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" +#ifdef _WIN32 #pragma warning( disable : 4244 ) +#endif + #define iabs(i) (( (i) >= 0 ) ? (i) : -(i) ) int ExtractBbox( CStudioHdr *pstudiohdr, int sequence, Vector& mins, Vector& maxs ) diff --git a/game/shared/choreoscene.cpp b/game/shared/choreoscene.cpp index e27b6f8f..3930c1d0 100644 --- a/game/shared/choreoscene.cpp +++ b/game/shared/choreoscene.cpp @@ -29,7 +29,9 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" +#ifdef _WIN32 #pragma warning( disable : 4127 ) +#endif // Let scene linger for 1/4 second so blends can finish #define SCENE_LINGER_TIME 0.25f diff --git a/game/shared/gamemovement.cpp b/game/shared/gamemovement.cpp index 816379f3..77521693 100644 --- a/game/shared/gamemovement.cpp +++ b/game/shared/gamemovement.cpp @@ -4837,7 +4837,9 @@ void CGameMovement::FullTossMove( void ) // Purpose: TF2 commander mode movement logic //----------------------------------------------------------------------------- +#ifdef _WIN32 #pragma warning (disable : 4701) +#endif void CGameMovement::IsometricMove( void ) { @@ -4872,7 +4874,9 @@ void CGameMovement::IsometricMove( void ) mv->m_vecVelocity.Init(); } +#ifdef _WIN32 #pragma warning (default : 4701) +#endif bool CGameMovement::GameHasLadders() const diff --git a/mathlib/3dnow.cpp b/mathlib/3dnow.cpp index 71657044..3bfb0176 100644 --- a/mathlib/3dnow.cpp +++ b/mathlib/3dnow.cpp @@ -16,7 +16,7 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" -#if !defined(COMPILER_MSVC64) && !defined(LINUX) +#if !defined(COMPILER_MSVC64) && !defined(POSIX) // Implement for 64-bit Windows if needed. // Clang hits "fatal error: error in backend:" and other errors when trying // to compile the inline assembly below. 3DNow support is highly unlikely to diff --git a/mathlib/IceKey.cpp b/mathlib/IceKey.cpp index b5f910b7..76126880 100644 --- a/mathlib/IceKey.cpp +++ b/mathlib/IceKey.cpp @@ -6,7 +6,10 @@ #include "mathlib/IceKey.H" #include "tier0/memdbgon.h" + +#ifdef _WIN32 #pragma warning(disable: 4244) +#endif /* Structure of a single round subkey */ diff --git a/mathlib/color_conversion.cpp b/mathlib/color_conversion.cpp index 3a30575b..7e41de43 100644 --- a/mathlib/color_conversion.cpp +++ b/mathlib/color_conversion.cpp @@ -106,8 +106,10 @@ ALIGN128 float power2_n[256] = // 2**(index - 128) / 255 // You can use this to double check the exponent table and assert that // the precomputation is correct. #ifdef DBGFLAG_ASSERT +#ifdef _WIN32 #pragma warning(push) #pragma warning( disable : 4189 ) // disable unused local variable warning +#endif static void CheckExponentTable() { for( int i = 0; i < 256; i++ ) @@ -120,8 +122,10 @@ static void CheckExponentTable() power2_n[i] == testAgainst ); } } +#ifdef _WIN32 #pragma warning(pop) #endif +#endif void BuildGammaTable( float gamma, float texGamma, float brightness, int overbright ) { diff --git a/mathlib/mathlib_base.cpp b/mathlib/mathlib_base.cpp index fce3547b..319718ff 100644 --- a/mathlib/mathlib_base.cpp +++ b/mathlib/mathlib_base.cpp @@ -16,8 +16,10 @@ #include "tier0/vprof.h" //#define _VPROF_MATHLIB +#ifdef _WIN32 #pragma warning(disable:4244) // "conversion from 'const int' to 'float', possible loss of data" #pragma warning(disable:4730) // "mixing _m64 and floating point expressions may result in incorrect code" +#endif #include "mathlib/mathlib.h" #include "mathlib/vector.h" diff --git a/mathlib/vmatrix.cpp b/mathlib/vmatrix.cpp index 77c0656f..c7ebb4f3 100644 --- a/mathlib/vmatrix.cpp +++ b/mathlib/vmatrix.cpp @@ -18,7 +18,9 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" +#ifdef _WIN32 #pragma warning (disable : 4700) // local variable 'x' used without having been initialized +#endif // ------------------------------------------------------------------------------------------- // // Helper functions. diff --git a/public/XUnzip.cpp b/public/XUnzip.cpp index 72fc7805..0a20cfdc 100644 --- a/public/XUnzip.cpp +++ b/public/XUnzip.cpp @@ -245,7 +245,9 @@ void zfree(void *buf) } */ +#ifdef _WIN32 #pragma warning(disable : 4702) // unreachable code +#endif typedef struct tm_unz_s { unsigned int tm_sec; // seconds after the minute - [0,59] diff --git a/public/bitmap/imageformat.h b/public/bitmap/imageformat.h index aad2ee2a..1a749c27 100644 --- a/public/bitmap/imageformat.h +++ b/public/bitmap/imageformat.h @@ -29,8 +29,10 @@ typedef enum _D3DFORMAT D3DFORMAT; // The various image format types //----------------------------------------------------------------------------- +#ifdef _WIN32 // don't bitch that inline functions aren't used!!!! #pragma warning(disable : 4514) +#endif enum ImageFormat { diff --git a/public/bone_setup.cpp b/public/bone_setup.cpp index 31fb4965..93af9599 100644 --- a/public/bone_setup.cpp +++ b/public/bone_setup.cpp @@ -5127,9 +5127,9 @@ float Studio_GetPoseParameter( const CStudioHdr *pStudioHdr, int iParameter, flo return ctlValue * (PoseParam.end - PoseParam.start) + PoseParam.start; } - +#ifdef _WIN32 #pragma warning (disable : 4701) - +#endif //----------------------------------------------------------------------------- // Purpose: @@ -5237,8 +5237,9 @@ static int ClipRayToHitbox( const Ray_t &ray, mstudiobbox_t *pbox, matrix3x4_t& return hitside; } +#ifdef _WIN32 #pragma warning (default : 4701) - +#endif //----------------------------------------------------------------------------- // Purpose: diff --git a/public/bspfile.h b/public/bspfile.h index 2ee00921..f83a2f1c 100644 --- a/public/bspfile.h +++ b/public/bspfile.h @@ -792,7 +792,9 @@ struct dfaceid_t #if defined( _X360 ) #pragma bitfield_order( push, lsb_to_msb ) #endif +#ifdef _WIN32 #pragma warning( disable:4201 ) // C4201: nonstandard extension used: nameless struct/union +#endif struct dleaf_version_0_t { DECLARE_BYTESWAP_DATADESC(); @@ -846,7 +848,9 @@ struct dleaf_t // Precaculated light info for entities. // CompressedLightCube m_AmbientLighting; }; +#ifdef _WIN32 #pragma warning( default:4201 ) // C4201: nonstandard extension used: nameless struct/union +#endif #if defined( _X360 ) #pragma bitfield_order( pop ) #endif diff --git a/public/fgdlib/gamedata.h b/public/fgdlib/gamedata.h index af2e7d62..55487c81 100644 --- a/public/fgdlib/gamedata.h +++ b/public/fgdlib/gamedata.h @@ -10,10 +10,17 @@ #pragma once #endif +#ifdef _WIN32 #pragma warning(push, 1) #pragma warning(disable:4701 4702 4530) +#endif + #include + +#ifdef _WIN32 #pragma warning(pop) +#endif + #include "TokenReader.h" #include "GDClass.h" #include "InputOutput.h" diff --git a/public/fgdlib/wckeyvalues.h b/public/fgdlib/wckeyvalues.h index 2eebbc7f..719c9139 100644 --- a/public/fgdlib/wckeyvalues.h +++ b/public/fgdlib/wckeyvalues.h @@ -12,11 +12,17 @@ #include #include #include + +#ifdef _WIN32 #pragma warning(push, 1) #pragma warning(disable:4701 4702 4530) -#include -#pragma warning(pop) +#endif +#include + +#ifdef _WIN32 +#pragma warning(pop) +#endif #define KEYVALUE_MAX_KEY_LENGTH 80 #define KEYVALUE_MAX_VALUE_LENGTH 512 diff --git a/public/haptics/ihaptics.h b/public/haptics/ihaptics.h index 407d86c0..aa9bc403 100644 --- a/public/haptics/ihaptics.h +++ b/public/haptics/ihaptics.h @@ -1,7 +1,7 @@ #ifndef HAPTICS_INTERFACE_H #define HAPTICS_INTERFACE_H -#ifdef GAME_DLL +#if defined( GAME_DLL ) && defined( _WIN32 ) #pragma warning("IHaptics.h is only for client ussage"); #endif diff --git a/public/keyframe/keyframe.cpp b/public/keyframe/keyframe.cpp index 0079881b..3efc9a54 100644 --- a/public/keyframe/keyframe.cpp +++ b/public/keyframe/keyframe.cpp @@ -13,7 +13,10 @@ #include typedef unsigned char byte; + +#ifdef _WIN32 #pragma warning(disable:4244) +#endif #include "tier0/dbg.h" #include "mathlib/vector.h" diff --git a/public/mathlib/amd3dx.h b/public/mathlib/amd3dx.h index 05eb663e..4a95ec52 100644 --- a/public/mathlib/amd3dx.h +++ b/public/mathlib/amd3dx.h @@ -593,7 +593,9 @@ // The Microsoft Visual C++ version of the 3DNow! macros. // Stop the "no EMMS" warning, since it doesn't detect FEMMS properly +#ifdef _WIN32 #pragma warning(disable:4799) +#endif // Defines for operands. #define _K3D_MM0 0xc0 diff --git a/public/networkvar.h b/public/networkvar.h index b2c0a683..dc3e0ee6 100644 --- a/public/networkvar.h +++ b/public/networkvar.h @@ -18,8 +18,9 @@ #include "basehandle.h" #endif - +#ifdef _WIN32 #pragma warning( disable : 4284 ) // warning C4284: return type for 'CNetworkVarT::operator ->' is 'int *' (ie; not a UDT or reference to a UDT. Will produce errors if applied using infix notation) +#endif #define MyOffsetOf( type, var ) ( (int)&((type*)0)->var ) diff --git a/public/shaderlib/cshader.h b/public/shaderlib/cshader.h index 16acc5de..a3165f8a 100644 --- a/public/shaderlib/cshader.h +++ b/public/shaderlib/cshader.h @@ -32,7 +32,9 @@ #include "shaderlib/ShaderDLL.h" // make "local variable is initialized but not referenced" warnings errors for combo checking macros +#ifdef _WIN32 #pragma warning ( error : 4189 ) +#endif //----------------------------------------------------------------------------- // Global interfaces diff --git a/public/tier0/K8PerformanceCounters.h b/public/tier0/K8PerformanceCounters.h index 1c17d7ee..3b9285e4 100644 --- a/public/tier0/K8PerformanceCounters.h +++ b/public/tier0/K8PerformanceCounters.h @@ -68,7 +68,9 @@ enum UnitEncode # pragma pack(pop) // Turn off the no return value warning in ReadCounter. +#ifdef _WIN32 #pragma warning( disable : 4035 ) +#endif #define k8NUM_COUNTERS 4 class k8BaseEvent { @@ -250,7 +252,9 @@ public: }; +#ifdef _WIN32 #pragma warning( default : 4035 ) +#endif diff --git a/public/tier0/P4PerformanceCounters.h b/public/tier0/P4PerformanceCounters.h index 9af67afc..44a53922 100644 --- a/public/tier0/P4PerformanceCounters.h +++ b/public/tier0/P4PerformanceCounters.h @@ -8,7 +8,9 @@ #ifndef P4PERFORMANCECOUNTERS_H #define P4PERFORMANCECOUNTERS_H +#ifdef _WIN32 #pragma once +#endif // Pentium 4 support /* @@ -75,7 +77,9 @@ enum Counters // register base for CCCR register #define MSR_CCCR_BASE 0x360 +#ifdef _WIN32 #pragma pack(push, 1) +#endif // access to these bits is through the methods typedef union ESCR { @@ -121,7 +125,9 @@ typedef union CCCR } CCCR; +#ifdef _WIN32 #pragma pack(pop) +#endif extern const unsigned short cccr_escr_map[NCOUNTERS][8]; @@ -144,7 +150,9 @@ enum P4OverflowInterrupt }; // Turn off the no return value warning in ReadCounter. +#ifdef _WIN32 #pragma warning( disable : 4035 ) +#endif class P4BaseEvent { int m_counter; @@ -314,7 +322,9 @@ public: pme->WriteMSR( cccrPort, cccr.flat ); } }; +#ifdef _WIN32 #pragma warning( default : 4035 ) +#endif #include "EventMasks.h" #include "EventModes.h" diff --git a/public/tier0/PMELib.h b/public/tier0/PMELib.h index 2ad59145..52e3e6bb 100644 --- a/public/tier0/PMELib.h +++ b/public/tier0/PMELib.h @@ -12,8 +12,10 @@ #include "tier0/platform.h" // Get rid of a bunch of STL warnings! +#ifdef _WIN32 #pragma warning( push, 3 ) #pragma warning( disable : 4018 ) +#endif #define VERSION "1.0.2" @@ -187,6 +189,8 @@ enum PerfErrors E_ILLEGAL_OPERATION = -10, }; +#ifdef _WIN32 #pragma warning( pop ) +#endif #endif // PMELIB_H \ No newline at end of file diff --git a/public/tier0/memoverride.cpp b/public/tier0/memoverride.cpp index 29495903..e663094d 100644 --- a/public/tier0/memoverride.cpp +++ b/public/tier0/memoverride.cpp @@ -811,7 +811,9 @@ void InvalidParameterViolation() // Disable compiler optimizations. If we don't do this then VC++ generates code // that confuses the Visual Studio debugger and causes it to display completely // random call stacks. That makes the minidumps excruciatingly hard to understand. +#ifdef _WIN32 #pragma optimize("", off) +#endif // Write a minidump file, unless running under the debugger in which case break // into the debugger. @@ -848,7 +850,9 @@ void VInvalidParameterHandler(const wchar_t* expression, } // Restore compiler optimizations. +#ifdef _WIN32 #pragma optimize("", on) +#endif // Helper class for registering error callbacks. See above for details. class ErrorHandlerRegistrar @@ -1592,8 +1596,10 @@ class _LocaleUpdate }; +#ifdef _WIN32 #pragma warning(push) #pragma warning(disable: 4483) +#endif #if _MSC_FULL_VER >= 140050415 #define _NATIVE_STARTUP_NAMESPACE __identifier("") #else /* _MSC_FULL_VER >= 140050415 */ @@ -1649,7 +1655,9 @@ namespace _NATIVE_STARTUP_NAMESPACE } }; } +#ifdef _WIN32 #pragma warning(pop) +#endif #endif // _MSC_VER >= 1400 diff --git a/public/tier0/platform.h b/public/tier0/platform.h index 1ff753f5..b68f2c1e 100644 --- a/public/tier0/platform.h +++ b/public/tier0/platform.h @@ -666,7 +666,7 @@ typedef void * HINSTANCE; // When we port to 64 bit, we'll have to resolve the int, ptr vs size_t 32/64 bit problems... -#if !defined( _WIN64 ) +#if !defined( _WIN64 ) && defined ( _WIN32 ) #pragma warning( disable : 4267 ) // conversion from 'size_t' to 'int', possible loss of data #pragma warning( disable : 4311 ) // pointer truncation from 'char *' to 'int' #pragma warning( disable : 4312 ) // conversion from 'unsigned int' to 'memhandle_t' of greater size diff --git a/public/tier1/convar.h b/public/tier1/convar.h index 9df80101..ba734947 100644 --- a/public/tier1/convar.h +++ b/public/tier1/convar.h @@ -579,7 +579,9 @@ void ConVar_PrintDescription( const ConCommandBase *pVar ); //----------------------------------------------------------------------------- // Purpose: Utility class to quickly allow ConCommands to call member methods //----------------------------------------------------------------------------- +#ifdef _WIN32 #pragma warning (disable : 4355 ) +#endif template< class T > class CConCommandMemberAccessor : public ConCommand, public ICommandCallback, public ICommandCompletionCallback @@ -626,8 +628,9 @@ private: FnMemberCommandCompletionCallback_t m_CompletionFunc; }; +#ifdef _WIN32 #pragma warning ( default : 4355 ) - +#endif //----------------------------------------------------------------------------- // Purpose: Utility macros to quicky generate a simple console command diff --git a/public/tier1/utlblockmemory.h b/public/tier1/utlblockmemory.h index 8ceb0a2b..925582f0 100644 --- a/public/tier1/utlblockmemory.h +++ b/public/tier1/utlblockmemory.h @@ -21,8 +21,10 @@ #include "tier0/memalloc.h" #include "tier0/memdbgon.h" +#ifdef _WIN32 #pragma warning (disable:4100) #pragma warning (disable:4514) +#endif //----------------------------------------------------------------------------- diff --git a/public/tier1/utlfixedmemory.h b/public/tier1/utlfixedmemory.h index 3d92d679..4987499b 100644 --- a/public/tier1/utlfixedmemory.h +++ b/public/tier1/utlfixedmemory.h @@ -20,8 +20,10 @@ #include "tier0/memalloc.h" #include "tier0/memdbgon.h" +#ifdef _WIN32 #pragma warning (disable:4100) #pragma warning (disable:4514) +#endif //----------------------------------------------------------------------------- diff --git a/public/tier1/utllinkedlist.h b/public/tier1/utllinkedlist.h index ff251268..a73d7bba 100644 --- a/public/tier1/utllinkedlist.h +++ b/public/tier1/utllinkedlist.h @@ -545,8 +545,10 @@ inline I CUtlLinkedList::PrivateNext( I i ) const // Are nodes in the list or valid? //----------------------------------------------------------------------------- +#ifdef _WIN32 #pragma warning(push) #pragma warning( disable: 4310 ) // Allows "(I)(S)M::INVALID_INDEX" below +#endif template inline bool CUtlLinkedList::IndexInRange( I index ) // Static method { @@ -565,7 +567,9 @@ inline bool CUtlLinkedList::IndexInRange( I index ) // Static method return ( ( (S)index == index ) && ( (S)index != InvalidIndex() ) ); } +#ifdef _WIN32 #pragma warning(pop) +#endif template inline bool CUtlLinkedList::IsValidIndex( I i ) const diff --git a/public/tier1/utlmemory.h b/public/tier1/utlmemory.h index 0d20a6ad..c937d5b1 100644 --- a/public/tier1/utlmemory.h +++ b/public/tier1/utlmemory.h @@ -22,9 +22,10 @@ #include "tier0/memalloc.h" #include "tier0/memdbgon.h" +#ifdef _WIN32 #pragma warning (disable:4100) #pragma warning (disable:4514) - +#endif //----------------------------------------------------------------------------- diff --git a/public/tier1/utlrbtree.h b/public/tier1/utlrbtree.h index cdb06ee5..8184ac63 100644 --- a/public/tier1/utlrbtree.h +++ b/public/tier1/utlrbtree.h @@ -662,8 +662,10 @@ inline void CUtlRBTree::SetColor( I i, typename CUtlRBTree I CUtlRBTree::NewNode() { @@ -708,7 +710,9 @@ I CUtlRBTree::NewNode() return elem; } +#ifdef _WIN32 #pragma warning(pop) +#endif template < class T, class I, typename L, class M > void CUtlRBTree::FreeNode( I i ) diff --git a/public/tier1/utlvector.h b/public/tier1/utlvector.h index 3b8dd0ee..4901c367 100644 --- a/public/tier1/utlvector.h +++ b/public/tier1/utlvector.h @@ -278,9 +278,11 @@ public: // Especialy useful if you have a lot of vectors that are sparse, or if you're // carefully packing holders of vectors //----------------------------------------------------------------------------- +#ifdef _WIN32 #pragma warning(push) #pragma warning(disable : 4200) // warning C4200: nonstandard extension used : zero-sized array in struct/union #pragma warning(disable : 4815 ) // warning C4815: 'staticData' : zero-sized array in stack object will have no elements +#endif class CUtlVectorUltraConservativeAllocator { @@ -518,7 +520,9 @@ private: } }; +#ifdef _WIN32 #pragma warning(pop) +#endif //----------------------------------------------------------------------------- diff --git a/public/togl/linuxwin/cglmtex.h b/public/togl/linuxwin/cglmtex.h index bdb83776..c3193201 100644 --- a/public/togl/linuxwin/cglmtex.h +++ b/public/togl/linuxwin/cglmtex.h @@ -124,8 +124,10 @@ bool LessFunc_GLMTexLayoutKey( const GLMTexLayoutKey &a, const GLMTexLayoutKey & #define GLM_TEX_MAX_FACES 6 #define GLM_TEX_MAX_SLICES (GLM_TEX_MAX_MIPS * GLM_TEX_MAX_FACES) +#ifdef _WIN32 #pragma warning( push ) #pragma warning( disable : 4200 ) +#endif struct GLMTexLayout { @@ -148,7 +150,9 @@ struct GLMTexLayout GLMTexLayoutSlice m_slices[0]; // dynamically allocated 2-d array [faces][mips] }; +#ifdef _WIN32 #pragma warning( pop ) +#endif class CGLMTexLayoutTable { diff --git a/public/vgui/VGUI.h b/public/vgui/VGUI.h index 706e4cb0..ebd7cbb3 100644 --- a/public/vgui/VGUI.h +++ b/public/vgui/VGUI.h @@ -22,6 +22,7 @@ #endif #endif +#ifdef _WIN32 #pragma warning( disable: 4800 ) // disables 'performance warning converting int to bool' #pragma warning( disable: 4786 ) // disables 'identifier truncated in browser information' warning #pragma warning( disable: 4355 ) // disables 'this' : used in base member initializer list @@ -29,6 +30,7 @@ #pragma warning( disable: 4514 ) // warning C4514: 'Color::Color' : unreferenced inline function has been removed #pragma warning( disable: 4100 ) // warning C4100: 'code' : unreferenced formal parameter #pragma warning( disable: 4127 ) // warning C4127: conditional expression is constant +#endif typedef unsigned char uchar; typedef unsigned short ushort; diff --git a/public/vgui_controls/MessageMap.h b/public/vgui_controls/MessageMap.h index a5c82c1c..2b83b163 100644 --- a/public/vgui_controls/MessageMap.h +++ b/public/vgui_controls/MessageMap.h @@ -55,7 +55,9 @@ typedef void (Panel::*MessageFunc_t)(void); // Contains the information to map a string message name with parameters // to a function call //----------------------------------------------------------------------------- +#ifdef _WIN32 #pragma warning(disable:4121) +#endif struct MessageMapItem_t { const char *name; diff --git a/public/vstdlib/pch_vstdlib.h b/public/vstdlib/pch_vstdlib.h index 72d70939..8f77e90e 100644 --- a/public/vstdlib/pch_vstdlib.h +++ b/public/vstdlib/pch_vstdlib.h @@ -11,8 +11,9 @@ // $NoKeywords: $ //============================================================================= - +#ifdef _WIN32 #pragma warning(disable: 4514) +#endif // First include standard libraries #include diff --git a/public/vstdlib/random.h b/public/vstdlib/random.h index 5c56eb12..61f9b1f7 100644 --- a/public/vstdlib/random.h +++ b/public/vstdlib/random.h @@ -16,8 +16,10 @@ #define NTAB 32 +#ifdef _WIN32 #pragma warning(push) #pragma warning( disable:4251 ) +#endif //----------------------------------------------------------------------------- // A generator of uniformly distributed random numbers @@ -102,8 +104,9 @@ VSTDLIB_INTERFACE float RandomGaussianFloat( float flMean = 0.0f, float flStdDev //----------------------------------------------------------------------------- VSTDLIB_INTERFACE void InstallUniformRandomStream( IUniformRandomStream *pStream ); - +#ifdef _WIN32 #pragma warning(pop) +#endif #endif // VSTDLIB_RANDOM_H diff --git a/tier1/KeyValues.cpp b/tier1/KeyValues.cpp index b882e061..7163f8fb 100644 --- a/tier1/KeyValues.cpp +++ b/tier1/KeyValues.cpp @@ -521,7 +521,9 @@ const char *KeyValues::GetName( void ) const //----------------------------------------------------------------------------- // Purpose: Read a single token from buffer (0 terminated) //----------------------------------------------------------------------------- +#ifdef _WIN32 #pragma warning (disable:4706) +#endif const char *KeyValues::ReadToken( CUtlBuffer &buf, bool &wasQuoted, bool &wasConditional ) { wasQuoted = false; @@ -605,7 +607,9 @@ const char *KeyValues::ReadToken( CUtlBuffer &buf, bool &wasQuoted, bool &wasCon s_pTokenBuf[ nCount ] = 0; return s_pTokenBuf; } +#ifdef _WIN32 #pragma warning (default:4706) +#endif diff --git a/tier1/ilocalize.cpp b/tier1/ilocalize.cpp index 0ef6e629..9e63253b 100644 --- a/tier1/ilocalize.cpp +++ b/tier1/ilocalize.cpp @@ -9,7 +9,9 @@ #include "tier1/ilocalize.h" #include "utlstring.h" +#ifdef _WIN32 #pragma warning( disable: 4018 ) // '<' : signed/unsigned mismatch +#endif //----------------------------------------------------------------------------- // Purpose: converts an english string to unicode diff --git a/tier1/utlbuffer.cpp b/tier1/utlbuffer.cpp index 665c45fe..53616f99 100644 --- a/tier1/utlbuffer.cpp +++ b/tier1/utlbuffer.cpp @@ -6,7 +6,9 @@ // Serialization buffer //===========================================================================// +#ifdef _WIN32 #pragma warning (disable : 4514) +#endif #include "utlbuffer.h" #include @@ -904,7 +906,9 @@ void CUtlBuffer::SeekGet( SeekType_t type, int offset ) // Parse... //----------------------------------------------------------------------------- +#ifdef _WIN32 #pragma warning ( disable : 4706 ) +#endif int CUtlBuffer::VaScanf( const char* pFmt, va_list list ) { @@ -1075,7 +1079,9 @@ int CUtlBuffer::VaScanf( const char* pFmt, va_list list ) return numScanned; } +#ifdef _WIN32 #pragma warning ( default : 4706 ) +#endif int CUtlBuffer::Scanf( const char* pFmt, ... ) { diff --git a/tier1/utlbufferutil.cpp b/tier1/utlbufferutil.cpp index f628587c..127e7ccd 100644 --- a/tier1/utlbufferutil.cpp +++ b/tier1/utlbufferutil.cpp @@ -6,7 +6,9 @@ // Serialization buffer //===========================================================================// +#ifdef _WIN32 #pragma warning (disable : 4514) +#endif #include "tier1/utlbufferutil.h" #include "tier1/utlbuffer.h" diff --git a/tier1/utlsymbol.cpp b/tier1/utlsymbol.cpp index b9714d27..d759f1eb 100644 --- a/tier1/utlsymbol.cpp +++ b/tier1/utlsymbol.cpp @@ -6,7 +6,9 @@ // $NoKeywords: $ //=============================================================================// +#ifdef _WIN32 #pragma warning (disable:4514) +#endif #include "utlsymbol.h" #include "KeyValues.h" diff --git a/utils/common/consolewnd.cpp b/utils/common/consolewnd.cpp index 8802e39e..6cd868e3 100644 --- a/utils/common/consolewnd.cpp +++ b/utils/common/consolewnd.cpp @@ -8,9 +8,10 @@ #include #include "consolewnd.h" - +#ifdef _WIN32 #pragma warning( disable : 4311 ) // warning C4311: 'reinterpret_cast' : pointer truncation from 'CConsoleWnd *const ' to 'LONG' #pragma warning( disable : 4312 ) // warning C4312: 'type cast' : conversion from 'LONG' to 'CConsoleWnd *' of greater size +#endif #define EDITCONTROL_BORDER_SIZE 5 diff --git a/utils/common/mstristrip.cpp b/utils/common/mstristrip.cpp index 9e611f94..80c9207e 100644 --- a/utils/common/mstristrip.cpp +++ b/utils/common/mstristrip.cpp @@ -13,11 +13,13 @@ // Copyright (c) 1999-2000 Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- +#ifdef _WIN32 // identifier was truncated to '255' characters in the debug information #pragma warning(disable: 4786) // conversion from 'double' to 'float' #pragma warning(disable: 4244) #pragma warning(disable: 4530) +#endif #include #include diff --git a/utils/vrad/vrad.h b/utils/vrad/vrad.h index b39d66c8..4a37f179 100644 --- a/utils/vrad/vrad.h +++ b/utils/vrad/vrad.h @@ -39,9 +39,13 @@ #include #include +#ifdef _WIN32 #pragma warning(disable: 4142 4028) +#endif #include +#ifdef _WIN32 #pragma warning(default: 4142 4028) +#endif #include #include diff --git a/vgui2/chromehtml/html_chrome.cpp b/vgui2/chromehtml/html_chrome.cpp index 0af67f82..9bf8331e 100644 --- a/vgui2/chromehtml/html_chrome.cpp +++ b/vgui2/chromehtml/html_chrome.cpp @@ -1713,8 +1713,10 @@ const byte *CChromePainter::PPopupTextureDataCached() //----------------------------------------------------------------------------- // Purpose: Client implementation of the browser handler class //----------------------------------------------------------------------------- +#ifdef _WIN32 #pragma warning( push ) #pragma warning( disable : 4355 ) // 'this' : used in base member initializer list +#endif CClientHandler::CClientHandler( int iBrowser, const char *pchUserAgent, uint16 nSerial ) : m_Painter( this ) { m_nSerial = nSerial; @@ -1737,7 +1739,9 @@ CClientHandler::CClientHandler( int iBrowser, const char *pchUserAgent, uint16 n memset( &m_CachedHScroll, 0, sizeof( m_CachedHScroll ) ); memset( &m_CachedVScroll, 0, sizeof( m_CachedVScroll ) ); } +#ifdef _WIN32 #pragma warning( pop ) +#endif //----------------------------------------------------------------------------- diff --git a/vgui2/vgui_controls/AnimationController.cpp b/vgui2/vgui_controls/AnimationController.cpp index a618231c..d7d32e36 100644 --- a/vgui2/vgui_controls/AnimationController.cpp +++ b/vgui2/vgui_controls/AnimationController.cpp @@ -3,7 +3,9 @@ // Purpose: // //=============================================================================// +#ifdef _WIN32 #pragma warning( disable : 4244 ) // conversion from 'double' to 'float', possible loss of data +#endif #include #include diff --git a/vgui2/vgui_controls/BuildModeDialog.cpp b/vgui2/vgui_controls/BuildModeDialog.cpp index 9ae8c8c5..280f1a5d 100644 --- a/vgui2/vgui_controls/BuildModeDialog.cpp +++ b/vgui2/vgui_controls/BuildModeDialog.cpp @@ -115,7 +115,9 @@ class BuildModeLocalizedStringEditDialog : public Frame public: +#ifdef _WIN32 #pragma warning( disable : 4355 ) +#endif BuildModeLocalizedStringEditDialog() : Frame(this, NULL) { m_pTokenEntry = new TextEntry(this, NULL); @@ -133,7 +135,9 @@ public: m_pFileCombo->AddItem(g_pVGuiLocalize->GetLocalizationFileName(i), NULL); } } +#ifdef _WIN32 #pragma warning( default : 4355 ) +#endif virtual void DoModal(const char *token) { diff --git a/vgui2/vgui_controls/EditablePanel.cpp b/vgui2/vgui_controls/EditablePanel.cpp index 1980db6c..2305fec0 100644 --- a/vgui2/vgui_controls/EditablePanel.cpp +++ b/vgui2/vgui_controls/EditablePanel.cpp @@ -49,7 +49,9 @@ DECLARE_BUILD_FACTORY( EditablePanel ); //----------------------------------------------------------------------------- // Purpose: Constructor //----------------------------------------------------------------------------- +#ifdef _WIN32 #pragma warning( disable : 4355 ) +#endif EditablePanel::EditablePanel(Panel *parent, const char *panelName) : Panel(parent, panelName), m_NavGroup(this) { @@ -78,7 +80,9 @@ EditablePanel::EditablePanel(Panel *parent, const char *panelName, HScheme hSche SetBuildGroup(GetBuildGroup()); } +#ifdef _WIN32 #pragma warning( default : 4355 ) +#endif //----------------------------------------------------------------------------- // Purpose: Destructor