Skip to content

Commit 4acbc0b

Browse files
committed
refactor(build): replace all _WINDOWS with _WIN32 for Windows detection
1 parent 1925187 commit 4acbc0b

File tree

38 files changed

+84
-84
lines changed

38 files changed

+84
-84
lines changed

Core/Libraries/Source/WWVegas/WWLib/ini.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ void INIClass::DuplicateCRCError(const char *message, const char *section, const
22852285
assert(0);
22862286

22872287
#ifdef RTS_RELEASE
2288-
#ifdef _WINDOWS
2288+
#ifdef _WIN32
22892289
MessageBox(0, buffer, "Duplicate CRC in INI file.", MB_ICONSTOP | MB_OK);
22902290
#endif
22912291
#endif

Core/Tools/WW3D/pluglib/win.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
#pragma warning(pop)
6666
#endif
6767

68-
#ifdef _WINDOWS
68+
#ifdef _WIN32
6969
extern HINSTANCE ProgramInstance;
7070
extern HWND MainWindow;
7171
extern bool GameInFocus;

Core/Tools/mangler/crc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
#include <signal.h>
21-
#ifdef _WINDOWS
21+
#ifdef _WIN32
2222
#include <process.h> // *MUST* be included before ANY Wnet/Wlib headers if _REENTRANT is defined
2323
#endif
2424

Core/Tools/mangler/mangler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <Utility/iostream_adapter.h>
2121

2222
#include <signal.h>
23-
#ifdef _WINDOWS
23+
#ifdef _WIN32
2424
#include <process.h> // *MUST* be included before ANY Wnet/Wlib headers if _REENTRANT is defined
2525
#endif
2626

@@ -97,7 +97,7 @@ int main(int argc, char **argv)
9797

9898

9999
// ----- Initialize Winsock -----
100-
#ifdef _WINDOWS
100+
#ifdef _WIN32
101101
WORD verReq = MAKEWORD(2, 2);
102102
WSADATA wsadata;
103103

Core/Tools/mangler/manglertest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <Utility/iostream_adapter.h>
2121

2222
#include <signal.h>
23-
#ifdef _WINDOWS
23+
#ifdef _WIN32
2424
#include <process.h> // *MUST* be included before ANY Wnet/Wlib headers if _REENTRANT is defined
2525
#endif
2626

@@ -128,7 +128,7 @@ int main(int argc, char **argv)
128128

129129

130130
// ----- Initialize Winsock -----
131-
#ifdef _WINDOWS
131+
#ifdef _WIN32
132132
WORD verReq = MAKEWORD(2, 2);
133133
WSADATA wsadata;
134134

Core/Tools/mangler/wlib/sem4.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This is useful because the constructor will automatically call sem_init
3131

3232
Sem4::Sem4()
3333
{
34-
#ifndef _WINDOWS
34+
#ifndef _WIN32
3535
sem_init(&sem,1,1);
3636
#else
3737
sem = CreateSemaphore(NULL, 1, 1, NULL);
@@ -40,7 +40,7 @@ Sem4::Sem4()
4040

4141
Sem4::Sem4(uint32 value)
4242
{
43-
#ifndef _WINDOWS
43+
#ifndef _WIN32
4444
sem_init(&sem,1,value);
4545
#else
4646
sem = CreateSemaphore(NULL, value, value, NULL);
@@ -49,7 +49,7 @@ Sem4::Sem4(uint32 value)
4949

5050
Sem4::~Sem4()
5151
{
52-
#ifndef _WINDOWS
52+
#ifndef _WIN32
5353
sem_destroy(&sem);
5454
#else
5555
if (sem) CloseHandle(sem);
@@ -58,7 +58,7 @@ Sem4::~Sem4()
5858

5959
sint32 Sem4::Wait(void) const
6060
{
61-
#ifndef _WINDOWS
61+
#ifndef _WIN32
6262
return(sem_wait((sem_t *)&sem));
6363
#else
6464
if (!sem)
@@ -79,7 +79,7 @@ sint32 Sem4::Wait(void) const
7979

8080
sint32 Sem4::Post(void) const
8181
{
82-
#ifndef _WINDOWS
82+
#ifndef _WIN32
8383
return(sem_post((sem_t *)&sem));
8484
#else
8585
if (!sem)
@@ -92,7 +92,7 @@ sint32 Sem4::Post(void) const
9292

9393
sint32 Sem4::TryWait(void) const
9494
{
95-
#ifndef _WINDOWS
95+
#ifndef _WIN32
9696
return(sem_trywait((sem_t *)&sem));
9797
#else
9898
if (!sem)
@@ -112,7 +112,7 @@ sint32 Sem4::TryWait(void) const
112112

113113
sint32 Sem4::GetValue(int *sval) const
114114
{
115-
#ifndef _WINDOWS
115+
#ifndef _WIN32
116116
return(sem_getvalue((sem_t *)&sem,sval));
117117
#else
118118
if (!sem)
@@ -128,7 +128,7 @@ sint32 Sem4::GetValue(int *sval) const
128128

129129
sint32 Sem4::Destroy(void)
130130
{
131-
#ifndef _WINDOWS
131+
#ifndef _WIN32
132132
return(sem_destroy(&sem));
133133
#else
134134
return CloseHandle(sem);

Core/Tools/mangler/wlib/sem4.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
#pragma once
2020

2121
#include <limits.h>
22-
#ifndef _WINDOWS
22+
#ifndef _WIN32
2323
#include <unistd.h>
2424
#endif
2525
#include "wstypes.h"
2626

2727
#ifdef _REENTRANT
28-
#ifndef _WINDOWS
28+
#ifndef _WIN32
2929
#include <semaphore.h>
3030
#else
3131
#include <windows.h>
@@ -42,7 +42,7 @@ class Sem4
4242
{
4343
private:
4444
#ifdef _REENTRANT
45-
#ifndef _WINDOWS
45+
#ifndef _WIN32
4646
sem_t sem;
4747
#else
4848
HANDLE sem;

Core/Tools/mangler/wlib/syslogd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020

2121
SyslogD::SyslogD(char *ident,int logopt,int facility,int _priority)
2222
{
23-
#ifndef _WINDOWS
23+
#ifndef _WIN32
2424
openlog(ident,logopt,facility);
2525
priority=_priority;
2626
#endif
2727
}
2828

2929
int SyslogD::print(const char *str, int len)
3030
{
31-
#ifndef _WINDOWS
31+
#ifndef _WIN32
3232
char *temp_str=new char[len+1];
3333
memset(temp_str,0,len+1);
3434
strncpy(temp_str,str,len);

Core/Tools/mangler/wlib/syslogd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <stdlib.h>
2222
#include <stdio.h>
23-
#ifndef _WINDOWS
23+
#ifndef _WIN32
2424
#include <syslog.h>
2525
#endif
2626
#include <string.h>

Core/Tools/mangler/wlib/timezone.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
void GetTimezoneInfo(const char * &timezone_str, int &timezone_offset) {
2323
timezone_str = "Unknown Timezone";
2424
timezone_offset = 0;
25-
#ifdef _WINDOWS
25+
#ifdef _WIN32
2626
struct _timeb wintime;
2727
_ftime(&wintime);
2828

@@ -37,7 +37,7 @@ void GetTimezoneInfo(const char * &timezone_str, int &timezone_offset) {
3737
timezone_offset = wintime.timezone * 60; // its in minutes...
3838

3939
#endif
40-
#ifndef _WINDOWS
40+
#ifndef _WIN32
4141
struct timeval unixtime;
4242
struct timezone unixtzone;
4343
gettimeofday(&unixtime,&unixtzone);

0 commit comments

Comments
 (0)