Skip to content

Commit fb56667

Browse files
committed
Use predefined _WIN32 everywhere instead of defining WINDOWS
Signed-off-by: Gary Oberbrunner <[email protected]>
1 parent 2c1390d commit fb56667

File tree

16 files changed

+48
-46
lines changed

16 files changed

+48
-46
lines changed

Examples/OpenGL/opengl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
#ifdef __APPLE__
1212
#include <OpenGL/gl.h>
1313
#else
14-
#if defined(WINDOWS)
14+
#if defined(_WIN32)
15+
#define NOMINMAX
1516
#include <windows.h>
1617
#endif
1718
#include <GL/gl.h>

HostSupport/include/ofxhBinary.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525

2626
#if defined(UNIX)
2727
#include <dlfcn.h>
28-
#elif defined (WINDOWS)
28+
#elif defined (_WIN32)
29+
#define NOMINMAX
2930
#include "windows.h"
3031
#include <assert.h>
3132
#endif
@@ -44,7 +45,7 @@ namespace OFX
4445
bool _invalid;
4546
#if defined(UNIX)
4647
void *_dlHandle;
47-
#elif defined (WINDOWS)
48+
#elif defined (_WIN32)
4849
HINSTANCE _dlHandle;
4950
#endif
5051
time_t _time;

HostSupport/include/ofxhPropertySuite.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,18 +305,18 @@ namespace OFX {
305305
// get multiple values
306306
void getValueN(APIType *value, int count) const;
307307

308-
#ifdef WINDOWS
309-
#pragma warning( disable : 4181 )
310-
#endif
308+
#ifdef _WIN32
309+
#pragma warning( disable : 4181 )
310+
#endif
311311
/// get one value
312312
const ReturnType getValue(int index=0) const;
313313

314314
/// get one value, without going through the getHook
315315
const ReturnType getValueRaw(int index=0) const;
316316

317-
#ifdef WINDOWS
318-
#pragma warning( default : 4181 )
319-
#endif
317+
#ifdef _WIN32
318+
#pragma warning( default : 4181 )
319+
#endif
320320
// get multiple values, without going through the getHook
321321
void getValueNRaw(APIType *value, int count) const;
322322

HostSupport/src/ofxhBinary.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void Binary::unload() {
6161
if (_dlHandle != 0) {
6262
#if defined (UNIX)
6363
dlclose(_dlHandle);
64-
#elif defined (WINDOWS)
64+
#elif defined (_WIN32)
6565
FreeLibrary(_dlHandle);
6666
#endif
6767
_dlHandle = 0;
@@ -74,7 +74,7 @@ void *Binary::findSymbol(const std::string &symbol) {
7474
if (_dlHandle != 0) {
7575
#if defined(UNIX)
7676
return dlsym(_dlHandle, symbol.c_str());
77-
#elif defined (WINDOWS)
77+
#elif defined (_WIN32)
7878
return (void*)GetProcAddress(_dlHandle, symbol.c_str());
7979
#endif
8080
} else {

HostSupport/src/ofxhImageEffectAPI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace OFX {
3434
OFX::Host::ImageEffect::Host *gImageEffectHost;
3535

3636
/// ctor
37-
#ifdef WINDOWS
37+
#ifdef _WIN32
3838
#pragma warning( disable : 4355 )
3939
#endif
4040
ImageEffectPlugin::ImageEffectPlugin(PluginCache &pc, PluginBinary *pb, int pi, OfxPlugin *pl)
@@ -63,7 +63,7 @@ namespace OFX {
6363
_baseDescriptor = gImageEffectHost->makeDescriptor(this);
6464
}
6565

66-
#ifdef WINDOWS
66+
#ifdef _WIN32
6767
#pragma warning( default : 4355 )
6868
#endif
6969

HostSupport/src/ofxhPluginCache.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static const char *getArchStr()
6464
#define DIRSEP "/"
6565
#include <dirent.h>
6666

67-
#elif defined (WINDOWS)
67+
#elif defined (_WIN32)
6868
#define DIRLIST_SEP_CHARS ";"
6969
#ifdef _WIN64
7070
#define ARCHSTR "win64"
@@ -73,6 +73,7 @@ static const char *getArchStr()
7373
#endif
7474
#define DIRSEP "\\"
7575

76+
#define NOMINMAX
7677
#include "shlobj.h"
7778
#include "tchar.h"
7879
#endif
@@ -157,7 +158,7 @@ PluginHandle::~PluginHandle() {
157158
}
158159

159160

160-
#if defined (WINDOWS)
161+
#if defined (_WIN32)
161162
const TCHAR *getStdOFXPluginPath(const std::string &hostId = "Plugins")
162163
{
163164
static TCHAR buffer[MAX_PATH];
@@ -174,7 +175,7 @@ const TCHAR *getStdOFXPluginPath(const std::string &hostId = "Plugins")
174175
static
175176
std::string OFXGetEnv(const char* e)
176177
{
177-
#if defined(WINDOWS) && !defined(__MINGW32__)
178+
#if defined(_WIN32) && !defined(__MINGW32__)
178179
size_t requiredSize;
179180
getenv_s(&requiredSize, 0, 0, e);
180181
std::vector<char> buffer(requiredSize);
@@ -239,8 +240,8 @@ PluginCache::PluginCache() : _hostSpec(0), _xmlCurrentBinary(0), _xmlCurrentPlug
239240

240241
_pluginPath.push_back(path);
241242
}
242-
243-
#if defined(WINDOWS)
243+
244+
#if defined(_WIN32)
244245
_pluginPath.push_back(getStdOFXPluginPath());
245246
_pluginPath.push_back("C:\\Program Files\\Common Files\\OFX\\Plugins");
246247
#endif
@@ -253,7 +254,7 @@ PluginCache::PluginCache() : _hostSpec(0), _xmlCurrentBinary(0), _xmlCurrentPlug
253254
}
254255

255256
void PluginCache::setPluginHostPath(const std::string &hostId) {
256-
#if defined(WINDOWS)
257+
#if defined(_WIN32)
257258
_pluginPath.push_back(getStdOFXPluginPath(hostId));
258259
_pluginPath.push_back("C:\\Program Files\\Common Files\\OFX\\" + hostId);
259260
#endif
@@ -270,8 +271,8 @@ void PluginCache::scanDirectory(std::set<std::string> &foundBinFiles, const std:
270271
#ifdef CACHE_DEBUG
271272
printf("looking in %s for plugins\n", dir.c_str());
272273
#endif
273-
274-
#if defined (WINDOWS)
274+
275+
#if defined (_WIN32)
275276
WIN32_FIND_DATA findData;
276277
HANDLE findHandle;
277278
#else
@@ -285,7 +286,7 @@ void PluginCache::scanDirectory(std::set<std::string> &foundBinFiles, const std:
285286

286287
#if defined (UNIX)
287288
while (dirent *de = readdir(d))
288-
#elif defined (WINDOWS)
289+
#elif defined (_WIN32)
289290
findHandle = FindFirstFile((dir + "\\*").c_str(), &findData);
290291

291292
if (findHandle == INVALID_HANDLE_VALUE)
@@ -369,7 +370,7 @@ void PluginCache::scanDirectory(std::set<std::string> &foundBinFiles, const std:
369370
scanDirectory(foundBinFiles, dir + DIRSEP + name, recurse);
370371
}
371372
}
372-
#if defined(WINDOWS)
373+
#if defined(_WIN32)
373374
int rval = FindNextFile(findHandle, &findData);
374375

375376
if (rval == 0) {

HostSupport/src/ofxhPropertySuite.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ namespace OFX {
221221
: Property(pt)
222222
, _value(pt._value)
223223
, _defaultValue(pt._defaultValue)
224-
{
224+
{
225225
}
226226

227-
#ifdef WINDOWS
227+
#ifdef _WIN32
228228
#pragma warning( disable : 4181 )
229229
#endif
230230
/// get one value
@@ -238,7 +238,7 @@ namespace OFX {
238238
return getValueRaw(index);
239239
}
240240
}
241-
#ifdef WINDOWS
241+
#ifdef _WIN32
242242
#pragma warning( default : 4181 )
243243
#endif
244244
// get multiple values
@@ -252,7 +252,7 @@ namespace OFX {
252252
}
253253
}
254254

255-
#ifdef WINDOWS
255+
#ifdef _WIN32
256256
#pragma warning( disable : 4181 )
257257
#endif
258258
/// get one value, without going through the getHook
@@ -264,9 +264,9 @@ namespace OFX {
264264
}
265265
return _value[index];
266266
}
267-
#ifdef WINDOWS
267+
#ifdef _WIN32
268268
#pragma warning( default : 4181 )
269-
#endif
269+
#endif
270270
// get multiple values, without going through the getHook
271271
template<class T>
272272
void PropertyTemplate<T>::getValueNRaw(APIType *value, int count) const

Support/Plugins/Basic/basic.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Copyright OpenFX and contributors to the OpenFX project.
22
// SPDX-License-Identifier: BSD-3-Clause
33

4-
#ifdef _WINDOWS
4+
#ifdef _WIN32
5+
#define NOMINMAX
56
#include <windows.h>
67
#endif
78

Support/Plugins/ChoiceParams/choiceparams.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Copyright OpenFX and contributors to the OpenFX project.
22
// SPDX-License-Identifier: BSD-3-Clause
33

4-
#ifdef _WINDOWS
4+
#ifdef _WIN32
5+
#define NOMINMAX
56
#include <windows.h>
67
#endif
78

Support/Plugins/Field/field.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Copyright OpenFX and contributors to the OpenFX project.
22
// SPDX-License-Identifier: BSD-3-Clause
33

4-
#ifdef _WINDOWS
4+
#ifdef _WIN32
5+
#define NOMINMAX
56
#include <windows.h>
67
#endif
78

0 commit comments

Comments
 (0)