Skip to content

Commit 3ce42d3

Browse files
Replaced #ifdef PLATFORM_XXX with #if PLATFORM_XXX
1 parent 7b18613 commit 3ce42d3

File tree

20 files changed

+77
-76
lines changed

20 files changed

+77
-76
lines changed

Common/interface/StringTools.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <locale>
2929
#include <algorithm>
3030
#include <cctype>
31+
#include <string.h>
3132
#include "DebugUtilities.h"
3233

3334
namespace Diligent
@@ -69,7 +70,7 @@ inline std::wstring WidenString(const std::string &Str)
6970

7071
inline int StrCmpNoCase(const char* Str1, const char* Str2, size_t NumChars)
7172
{
72-
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_LINUX) || defined(PLATFORM_MACOS) || defined(PLATFORM_IOS)
73+
#if PLATFORM_ANDROID || PLATFORM_LINUX || PLATFORM_MACOS || PLATFORM_IOS
7374
# define _strnicmp strncasecmp
7475
#endif
7576

@@ -78,7 +79,7 @@ inline int StrCmpNoCase(const char* Str1, const char* Str2, size_t NumChars)
7879

7980
inline int StrCmpNoCase(const char* Str1, const char* Str2)
8081
{
81-
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_LINUX) || defined(PLATFORM_MACOS) || defined(PLATFORM_IOS)
82+
#if PLATFORM_ANDROID || PLATFORM_LINUX || PLATFORM_MACOS || PLATFORM_IOS
8283
# define _stricmp strcasecmp
8384
#endif
8485

Graphics/GraphicsEngineD3D11/include/pch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
#include <vector>
3939
#include <exception>
4040
#include <algorithm>
41-
#if defined(PLATFORM_WIN32)
41+
#if PLATFORM_WIN32
4242
#include <d3d11.h>
43-
#elif defined(PLATFORM_UNIVERSAL_WINDOWS)
43+
#elif PLATFORM_UNIVERSAL_WINDOWS
4444
#include <d3d11_2.h>
4545
#endif
4646

Graphics/GraphicsEngineD3D11/src/RenderDeviceFactoryD3D11.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void EngineFactoryD3D11Impl::CreateDeviceAndContextsD3D11( const EngineD3D11Attr
128128
// description. All applications are assumed to support 9.1 unless otherwise stated.
129129
D3D_FEATURE_LEVEL featureLevels[] =
130130
{
131-
#ifdef PLATFORM_UNIVERSAL_WINDOWS
131+
#if PLATFORM_UNIVERSAL_WINDOWS
132132
D3D_FEATURE_LEVEL_11_1,
133133
#endif
134134
D3D_FEATURE_LEVEL_11_0,

Graphics/GraphicsEngineD3D11/src/SwapChainD3D11Impl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ SwapChainD3D11Impl::SwapChainD3D11Impl(IReferenceCounters *pRefCounters,
4040
TSwapChainBase(pRefCounters, pRenderDeviceD3D11, pDeviceContextD3D11, SCDesc)
4141
{
4242

43-
#ifdef PLATFORM_WIN32
43+
#if PLATFORM_WIN32
4444
auto hWnd = reinterpret_cast<HWND>(pNativeWndHandle);
4545

4646
if( m_SwapChainDesc.Width == 0 || m_SwapChainDesc.Height == 0 )
@@ -79,7 +79,7 @@ SwapChainD3D11Impl::SwapChainD3D11Impl(IReferenceCounters *pRefCounters,
7979

8080
CComPtr<IDXGISwapChain1> pSwapChain1;
8181

82-
#if defined( PLATFORM_WIN32 )
82+
#if PLATFORM_WIN32
8383
// This sequence obtains the DXGI factory that was used to create the Direct3D device above.
8484
CComPtr<IDXGIDevice> pDXGIDevice;
8585
pDevice->QueryInterface(__uuidof(IDXGIDevice), reinterpret_cast<void**>( static_cast<IDXGIDevice**>(&pDXGIDevice) ) );
@@ -91,7 +91,7 @@ SwapChainD3D11Impl::SwapChainD3D11Impl(IReferenceCounters *pRefCounters,
9191
CHECK_D3D_RESULT_THROW( pDXGIFactory->CreateSwapChainForHwnd(pDevice, hWnd, &swapChainDesc, nullptr, nullptr, &pSwapChain1),
9292
"Failed to create DXGI swap chain" );
9393

94-
#elif defined( PLATFORM_UNIVERSAL_WINDOWS )
94+
#elif PLATFORM_UNIVERSAL_WINDOWS
9595

9696
CComPtr<IDXGIDevice3> pDXGIDevice;
9797
pDevice->QueryInterface(__uuidof(IDXGIDevice3), reinterpret_cast<void**>(static_cast<IDXGIDevice3**>(&pDXGIDevice)));
@@ -173,7 +173,7 @@ IMPLEMENT_QUERY_INTERFACE( SwapChainD3D11Impl, IID_SwapChainD3D11, TSwapChainBas
173173
void SwapChainD3D11Impl::Present()
174174
{
175175
UINT SyncInterval = 0;
176-
#ifdef PLATFORM_UNIVERSAL_WINDOWS
176+
#if PLATFORM_UNIVERSAL_WINDOWS
177177
SyncInterval = 1; // Interval 0 is not supported on Windows Phone
178178
#endif
179179

Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ SwapChainD3D12Impl::SwapChainD3D12Impl(IReferenceCounters *pRefCounters,
4141
m_pBackBufferRTV(STD_ALLOCATOR_RAW_MEM(RefCntAutoPtr<ITextureView>, GetRawAllocator(), "Allocator for vector<RefCntAutoPtr<ITextureView>>"))
4242
{
4343

44-
#ifdef PLATFORM_WIN32
44+
#if PLATFORM_WIN32
4545
auto hWnd = reinterpret_cast<HWND>(pNativeWndHandle);
4646

4747
if( m_SwapChainDesc.Width == 0 || m_SwapChainDesc.Height == 0 )
@@ -82,14 +82,14 @@ SwapChainD3D12Impl::SwapChainD3D12Impl(IReferenceCounters *pRefCounters,
8282
CHECK_D3D_RESULT_THROW(hr, "Failed to create DXGI factory")
8383

8484
auto *pd3d12CmdQueue = pRenderDeviceD3D12->GetCmdQueue()->GetD3D12CommandQueue();
85-
#if defined( PLATFORM_WIN32 )
85+
#if PLATFORM_WIN32
8686
hr = factory->CreateSwapChainForHwnd(pd3d12CmdQueue, hWnd, &swapChainDesc, nullptr, nullptr, &pSwapChain1);
8787
CHECK_D3D_RESULT_THROW( hr, "Failed to create Swap Chain" );
8888

8989
// This sample does not support fullscreen transitions.
9090
hr = factory->MakeWindowAssociation(hWnd, DXGI_MWA_NO_WINDOW_CHANGES | DXGI_MWA_NO_ALT_ENTER);
9191

92-
#elif defined( PLATFORM_UNIVERSAL_WINDOWS )
92+
#elif PLATFORM_UNIVERSAL_WINDOWS
9393

9494
hr = factory->CreateSwapChainForCoreWindow(
9595
pd3d12CmdQueue,
@@ -168,7 +168,7 @@ IMPLEMENT_QUERY_INTERFACE( SwapChainD3D12Impl, IID_SwapChainD3D12, TSwapChainBas
168168
void SwapChainD3D12Impl::Present()
169169
{
170170
UINT SyncInterval = 0;
171-
#ifdef PLATFORM_UNIVERSAL_WINDOWS
171+
#if PLATFORM_UNIVERSAL_WINDOWS
172172
SyncInterval = 1; // Interval 0 is not supported on Windows Phone
173173
#endif
174174

@@ -196,7 +196,7 @@ void SwapChainD3D12Impl::Present()
196196
pDeviceD3D12->FinishFrame();
197197

198198
#if 0
199-
#ifdef PLATFORM_UNIVERSAL_WINDOWS
199+
#if PLATFORM_UNIVERSAL_WINDOWS
200200
// A successful Present call for DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL SwapChains unbinds
201201
// backbuffer 0 from all GPU writeable bind points.
202202
// We need to rebind all render targets to make sure that

Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ HRESULT CompileShader( const char* Source,
120120
auto ErrorDesc = errorss.str();
121121
OutputDebugStringW( ErrorDesc.c_str() );
122122
if( FAILED(hr)
123-
#ifdef PLATFORM_WIN32
123+
#if PLATFORM_WIN32
124124
&& IDRETRY != MessageBoxW( NULL, ErrorDesc.c_str() , L"FX Error", MB_ICONERROR | (Source == nullptr ? MB_ABORTRETRYIGNORE : 0) )
125125
#endif
126126
)

Graphics/GraphicsEngineOpenGL/include/GLContext.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323

2424
#pragma once
2525

26-
#if defined(PLATFORM_WIN32)
26+
#if PLATFORM_WIN32
2727
# include "GLContextWindows.h"
28-
#elif defined(PLATFORM_ANDROID)
28+
#elif PLATFORM_ANDROID
2929
# include "GLContextAndroid.h"
30-
#elif defined(PLATFORM_LINUX)
30+
#elif PLATFORM_LINUX
3131
# include "GLContextLinux.h"
32-
#elif defined(PLATFORM_MACOS)
32+
#elif PLATFORM_MACOS
3333
# include "GLContextMacOS.h"
34-
#elif defined(PLATFORM_IOS)
34+
#elif PLATFORM_IOS
3535
# include "GLContextIOS.h"
3636
#else
3737
# error Unsupported platform

Graphics/GraphicsEngineOpenGL/include/pch.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include <unordered_set>
3636
#include <algorithm>
3737

38-
#if defined(PLATFORM_WIN32)
38+
#if PLATFORM_WIN32
3939

4040
# ifndef GLEW_STATIC
4141
# define GLEW_STATIC // Must be defined to use static version of glew
@@ -46,7 +46,7 @@
4646
# include "GL/wglew.h"
4747
# include <GL/GL.h>
4848

49-
#elif defined(PLATFORM_LINUX)
49+
#elif PLATFORM_LINUX
5050

5151
# ifndef GLEW_STATIC
5252
# define GLEW_STATIC // Must be defined to use static version of glew
@@ -75,7 +75,7 @@
7575
# undef Success
7676
# endif
7777

78-
#elif defined(PLATFORM_MACOS)
78+
#elif PLATFORM_MACOS
7979

8080
# ifndef GLEW_STATIC
8181
# define GLEW_STATIC // Must be defined to use static version of glew
@@ -86,14 +86,14 @@
8686

8787
# include "GL/glew.h"
8888

89-
#elif defined(PLATFORM_ANDROID)
89+
#elif PLATFORM_ANDROID
9090

9191
# include <GLES3/gl3.h>
9292
# include <GLES3/gl3ext.h>
9393
// GLStubs must be included after GLFeatures!
9494
# include "GLStubsAndroid.h"
9595

96-
#elif defined(PLATFORM_IOS)
96+
#elif PLATFORM_IOS
9797

9898
# include <OpenGLES/ES3/gl.h>
9999
# include <OpenGLES/ES3/glext.h>

Graphics/GraphicsEngineOpenGL/interface/BaseInterfacesGL.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323

2424
#pragma once
2525

26-
#if defined(PLATFORM_ANDROID)
26+
#if PLATFORM_ANDROID
2727
#include "RenderDeviceGLES.h"
2828
namespace Diligent
2929
{
3030
using IGLDeviceBaseInterface = IRenderDeviceGLES;
3131
}
32-
#elif defined(PLATFORM_WIN32) || defined(PLATFORM_LINUX) || defined(PLATFORM_MACOS)
32+
#elif PLATFORM_WIN32 || PLATFORM_LINUX || PLATFORM_MACOS
3333
#include "RenderDeviceGL.h"
3434
namespace Diligent
3535
{
3636
using IGLDeviceBaseInterface = IRenderDeviceGL;
3737
}
38-
#elif defined(PLATFORM_IOS)
38+
#elif PLATFORM_IOS
3939
#include "RenderDeviceGL.h"
4040
namespace Diligent
4141
{

Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
#include "HLSL2GLSLConverter.h"
3333
#include "EngineGLAttribs.h"
3434

35-
#if defined(PLATFORM_WIN32) || defined(PLATFORM_UNIVERSAL_WINDOWS)
35+
#if PLATFORM_WIN32 || PLATFORM_UNIVERSAL_WINDOWS
3636

3737
# define API_QUALIFIER
3838

39-
#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_LINUX) || defined(PLATFORM_MACOS) || defined(PLATFORM_IOS)
39+
#elif PLATFORM_ANDROID || PLATFORM_LINUX || PLATFORM_MACOS || PLATFORM_IOS
4040

4141
# ifdef ENGINE_DLL
4242
# ifdef BUILDING_DLL
@@ -74,7 +74,7 @@ class IEngineFactoryOpenGL
7474
extern "C"
7575
{
7676

77-
#if defined(ENGINE_DLL) && (defined(PLATFORM_WIN32) || defined(PLATFORM_UNIVERSAL_WINDOWS))
77+
#if ENGINE_DLL && (PLATFORM_WIN32 || PLATFORM_UNIVERSAL_WINDOWS)
7878

7979
typedef Diligent::IEngineFactoryOpenGL* (*GetEngineFactoryOpenGLType)();
8080

0 commit comments

Comments
 (0)