Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Quiet -Wundef warning

Campbell Bartond869b5f8e6c7
diff --git a/toonz/sources/common/psdlib/psd.cpp b/toonz/sources/common/psdlib/psd.cpp
index 10db96c7c..9ec24deda 100644
--- a/toonz/sources/common/psdlib/psd.cpp
+++ b/toonz/sources/common/psdlib/psd.cpp
@@ -1,6 +1,6 @@
-#if _MSC_VER >= 1400
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
diff --git a/toonz/sources/common/psdlib/psdutils.cpp b/toonz/sources/common/psdlib/psdutils.cpp
index 13eae1789..059bfc942 100644
--- a/toonz/sources/common/psdlib/psdutils.cpp
+++ b/toonz/sources/common/psdlib/psdutils.cpp
@@ -1,6 +1,4 @@
-
-
-#if _MSC_VER >= 1400
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
diff --git a/toonz/sources/common/tapptools/ttimer.cpp b/toonz/sources/common/tapptools/ttimer.cpp
index 272616461..033e99bb8 100644
--- a/toonz/sources/common/tapptools/ttimer.cpp
+++ b/toonz/sources/common/tapptools/ttimer.cpp
@@ -187,7 +187,7 @@ Uint32 ElapsedTimeCB(Uint32 interval, void *param) {
}
}
-#elif __sgi
+#elif defined(__sgi)
class TTimer::Imp {
public:
Imp(std::string name, UINT timerRes, TTimer::Type type, TTimer *timer)
@@ -219,7 +219,7 @@ public:
TGenericTimerAction *m_action;
};
-#elif MACOSX
+#elif defined(MACOSX)
class TTimer::Imp {
public:
Imp(std::string name, UINT timerRes, TTimer::Type type, TTimer *timer)
diff --git a/toonz/sources/common/tgl/tgl.cpp b/toonz/sources/common/tgl/tgl.cpp
index 1cc7d2b3b..c4bcd70e4 100644
--- a/toonz/sources/common/tgl/tgl.cpp
+++ b/toonz/sources/common/tgl/tgl.cpp
@@ -474,13 +474,13 @@ void tglDraw(const TRectD &rect, const TRaster32P &tex, bool blending) {
} else
texture = tex;
GLenum fmt =
-#ifdef TNZ_MACHINE_CHANNEL_ORDER_BGRM
+#if defined(TNZ_MACHINE_CHANNEL_ORDER_BGRM)
GL_BGRA_EXT;
-#elif TNZ_MACHINE_CHANNEL_ORDER_MBGR
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MBGR)
GL_ABGR_EXT;
-#elif TNZ_MACHINE_CHANNEL_ORDER_RGBM
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_RGBM)
GL_RGBA;
-#elif TNZ_MACHINE_CHANNEL_ORDER_MRGB
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MRGB)
GL_BGRA;
#else
// Error PLATFORM NOT SUPPORTED
diff --git a/toonz/sources/common/tipc/tipc.cpp b/toonz/sources/common/tipc/tipc.cpp
index 93f77de18..e379a9db8 100644
--- a/toonz/sources/common/tipc/tipc.cpp
+++ b/toonz/sources/common/tipc/tipc.cpp
@@ -13,12 +13,12 @@
#include <QTimer>
// System-specific includes
-#ifdef _WIN32
+#if defined(_WIN32)
#include <windows.h>
-#elif MACOSX
+#elif defined(MACOSX)
#include <sys/sysctl.h>
#include <unistd.h>
-#elif LINUX
+#elif defined(LINUX)
#include <sys/time.h>
#include <unistd.h>
#endif
diff --git a/toonz/sources/common/tvectorimage/outlineApproximation.h b/toonz/sources/common/tvectorimage/outlineApproximation.h
index b17a69017..dc6d8954d 100644
--- a/toonz/sources/common/tvectorimage/outlineApproximation.h
+++ b/toonz/sources/common/tvectorimage/outlineApproximation.h
@@ -7,7 +7,7 @@
#if !defined(OUTLINEAPPROXIMATION_H)
#define OUTLINEAPPROXIMATION_H
-#if _MSC_VER > 1000
+#if defined(_MSC_VER) && (_MSC_VER > 1000)
#pragma once
#endif // _MSC_VER > 1000
diff --git a/toonz/sources/common/tvectorimage/tstroke.cpp b/toonz/sources/common/tvectorimage/tstroke.cpp
index fda300f9b..6939e5ebe 100644
--- a/toonz/sources/common/tvectorimage/tstroke.cpp
+++ b/toonz/sources/common/tvectorimage/tstroke.cpp
@@ -1797,7 +1797,7 @@ void TStroke::reduceControlPoints(double error, vector<int> corners) {
}
controlPoints.push_back(m_imp->m_centerLineArray.back()->getThickP2());
-#if _DEBUG
+#ifdef _DEBUG
cpSize = controlPoints.size();
for (cp = 1; cp < cpSize; cp++)
assert(!(controlPoints[cp - 1] == controlPoints[cp]));
@@ -2341,7 +2341,7 @@ void TStroke::draw(const TVectorRenderData &rd) const
//-----------------------------------------------------------------------------
TStrokeProp *TStroke::getProp() const {
-#if DISEGNO_OUTLINE == 0
+#if !defined(DISEGNO_OUTLINE)
if (!m_imp->m_styleId) return 0;
#endif
diff --git a/toonz/sources/common/tvrender/qtofflinegl.cpp b/toonz/sources/common/tvrender/qtofflinegl.cpp
index f9581f061..0ef487ebd 100644
--- a/toonz/sources/common/tvrender/qtofflinegl.cpp
+++ b/toonz/sources/common/tvrender/qtofflinegl.cpp
@@ -127,7 +127,7 @@ void QtOfflineGL::createContext(TDimension rasterSize,
QGLFormat fmt;
-#ifdef _WIN32
+#if defined(_WIN32)
fmt.setAlphaBufferSize(8);
fmt.setAlpha(true);
fmt.setRgba(true);
@@ -137,7 +137,7 @@ void QtOfflineGL::createContext(TDimension rasterSize,
fmt.setStencil(true);
fmt.setAccum(false);
fmt.setPlane(0);
-#elif MACOSX
+#elif defined(MACOSX)
fmt = QGLFormat::defaultFormat();
// printf("GL Version: %s\n",glGetString(GL_VERSION));
fmt.setVersion(2, 1); /* OSX10.8 では 3.2 だめかも */
@@ -153,7 +153,7 @@ void QtOfflineGL::createContext(TDimension rasterSize,
fmt.setPlane(0);
fmt.setDirectRendering(false);
#endif
-#elif LINUX
+#elif defined(LINUX)
fmt = QGLFormat::defaultFormat();
// printf("GL Version: %s\n",glGetString(GL_VERSION));
fmt.setVersion(2, 1); /* XXX? */
@@ -279,7 +279,7 @@ SPECIFICHE MAC = depth_size 24, stencil_size 8, alpha_size 1
QGLFormat fmt;
-#ifdef _WIN32
+#ifdef defined(_WIN32)
fmt.setAlphaBufferSize(8);
fmt.setAlpha(false);
fmt.setRgba(true);
@@ -289,7 +289,7 @@ SPECIFICHE MAC = depth_size 24, stencil_size 8, alpha_size 1
fmt.setStencil(true);
fmt.setAccum(false);
fmt.setPlane(0);
-#elif MACOSX
+#elif defined(MACOSX)
fmt.setAlphaBufferSize(1);
fmt.setAlpha(false);
fmt.setRgba(true);
@@ -299,7 +299,7 @@ SPECIFICHE MAC = depth_size 24, stencil_size 8, alpha_size 1
fmt.setStencil(true);
fmt.setAccum(false);
fmt.setPlane(0);
-#elif LINUX
+#elif defined(LINUX)
fmt.setAlphaBufferSize(1);
fmt.setAlpha(false);
fmt.setRgba(true);
diff --git a/toonz/sources/common/tvrender/tofflinegl.cpp b/toonz/sources/common/tvrender/tofflinegl.cpp
index 70eadb0ea..eaab4d92e 100644
--- a/toonz/sources/common/tvrender/tofflinegl.cpp
+++ b/toonz/sources/common/tvrender/tofflinegl.cpp
@@ -19,7 +19,7 @@
#include "tthread.h"
-#elif MACOSX
+#elif defined(MACOSX)
#include "qtofflinegl.h"
@@ -490,7 +490,7 @@ std::shared_ptr<TOfflineGL::Imp> defaultOfflineGLGenerator(
return std::make_shared<QtOfflineGL>(dim, shared);
}
-#elif MACOSX
+#elif defined(MACOSX)
std::shared_ptr<TOfflineGL::Imp> defaultOfflineGLGenerator(
const TDimension &dim, std::shared_ptr<TOfflineGL::Imp> shared) {
diff --git a/toonz/sources/image/bmp/filebmp.h b/toonz/sources/image/bmp/filebmp.h
index 63b7e532e..7d5785cc9 100644
--- a/toonz/sources/image/bmp/filebmp.h
+++ b/toonz/sources/image/bmp/filebmp.h
@@ -7,7 +7,7 @@
extern "C" {
#endif
/*
-#if defined(WIN32)
+#if defined(_WIN32)
typedef struct {unsigned char b,g,r,m;} LPIXEL;
#elif defined(__sgi)
typedef struct { unsigned char m,b,g,r; } LPIXEL;
diff --git a/toonz/sources/image/png/tiio_png.cpp b/toonz/sources/image/png/tiio_png.cpp
index 34193c1b8..dc4086690 100644
--- a/toonz/sources/image/png/tiio_png.cpp
+++ b/toonz/sources/image/png/tiio_png.cpp
@@ -1,4 +1,4 @@
-#if _MSC_VER >= 1400
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
diff --git a/toonz/sources/image/quantel/filequantel.c b/toonz/sources/image/quantel/filequantel.c
index cc8f264ab..9159d1438 100644
--- a/toonz/sources/image/quantel/filequantel.c
+++ b/toonz/sources/image/quantel/filequantel.c
@@ -1,6 +1,6 @@
-#if _MSC_VER >= 1400
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#pragma warning(disable : 4996)
#endif
diff --git a/toonz/sources/image/sgi/filesgi.cpp b/toonz/sources/image/sgi/filesgi.cpp
index b91d7fa0d..23e23b514 100644
--- a/toonz/sources/image/sgi/filesgi.cpp
+++ b/toonz/sources/image/sgi/filesgi.cpp
@@ -1,6 +1,6 @@
-#if _MSC_VER >= 1400
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#pragma warning(disable : 4996)
#endif
diff --git a/toonz/sources/image/tga/tiio_tga.cpp b/toonz/sources/image/tga/tiio_tga.cpp
index 949e3c7ce..d1f26474c 100644
--- a/toonz/sources/image/tga/tiio_tga.cpp
+++ b/toonz/sources/image/tga/tiio_tga.cpp
@@ -1,6 +1,6 @@
-#if _MSC_VER >= 1400
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#pragma warning(disable : 4996)
#endif
diff --git a/toonz/sources/image/tif/tiio_tif.cpp b/toonz/sources/image/tif/tiio_tif.cpp
index 323f86201..74f886987 100644
--- a/toonz/sources/image/tif/tiio_tif.cpp
+++ b/toonz/sources/image/tif/tiio_tif.cpp
@@ -1,9 +1,9 @@
-#if _MSC_VER >= 1400
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
#define IS_TIFF_MAIN
-#if _WIN32
+#if defined(_WIN32)
#include <io.h>
#else
#include <unistd.h>
diff --git a/toonz/sources/image/tiio.cpp b/toonz/sources/image/tiio.cpp
index 336e6b041..e57669ca6 100644
--- a/toonz/sources/image/tiio.cpp
+++ b/toonz/sources/image/tiio.cpp
@@ -18,7 +18,7 @@
#include <math.h>
// Platform-specific includes
-#ifdef _WIN32
+#if defined(_WIN32)
#ifndef x64
@@ -37,11 +37,11 @@
#include "./3gp/tiio_3gp.h"
#include "./zcc/tiio_zcc.h"
-#elif MACOSX
+#elif defined(MACOSX)
#include "./mov/tiio_movM.h"
#include "./3gp/tiio_3gpM.h"
-#elif LINUX // No more supported by the way...
+#elif defined(LINUX) // No more supported by the way...
// #include "./mov/tiio_movL.h"
#include "./mov/tiio_mov_proxy.h"
#include "./3gp/tiio_3gp_proxy.h"
diff --git a/toonz/sources/image/tzp/tmacro.h b/toonz/sources/image/tzp/tmacro.h
index e4ac69cb8..683d44dd1 100644
--- a/toonz/sources/image/tzp/tmacro.h
+++ b/toonz/sources/image/tzp/tmacro.h
@@ -15,7 +15,7 @@
//#include "tmacroW.h"
#endif
-#if defined(DBMALLOC) && !defined(WIN32)
+#if defined(DBMALLOC) && !defined(_WIN32)
#include "dbmalloc.h"
#endif
@@ -126,7 +126,7 @@ static const char *const TALLOC_MSG_ =
static const char *const TREALLOC_MSG_ =
"Out of memory reallocating %d bytes (%s line %d)";
-#if defined(WIN32) && defined(_DEBUG)
+#if defined(_WIN32) && defined(_DEBUG)
#define WIN32_DBG_NBFL_ , _NORMAL_BLOCK, __FILE__, __LINE__
#define WIN32_DBG_NB_ , _NORMAL_BLOCK
#define TMALLOC_FUN_ _malloc_dbg
diff --git a/toonz/sources/include/tcg/hpp/triangulate.hpp b/toonz/sources/include/tcg/hpp/triangulate.hpp
index f71f066ce..e77882476 100644
--- a/toonz/sources/include/tcg/hpp/triangulate.hpp
+++ b/toonz/sources/include/tcg/hpp/triangulate.hpp
@@ -9,12 +9,12 @@
#include "../point_ops.h"
// OS-specific includes
-#ifdef WIN32
+#if defined(_WIN32)
#include "windows.h"
#include <GL/glu.h>
-#elif MACOSX
+#elif defined(MACOSX)
#include <GLUT/glut.h>
-#elif LINUX
+#elif defined(LINUX)
#include <GL/glut.h>
#include <cstring>
#endif
diff --git a/toonz/sources/include/tgl.h b/toonz/sources/include/tgl.h
index ad2a060a3..fa2cdcbb1 100644
--- a/toonz/sources/include/tgl.h
+++ b/toonz/sources/include/tgl.h
@@ -50,13 +50,13 @@ class TCubic;
#endif
#endif
-#ifdef TNZ_MACHINE_CHANNEL_ORDER_BGRM
+#if defined(TNZ_MACHINE_CHANNEL_ORDER_BGRM)
#define TGL_FMT GL_BGRA_EXT
-#elif TNZ_MACHINE_CHANNEL_ORDER_MBGR
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MBGR)
#define TGL_FMt GL_ABGR_EXT
-#elif TNZ_MACHINE_CHANNEL_ORDER_RGBM
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_RGBM)
#define TGL_FMT GL_RGBA
-#elif TNZ_MACHINE_CHANNEL_ORDER_MRGB
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MRGB)
#define TGL_FMT GL_BGRA
#else
@undefined chan order
diff --git a/toonz/sources/include/tmachine.h b/toonz/sources/include/tmachine.h
index 49542e52d..3e1266dd3 100644
--- a/toonz/sources/include/tmachine.h
+++ b/toonz/sources/include/tmachine.h
@@ -3,7 +3,7 @@
#ifndef T_MACHINE_INCLUDED
#define T_MACHINE_INCLUDED
-#if defined(WIN32) || defined(i386)
+#if defined(_WIN32) || defined(i386)
#define TNZ_LITTLE_ENDIAN 1
#define TNZ_MACHINE_CHANNEL_ORDER_BGRM 1
#elif defined(__sgi)
diff --git a/toonz/sources/include/toonz4.6/machine.h b/toonz/sources/include/toonz4.6/machine.h
index 44209dfaf..f2fe005a8 100644
--- a/toonz/sources/include/toonz4.6/machine.h
+++ b/toonz/sources/include/toonz4.6/machine.h
@@ -20,7 +20,7 @@
#endif
*/
-#if defined(WIN32) || defined(i386)
+#if defined(_WIN32) || defined(i386)
#define TNZ_LITTLE_ENDIAN 1
#define TNZ_MACHINE_CHANNEL_ORDER_BGRM 1
#elif defined(__sgi)
diff --git a/toonz/sources/include/toonz4.6/pixel.h b/toonz/sources/include/toonz4.6/pixel.h
index f218a7d32..e9792cc5d 100644
--- a/toonz/sources/include/toonz4.6/pixel.h
+++ b/toonz/sources/include/toonz4.6/pixel.h
@@ -37,7 +37,7 @@ typedef struct _SPIXEL { unsigned short b, g, r, m; } SPIXEL;
#define LPIXEL_B_SHIFT 24
#endif
-#elif TNZ_MACHINE_CHANNEL_ORDER_MBGR
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MBGR)
typedef struct { unsigned char m, b, g, r; } LPIXEL;
typedef struct { unsigned short m, b, g, r; } SPIXEL;
diff --git a/toonz/sources/include/toonz4.6/tmacro.h b/toonz/sources/include/toonz4.6/tmacro.h
index e4ac69cb8..683d44dd1 100644
--- a/toonz/sources/include/toonz4.6/tmacro.h
+++ b/toonz/sources/include/toonz4.6/tmacro.h
@@ -15,7 +15,7 @@
//#include "tmacroW.h"
#endif
-#if defined(DBMALLOC) && !defined(WIN32)
+#if defined(DBMALLOC) && !defined(_WIN32)
#include "dbmalloc.h"
#endif
@@ -126,7 +126,7 @@ static const char *const TALLOC_MSG_ =
static const char *const TREALLOC_MSG_ =
"Out of memory reallocating %d bytes (%s line %d)";
-#if defined(WIN32) && defined(_DEBUG)
+#if defined(_WIN32) && defined(_DEBUG)
#define WIN32_DBG_NBFL_ , _NORMAL_BLOCK, __FILE__, __LINE__
#define WIN32_DBG_NB_ , _NORMAL_BLOCK
#define TMALLOC_FUN_ _malloc_dbg
diff --git a/toonz/sources/include/tpixel.h b/toonz/sources/include/tpixel.h
index f2ee611bc..017c8b899 100644
--- a/toonz/sources/include/tpixel.h
+++ b/toonz/sources/include/tpixel.h
@@ -47,11 +47,11 @@ public:
static const int maxChannelValue;
typedef unsigned char Channel;
-#ifdef TNZ_MACHINE_CHANNEL_ORDER_BGRM
+#if defined(TNZ_MACHINE_CHANNEL_ORDER_BGRM)
Channel b, g, r, m;
-#elif TNZ_MACHINE_CHANNEL_ORDER_MBGR
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MBGR)
Channel m, b, g, r;
-#elif TNZ_MACHINE_CHANNEL_ORDER_RGBM
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_RGBM)
unsigned char r, g, b, m;
#elif TNZ_MACHINE_CHANNEL_ORDER_MRGB
Channel m, r, g, b;
@@ -164,9 +164,9 @@ public:
#ifdef TNZ_MACHINE_CHANNEL_ORDER_BGRM
Channel b, g, r, m;
-#elif TNZ_MACHINE_CHANNEL_ORDER_MRGB
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MRGB)
Channel m, r, g, b;
-#elif TNZ_MACHINE_CHANNEL_ORDER_RGBM
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_RGBM)
Channel r, g, b, m;
#else
undefined machine order !!!!
diff --git a/toonz/sources/stdfx/pins.cpp b/toonz/sources/stdfx/pins.cpp
index b72016ef0..aba1565ef 100644
--- a/toonz/sources/stdfx/pins.cpp
+++ b/toonz/sources/stdfx/pins.cpp
@@ -138,7 +138,7 @@ void subCompute(TRasterFxPort &m_input, TTile &tile, double frame,
TRectD clippingRect =
TRectD(tile.m_pos,
TDimensionD(tile.getRaster()->getLx(), tile.getRaster()->getLy()));
-#if CREATE_GL_CONTEXT_ONE_TIME
+#ifdef CREATE_GL_CONTEXT_ONE_TIME
int ret = wglMakeCurrent(m_offScreenGL.m_offDC, m_offScreenGL.m_hglRC);
assert(ret == TRUE);
#else
@@ -168,7 +168,7 @@ void subCompute(TRasterFxPort &m_input, TTile &tile, double frame,
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
checkErrorsByGL
-#if !CREATE_GL_CONTEXT_ONE_TIME
+#ifndef CREATE_GL_CONTEXT_ONE_TIME
TRaster32P rasaux;
if (!wireframe) {
TRaster32P texture(texWidth, texHeight);
diff --git a/toonz/sources/t32bitsrv/t323gpmsg.cpp b/toonz/sources/t32bitsrv/t323gpmsg.cpp
index aac164672..5892ab17a 100644
--- a/toonz/sources/t32bitsrv/t323gpmsg.cpp
+++ b/toonz/sources/t32bitsrv/t323gpmsg.cpp
@@ -13,9 +13,9 @@
#include "tproperty.h"
#include "tsound.h"
-#ifdef WIN32
+#if defined(_WIN32)
#include "../image/3gp/tiio_3gp.h"
-#elif MACOSX
+#elif defined(MACOSX)
#include "../image/3gp/tiio_3gpM.h"
#endif
diff --git a/toonz/sources/t32bitsrv/t32movmsg.cpp b/toonz/sources/t32bitsrv/t32movmsg.cpp
index fcc2581cc..6372526db 100644
--- a/toonz/sources/t32bitsrv/t32movmsg.cpp
+++ b/toonz/sources/t32bitsrv/t32movmsg.cpp
@@ -13,9 +13,9 @@
#include "tproperty.h"
#include "tsound.h"
-#ifdef WIN32
+#if defined(_WIN32)
#include "../image/mov/tiio_mov.h"
-#elif MACOSX
+#elif defined(MACOSX)
#include "../image/mov/tiio_movM.h"
#include <ApplicationServices/ApplicationServices.h>
#endif
diff --git a/toonz/sources/tnztools/stylepicker.cpp b/toonz/sources/tnztools/stylepicker.cpp
index ccf8c652a..a23639020 100644
--- a/toonz/sources/tnztools/stylepicker.cpp
+++ b/toonz/sources/tnztools/stylepicker.cpp
@@ -151,13 +151,13 @@ namespace {
TPixel32 getAverageColor(const TRect &rect) {
GLenum fmt =
-#ifdef TNZ_MACHINE_CHANNEL_ORDER_BGRM
+#if defined(TNZ_MACHINE_CHANNEL_ORDER_BGRM)
GL_RGBA;
-#elif TNZ_MACHINE_CHANNEL_ORDER_MBGR
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MBGR)
GL_ABGR_EXT;
-#elif TNZ_MACHINE_CHANNEL_ORDER_RGBM
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_RGBM)
GL_RGBA;
-#elif TNZ_MACHINE_CHANNEL_ORDER_MRGB
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MRGB)
GL_BGRA;
#else
// Error PLATFORM NOT SUPPORTED
@@ -181,13 +181,13 @@ TPixel32 getAverageColor(const TRect &rect) {
TPixel32 getAverageColor(TStroke *stroke) {
GLenum fmt =
-#ifdef TNZ_MACHINE_CHANNEL_ORDER_BGRM
+#if defined(TNZ_MACHINE_CHANNEL_ORDER_BGRM)
GL_RGBA;
-#elif TNZ_MACHINE_CHANNEL_ORDER_MBGR
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MBGR)
GL_ABGR_EXT;
-#elif TNZ_MACHINE_CHANNEL_ORDER_RGBM
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_RGBM)
GL_RGBA;
-#elif TNZ_MACHINE_CHANNEL_ORDER_MRGB
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MRGB)
GL_BGRA;
#else
// Error PLATFORM NOT SUPPORTED
diff --git a/toonz/sources/toonzfarm/tnzcore_stuff/tthread.cpp b/toonz/sources/toonzfarm/tnzcore_stuff/tthread.cpp
index f5d15b9e8..62118270f 100644
--- a/toonz/sources/toonzfarm/tnzcore_stuff/tthread.cpp
+++ b/toonz/sources/toonzfarm/tnzcore_stuff/tthread.cpp
@@ -40,13 +40,13 @@ public:
void join();
void cancel();
-#if defined(WIN32) && (_MSC_VER == 1200)
+#if defined(_WIN32) && (_MSC_VER == 1200)
#pragma warning(disable : 4290)
#endif
static void milestone() throw(TThread::Interrupt);
-#if defined(WIN32) && (_MSC_VER == 1200)
+#if defined(_WIN32) && (_MSC_VER == 1200)
#pragma warning(default : 4290)
#endif
@@ -240,7 +240,7 @@ void Thread::cancel() {
//------------------------------------------------------------------------------
// static member function
-#if defined(WIN32) && (_MSC_VER == 1200)
+#if defined(_WIN32) && (_MSC_VER == 1200)
#pragma warning(disable : 4290)
#endif
@@ -252,7 +252,7 @@ void Thread::milestone() throw(TThread::Interrupt) {
if (Thread::Imp::m_state[key.m_id]) throw TThread::Interrupt();
}
-#if defined(WIN32) && (_MSC_VER == 1200)
+#if defined(_WIN32) && (_MSC_VER == 1200)
#pragma warning(default : 4290)
#endif
@@ -278,13 +278,13 @@ void ThreadGroup::joinAll() { m_imp->m_boostThreadGroup.join_all(); }
//==============================================================================
-#if defined(WIN32) && (_MSC_VER == 1200)
+#if defined(_WIN32) && (_MSC_VER == 1200)
#pragma warning(disable : 4290)
#endif
void TThread::milestone() throw(TThread::Interrupt) { Thread::milestone(); }
-#if defined(WIN32) && (_MSC_VER == 1200)
+#if defined(_WIN32) && (_MSC_VER == 1200)
#pragma warning(default : 4290)
#endif
diff --git a/toonz/sources/toonzlib/sandor_fxs/STColSelPic.h b/toonz/sources/toonzlib/sandor_fxs/STColSelPic.h
index 7c1995935..45dfb742e 100644
--- a/toonz/sources/toonzlib/sandor_fxs/STColSelPic.h
+++ b/toonz/sources/toonzlib/sandor_fxs/STColSelPic.h
@@ -1,6 +1,6 @@
#pragma once
-#if _MSC_VER >= 1400
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
diff --git a/toonz/sources/toonzlib/texturemanager.cpp b/toonz/sources/toonzlib/texturemanager.cpp
index 6e4805738..ae29a52b5 100644
--- a/toonz/sources/toonzlib/texturemanager.cpp
+++ b/toonz/sources/toonzlib/texturemanager.cpp
@@ -92,13 +92,13 @@ TDimension TextureManager::getMaxSize(bool isRGBM) {
void TextureManager::getFmtAndType(bool isRGBM, GLenum &fmt, GLenum &type) {
if (isRGBM) {
fmt =
-#ifdef TNZ_MACHINE_CHANNEL_ORDER_BGRM
+#if defined(TNZ_MACHINE_CHANNEL_ORDER_BGRM)
GL_BGRA_EXT
-#elif TNZ_MACHINE_CHANNEL_ORDER_MBGR
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MBGR)
GL_ABGR_EXT
-#elif TNZ_MACHINE_CHANNEL_ORDER_RGBM
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_RGBM)
GL_RGBA
-#elif TNZ_MACHINE_CHANNEL_ORDER_MRGB
+#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MRGB)
GL_BGRA
#else
@undefined chan order