Use WIN32 preprocessor macro instead of _WIN32

Resolves #62
This commit is contained in:
Sam V 2021-11-18 20:02:04 +01:00
parent 91cf9de3b4
commit 667e0aea57
26 changed files with 57 additions and 57 deletions

View file

@ -26,7 +26,7 @@
#define RGB_REDISH 0x00FF1010 //255,160,0
#define RGB_GREENISH 0x0000A000 //0,160,0
#ifndef _WIN32
#ifndef WIN32
#define _cdecl
#endif

View file

@ -148,7 +148,7 @@ cvar_t *joy_wwhack2;
int joy_avail, joy_advancedinit, joy_haspov;
#ifdef _WIN32
#ifdef WIN32
DWORD s_hMouseThreadId = 0;
HANDLE s_hMouseThread = 0;
HANDLE s_hMouseQuitEvent = 0;
@ -173,7 +173,7 @@ void Force_CenterView_f ()
}
}
#ifdef _WIN32
#ifdef WIN32
long s_mouseDeltaX = 0;
long s_mouseDeltaY = 0;
POINT current_pos;
@ -227,7 +227,7 @@ void DLLEXPORT IN_ActivateMouse ()
{
if (mouseinitialized)
{
#ifdef _WIN32
#ifdef WIN32
if (mouseparmsvalid)
restore_spi = SystemParametersInfo (SPI_SETMOUSE, 0, newmouseparms, 0);
@ -235,7 +235,7 @@ void DLLEXPORT IN_ActivateMouse ()
mouseactive = 1;
}
#ifdef _WIN32
#ifdef WIN32
if (!m_bRawInput)
{
SDL_SetRelativeMouseMode(SDL_FALSE);
@ -261,7 +261,7 @@ void DLLEXPORT IN_DeactivateMouse ()
{
if (mouseinitialized)
{
#ifdef _WIN32
#ifdef WIN32
if (restore_spi)
SystemParametersInfo (SPI_SETMOUSE, 0, originalmouseparms, 0);
@ -270,7 +270,7 @@ void DLLEXPORT IN_DeactivateMouse ()
mouseactive = 0;
}
#ifdef _WIN32
#ifdef WIN32
if (m_bRawInput)
{
mouseRelative = SDL_FALSE;
@ -291,7 +291,7 @@ void IN_StartupMouse ()
return;
mouseinitialized = 1;
#ifdef _WIN32
#ifdef WIN32
mouseparmsvalid = SystemParametersInfo (SPI_GETMOUSE, 0, originalmouseparms, 0);
if (mouseparmsvalid)
@ -326,7 +326,7 @@ void IN_Shutdown ()
{
IN_DeactivateMouse ();
#ifdef _WIN32
#ifdef WIN32
if ( s_hMouseQuitEvent )
{
SetEvent( s_hMouseQuitEvent );
@ -377,7 +377,7 @@ FIXME: Call through to engine?
void IN_ResetMouse()
{
// no work to do in SDL
#ifdef _WIN32
#ifdef WIN32
if ( gpGlobals && ( gpGlobals->time - s_flRawInputUpdateTime > 1.0f || s_flRawInputUpdateTime == 0.0f ) )
{
s_flRawInputUpdateTime = gpGlobals->time;
@ -502,7 +502,7 @@ void IN_MouseMove ( float frametime, usercmd_t *cmd)
if ( !iMouseInUse && !gHUD.m_iIntermission && !g_iVisibleMouse )
{
int deltaX, deltaY;
#ifdef _WIN32
#ifdef WIN32
if ( !m_bRawInput )
{
if ( m_bMouseThread )
@ -521,13 +521,13 @@ void IN_MouseMove ( float frametime, usercmd_t *cmd)
#endif
{
SDL_GetRelativeMouseState( &deltaX, &deltaY );
#ifdef _WIN32
#ifdef WIN32
current_pos.x = deltaX;
current_pos.y = deltaY;
#endif
}
#ifdef _WIN32
#ifdef WIN32
if ( !m_bRawInput )
{
if ( m_bMouseThread )
@ -603,7 +603,7 @@ void IN_MouseMove ( float frametime, usercmd_t *cmd)
gEngfuncs.SetViewAngles( (float *)viewangles );
#ifdef _WIN32
#ifdef WIN32
if (!m_bRawInput && mouseRelative)
{
SDL_SetRelativeMouseMode(SDL_FALSE);
@ -641,7 +641,7 @@ void DLLEXPORT IN_Accumulate ()
{
if (mouseactive)
{
#ifdef _WIN32
#ifdef WIN32
if ( !m_bRawInput )
{
if ( !m_bMouseThread )
@ -1133,7 +1133,7 @@ void IN_Init ()
m_customaccel_max = gEngfuncs.pfnRegisterVariable ( "m_customaccel_max", "0", FCVAR_ARCHIVE );
m_customaccel_exponent = gEngfuncs.pfnRegisterVariable ( "m_customaccel_exponent", "1", FCVAR_ARCHIVE );
#ifdef _WIN32
#ifdef WIN32
m_bRawInput = CVAR_GET_FLOAT( "m_rawinput" ) > 0;
m_bMouseThread = gEngfuncs.CheckParm ("-mousethread", NULL ) != NULL;
m_mousethread_sleep = gEngfuncs.pfnRegisterVariable ( "m_mousethread_sleep", "10", FCVAR_ARCHIVE );

View file

@ -708,7 +708,7 @@ int TeamFortressViewport::CreateCommandMenu( const char * menuFile, int directio
return newIndex;
}
#ifdef _WIN32
#ifdef WIN32
try
{
#endif
@ -918,7 +918,7 @@ try
pfile = gEngfuncs.COM_ParseFile(pfile, token);
}
#ifdef _WIN32
#ifdef WIN32
}
catch( CException *e )
{

View file

@ -96,7 +96,7 @@ void ForEachBannedPlayer(char id[16])
id[8], id[9], id[10], id[11],
id[12], id[13], id[14], id[15]
);
#ifdef _WIN32
#ifdef WIN32
strupr(str);
#endif
gEngfuncs.pfnConsolePrint(str);

View file

@ -52,7 +52,7 @@ using qboolean = int;
#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0]))
// Prevent tons of unused windows definitions
#ifdef _WIN32
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
//Disable all Windows 10 and older APIs otherwise pulled in by Windows.h
@ -111,7 +111,7 @@ using qboolean = int;
#define strupr _strupr
#define DLLEXPORT __declspec( dllexport )
#else // _WIN32
#else // WIN32
#define FALSE 0
#define TRUE (!FALSE)
typedef uint32 ULONG;
@ -128,7 +128,7 @@ typedef int BOOL;
#define _alloca alloca
#define DLLEXPORT __attribute__ ( ( visibility( "default" ) ) )
#endif //_WIN32
#endif //WIN32
#define V_min(a,b) (((a) < (b)) ? (a) : (b))
#define V_max(a,b) (((a) > (b)) ? (a) : (b))

View file

@ -726,7 +726,7 @@ typedef struct
unsigned r, g, b, a;
} colorVec;
#ifdef _WIN32
#ifdef WIN32
#pragma pack(push,2)
#endif
@ -735,7 +735,7 @@ typedef struct
unsigned short r, g, b, a;
} PackedColorVec;
#ifdef _WIN32
#ifdef WIN32
#pragma pack(pop)
#endif
typedef struct link_s

View file

@ -27,7 +27,7 @@ typedef struct
} MD5Context_t;
#ifdef _WIN32
#ifdef WIN32
typedef uint32 CRC32_t;
#else
typedef uint32 CRC32_t;

View file

@ -74,7 +74,7 @@ typedef union DLONG {
extern DLONG dlong;
#ifdef _WIN32
#ifdef WIN32
void __inline set_fpu_cw(void)
{
_asm

View file

@ -26,7 +26,7 @@
#include "saverestore.h"
#include "doors.h"
#if !defined ( _WIN32 )
#if !defined ( WIN32 )
#include <string.h> // memset())))
#endif

View file

@ -41,7 +41,7 @@
#include "pm_shared.h"
#include "UserMessages.h"
#if !defined ( _WIN32 )
#if !defined ( WIN32 )
#include <ctype.h>
#endif

View file

@ -30,13 +30,13 @@ enginefuncs_t g_engfuncs;
globalvars_t *gpGlobals;
#undef DLLEXPORT
#ifdef _WIN32
#ifdef WIN32
#define DLLEXPORT __stdcall
#else
#define DLLEXPORT __attribute__ ((visibility("default")))
#endif
#ifdef _WIN32
#ifdef WIN32
// Required DLL entry point
BOOL WINAPI DllMain(

View file

@ -29,7 +29,7 @@
#include "hltv.h"
#include "UserMessages.h"
#if !defined ( _WIN32 )
#if !defined ( WIN32 )
#include <ctype.h>
#endif

View file

@ -24,7 +24,7 @@
#include "animation.h"
#include "doors.h"
#if !defined ( _WIN32 )
#if !defined ( WIN32 )
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>

View file

@ -24,7 +24,7 @@
#include "talkmonster.h"
#include "gamerules.h"
#if !defined ( _WIN32 )
#if !defined ( WIN32 )
#include <ctype.h>
#endif

View file

@ -1783,7 +1783,7 @@ void CSaveRestoreBuffer :: BufferRewind( int size )
m_pdata->size -= size;
}
#ifndef _WIN32
#ifndef WIN32
extern "C" {
unsigned _rotr ( unsigned val, int shift)
{

View file

@ -5,7 +5,7 @@
#include "Sequence.h"
#include "common_types.h"
#ifndef _WIN32
#ifndef WIN32
#include "enums.h"
#endif

View file

@ -33,7 +33,7 @@
//
/*
#ifdef _WIN32
#ifdef WIN32
#define DLLEXPORT __stdcall
#else
#define DLLEXPORT __attribute__ ((visibility("default")))
@ -336,7 +336,7 @@ typedef struct
typedef struct saverestore_s SAVERESTOREDATA;
#ifdef _WIN32
#ifdef WIN32
typedef
#endif
struct saverestore_s
@ -362,7 +362,7 @@ struct saverestore_s
char szCurrentMapName[32]; // To check global entities
}
#ifdef _WIN32
#ifdef WIN32
SAVERESTOREDATA
#endif
;

View file

@ -7,7 +7,7 @@
#include "steam/steamtypes.h"
#ifndef _WIN32
#ifndef WIN32
#define MAX_PATH PATH_MAX
#include <sys/stat.h>
#include <sys/types.h>

View file

@ -3,7 +3,7 @@
#include <stdio.h>
#include "interface.h"
#if !defined ( _WIN32 )
#if !defined ( WIN32 )
// Linux doesn't have this function so this emulates its functionality
//
//
@ -101,7 +101,7 @@ static IBaseInterface *CreateInterfaceLocal( const char *pName, int *pReturnCode
}
#endif
#ifdef _WIN32
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif
@ -125,7 +125,7 @@ static void *Sys_GetProcAddress( const char *pModuleName, const char *pName )
// hlds_run wants to use this function
void *Sys_GetProcAddress( void *pModuleHandle, const char *pName )
{
#if defined ( _WIN32 )
#if defined ( WIN32 )
return GetProcAddress( (HINSTANCE)pModuleHandle, pName );
#else
return GetProcAddress( pModuleHandle, pName );
@ -139,7 +139,7 @@ void *Sys_GetProcAddress( void *pModuleHandle, const char *pName )
//-----------------------------------------------------------------------------
CSysModule *Sys_LoadModule( const char *pModuleName )
{
#if defined ( _WIN32 )
#if defined ( WIN32 )
HMODULE hDLL = LoadLibrary( pModuleName );
#else
HMODULE hDLL = NULL;
@ -173,7 +173,7 @@ CSysModule *Sys_LoadModule( const char *pModuleName )
if( !hDLL )
{
char str[512];
#if defined ( _WIN32 )
#if defined ( WIN32 )
snprintf( str, sizeof(str), "%s.dll", pModuleName );
hDLL = LoadLibrary( str );
#elif defined(OSX)
@ -201,7 +201,7 @@ void Sys_UnloadModule( CSysModule *pModule )
return;
HMODULE hDLL = reinterpret_cast<HMODULE>(pModule);
#if defined ( _WIN32 )
#if defined ( WIN32 )
FreeLibrary( hDLL );
#else
dlclose((void *)hDLL);
@ -221,7 +221,7 @@ CreateInterfaceFn Sys_GetFactory( CSysModule *pModule )
return NULL;
HMODULE hDLL = reinterpret_cast<HMODULE>(pModule);
#if defined ( _WIN32 )
#if defined ( WIN32 )
return reinterpret_cast<CreateInterfaceFn>(GetProcAddress( hDLL, CREATEINTERFACE_PROCNAME ));
#else
// Linux gives this error:
@ -257,7 +257,7 @@ CreateInterfaceFn Sys_GetFactoryThis()
//-----------------------------------------------------------------------------
CreateInterfaceFn Sys_GetFactory( const char *pModuleName )
{
#if defined ( _WIN32 )
#if defined ( WIN32 )
return static_cast<CreateInterfaceFn>( Sys_GetProcAddress( pModuleName, CREATEINTERFACE_PROCNAME ) );
#else
// Linux gives this error:

View file

@ -20,7 +20,7 @@
#pragma once
#if !defined ( _WIN32 )
#if !defined ( WIN32 )
#include <dlfcn.h> // dlopen,dlclose, et al
#include <unistd.h>

View file

@ -5,7 +5,7 @@
#define PARTICLEMAN_INTERFACE "create_particleman"
#ifdef _WIN32
#ifdef WIN32
#define PARTICLEMAN_DLLNAME "cl_dlls/particleman.dll"
#elif defined(OSX)
#define PARTICLEMAN_DLLNAME "cl_dlls/particleman.dylib"

View file

@ -40,7 +40,7 @@ public:
{
// Requested size should match size of class.
if ( size != sizeof( CCoreTriangleEffect ) )
#ifdef _WIN32
#ifdef WIN32
throw "Error in requested size of new particle class instance.";
#else
return NULL;
@ -190,7 +190,7 @@ protected:
// from being successfully allocated.
if ((unsigned)size > (unsigned long) CMiniMem::Instance()->MaxBlockSize())
{
#ifdef _WIN32
#ifdef WIN32
throw "New particle class is larger than memory pool max size, update lMaxParticleClassSize() function.";
#endif
return(false);

View file

@ -26,7 +26,7 @@
typedef unsigned char uint8;
typedef signed char int8;
#if defined( _WIN32 )
#if defined( WIN32 )
typedef __int16 int16;
typedef unsigned __int16 uint16;
@ -43,7 +43,7 @@ typedef __int32 intp;
typedef unsigned __int32 uintp;
#endif
#else // _WIN32
#else // WIN32
typedef short int16;
typedef unsigned short uint16;
@ -59,7 +59,7 @@ typedef int intp;
typedef unsigned int uintp;
#endif
#endif // else _WIN32
#endif // else WIN32
#ifdef __cplusplus
const int k_cubSaltSize = 8;

View file

@ -76,7 +76,7 @@
// then App can come along later and fire all the signals
//TODO: Change all method naming to starting with a capital letter.
#ifdef _WIN32
#ifdef WIN32
# define VGUIAPI __declspec( dllexport )
#else
# define VGUIAPI __attribute__ ((visibility("default")))

View file

@ -163,7 +163,7 @@ protected:
ELEMTYPE* _data;
};
#ifdef _WIN32
#ifdef WIN32
//forward referencing all the template types used so they get exported
template class VGUIAPI Dar<char>;
template class VGUIAPI Dar<char*>;

View file

@ -31,7 +31,7 @@ class VGUIAPI Font
virtual void getCharABCwide(int ch,int& a,int& b,int& c);
virtual void getTextSize(const char* text,int& wide,int& tall);
virtual int getTall();
#ifndef _WIN32
#ifndef WIN32
virtual int getWide();
#endif
virtual int getId();