From e280ae86d61fb102dc8c6c24759299e529fd7075 Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: May 08 2017 12:13:29 +0000 Subject: Allow to cross compile for Windows with Linux/Mingw (part 1 of 3, preprocessor) (#1148) * split _WIN32 and _MSC_VER, lowercase includes --- diff --git a/toonz/sources/common/tapptools/tcolorutils.cpp b/toonz/sources/common/tapptools/tcolorutils.cpp index 2a620a1..1f238d2 100644 --- a/toonz/sources/common/tapptools/tcolorutils.cpp +++ b/toonz/sources/common/tapptools/tcolorutils.cpp @@ -11,7 +11,7 @@ typedef float KEYER_FLOAT; //------------------------------------------------------------------------------ -#ifdef _WIN32 +#ifdef _MSC_VER #define ISNAN _isnan #else #define ISNAN std::isnan diff --git a/toonz/sources/common/tapptools/ttimer.cpp b/toonz/sources/common/tapptools/ttimer.cpp index a955ee4..e56fcaf 100644 --- a/toonz/sources/common/tapptools/ttimer.cpp +++ b/toonz/sources/common/tapptools/ttimer.cpp @@ -122,7 +122,7 @@ void CALLBACK ElapsedTimeCB(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, if (imp->m_action) imp->m_action->sendCommand(imp->m_ticks); } }; -#elif LINUX +#elif defined(LINUX) #include #include diff --git a/toonz/sources/common/tcontenthistory.cpp b/toonz/sources/common/tcontenthistory.cpp index 0c339e7..ded790d 100644 --- a/toonz/sources/common/tcontenthistory.cpp +++ b/toonz/sources/common/tcontenthistory.cpp @@ -7,7 +7,7 @@ #include #include #ifdef _WIN32 -#include +#include #endif #include #include diff --git a/toonz/sources/common/tcore/tstring.cpp b/toonz/sources/common/tcore/tstring.cpp index ba39b7b..b8754c2 100644 --- a/toonz/sources/common/tcore/tstring.cpp +++ b/toonz/sources/common/tcore/tstring.cpp @@ -8,8 +8,11 @@ #include #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) +#endif + +#ifdef _WIN32 #include "windows.h" #endif diff --git a/toonz/sources/common/tiio/bmp/filebmp.c b/toonz/sources/common/tiio/bmp/filebmp.c index e9ea2ab..de23ae7 100644 --- a/toonz/sources/common/tiio/bmp/filebmp.c +++ b/toonz/sources/common/tiio/bmp/filebmp.c @@ -1,6 +1,6 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/common/tiio/movsettings.cpp b/toonz/sources/common/tiio/movsettings.cpp index c0107bf..e8cb9c2 100644 --- a/toonz/sources/common/tiio/movsettings.cpp +++ b/toonz/sources/common/tiio/movsettings.cpp @@ -14,7 +14,7 @@ //******************************************************************************* #ifdef _WIN32 -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/common/tiio/tiio.cpp b/toonz/sources/common/tiio/tiio.cpp index 9c7b4f4..4396682 100644 --- a/toonz/sources/common/tiio/tiio.cpp +++ b/toonz/sources/common/tiio/tiio.cpp @@ -13,8 +13,11 @@ #include #include -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4786) +#endif + +#ifdef _WIN32 #include #endif diff --git a/toonz/sources/common/tiio/tiio_bmp.cpp b/toonz/sources/common/tiio/tiio_bmp.cpp index 34d360b..a6b4f98 100644 --- a/toonz/sources/common/tiio/tiio_bmp.cpp +++ b/toonz/sources/common/tiio/tiio_bmp.cpp @@ -1,4 +1,4 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/common/tiio/tiio_jpg.cpp b/toonz/sources/common/tiio/tiio_jpg.cpp index c4991bf..108fa69 100644 --- a/toonz/sources/common/tiio/tiio_jpg.cpp +++ b/toonz/sources/common/tiio/tiio_jpg.cpp @@ -1,6 +1,6 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif //#include "texception.h" diff --git a/toonz/sources/common/tiio/tiio_jpg_util.cpp b/toonz/sources/common/tiio/tiio_jpg_util.cpp index 599f028..293fa37 100644 --- a/toonz/sources/common/tiio/tiio_jpg_util.cpp +++ b/toonz/sources/common/tiio/tiio_jpg_util.cpp @@ -1,6 +1,6 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/common/timage_io/timage_io.cpp b/toonz/sources/common/timage_io/timage_io.cpp index 6134817..05a7f44 100644 --- a/toonz/sources/common/timage_io/timage_io.cpp +++ b/toonz/sources/common/timage_io/timage_io.cpp @@ -15,9 +15,12 @@ // boost includes #include +#ifdef _MSC_VER +#pragma warning(disable : 4996) +#endif + // OS-specific includes #ifdef _WIN32 -#pragma warning(disable : 4996) #include #endif #ifdef LINUX diff --git a/toonz/sources/common/trop/tresample.cpp b/toonz/sources/common/trop/tresample.cpp index 6322886..76eac86 100644 --- a/toonz/sources/common/trop/tresample.cpp +++ b/toonz/sources/common/trop/tresample.cpp @@ -782,7 +782,7 @@ inline void calcValueNoCalc(UINT &calc_value){ { calc_value &= ~0x80U; } template -#ifdef _WIN32 +#ifdef _MSC_VER __forceinline #endif void @@ -1349,7 +1349,7 @@ void resample_main_rgbm(TRasterPT rout, const TRasterPT &rin, namespace { -__declspec(align(16)) class TPixelFloat { +DV_ALIGNED(16) class TPixelFloat { public: TPixelFloat() : b(0), g(0), r(0), m(0) {} @@ -4593,7 +4593,7 @@ void rop_resample_rgbm_2(TRasterPT rout, const TRasterCM32P &rin, } } -#ifdef _WIN32 +#ifdef _MSC_VER TRaster32P rout32 = rout; if ((TSystem::getCPUExtensions() & TSystem::CpuSupportsSse2) && rout32) resample_main_cm32_rgbm_SSE2( diff --git a/toonz/sources/common/trop/tropcm.cpp b/toonz/sources/common/trop/tropcm.cpp index e9374a7..08f8ddd 100644 --- a/toonz/sources/common/trop/tropcm.cpp +++ b/toonz/sources/common/trop/tropcm.cpp @@ -33,7 +33,7 @@ extern "C" { namespace { -__declspec(align(16)) class TPixelFloat { +DV_ALIGNED(16) class TPixelFloat { public: TPixelFloat() : b(0), g(0), r(0), m(0) {} diff --git a/toonz/sources/common/tsound/tsound_nt.cpp b/toonz/sources/common/tsound/tsound_nt.cpp index 48d74e0..b36552c 100644 --- a/toonz/sources/common/tsound/tsound_nt.cpp +++ b/toonz/sources/common/tsound/tsound_nt.cpp @@ -862,13 +862,13 @@ TSoundTrackFormat TSoundOutputDevice::getPreferredFormat( class WaveFormat final : public WAVEFORMATEX { public: WaveFormat(){}; - WaveFormat(unsigned char channelCount, unsigned TINT32 sampleRate, + WaveFormat(unsigned char channelCount, TUINT32 sampleRate, unsigned char bitPerSample); ~WaveFormat(){}; }; -WaveFormat::WaveFormat(unsigned char channelCount, unsigned TINT32 sampleRate, +WaveFormat::WaveFormat(unsigned char channelCount, TUINT32 sampleRate, unsigned char bitPerSample) { wFormatTag = WAVE_FORMAT_PCM; nChannels = channelCount; @@ -889,7 +889,7 @@ public: void open(const WaveFormat &wf); void close(); - void prepareHeader(char *sampleBuffer, unsigned TINT32 sampleBufferSize, + void prepareHeader(char *sampleBuffer, TUINT32 sampleBufferSize, WAVEHDR &whdr); void unprepareHeader(WAVEHDR &whdr); @@ -949,7 +949,7 @@ void WinSoundInputDevice::close() { //-------------------------------------------------------------------- void WinSoundInputDevice::prepareHeader(char *sampleBuffer, - unsigned TINT32 sampleBufferSize, + TUINT32 sampleBufferSize, WAVEHDR &whdr) { whdr.lpData = sampleBuffer; whdr.dwBufferLength = sampleBufferSize; // numero di byte diff --git a/toonz/sources/common/tsystem/cpuextensions.cpp b/toonz/sources/common/tsystem/cpuextensions.cpp index 33a47b4..bc71bc6 100644 --- a/toonz/sources/common/tsystem/cpuextensions.cpp +++ b/toonz/sources/common/tsystem/cpuextensions.cpp @@ -16,7 +16,7 @@ long TSystem::getCPUExtensions() { } #else -#ifndef _WIN32 +#ifndef _MSC_VER long TSystem::getCPUExtensions() { return TSystem::CPUExtensionsNone; } #else namespace { diff --git a/toonz/sources/common/tsystem/tfilepath_io.cpp b/toonz/sources/common/tsystem/tfilepath_io.cpp index f870fa8..3c9d0fd 100644 --- a/toonz/sources/common/tsystem/tfilepath_io.cpp +++ b/toonz/sources/common/tsystem/tfilepath_io.cpp @@ -11,7 +11,7 @@ #include using namespace std; -#ifdef _WIN32 +#ifdef _MSC_VER #include #include @@ -89,11 +89,7 @@ sperando che sia il nome del file => compila ma non funziona */ {} -Tifstream::~Tifstream() { -#ifdef _WIN32 - fclose(m_file); -#endif -} +Tifstream::~Tifstream() {} Tofstream::Tofstream(const TFilePath &fp, bool append_existing) : ofstream( diff --git a/toonz/sources/common/tsystem/tsystem.cpp b/toonz/sources/common/tsystem/tsystem.cpp index 9713d1e..8e1a141 100644 --- a/toonz/sources/common/tsystem/tsystem.cpp +++ b/toonz/sources/common/tsystem/tsystem.cpp @@ -23,15 +23,13 @@ using namespace std; #include #include +#include +#include + #ifdef _WIN32 -#include -#include #include #include #include -#else -#include -#include #endif #include diff --git a/toonz/sources/common/tsystem/tsystempd.cpp b/toonz/sources/common/tsystem/tsystempd.cpp index 4edf000..ef3f3bd 100644 --- a/toonz/sources/common/tsystem/tsystempd.cpp +++ b/toonz/sources/common/tsystem/tsystempd.cpp @@ -21,8 +21,11 @@ #undef PLATFORM -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) +#endif + +#ifdef _WIN32 #define PLATFORM WIN32 #include #include diff --git a/toonz/sources/common/tvectorimage/tl2lautocloser.h b/toonz/sources/common/tvectorimage/tl2lautocloser.h index c4c482b..d4a957b 100644 --- a/toonz/sources/common/tvectorimage/tl2lautocloser.h +++ b/toonz/sources/common/tvectorimage/tl2lautocloser.h @@ -17,7 +17,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/common/tvectorimage/tsegmentadjuster.h b/toonz/sources/common/tvectorimage/tsegmentadjuster.h index 1aceb64..621999b 100644 --- a/toonz/sources/common/tvectorimage/tsegmentadjuster.h +++ b/toonz/sources/common/tvectorimage/tsegmentadjuster.h @@ -16,7 +16,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/common/tvectorimage/tsweepboundary.cpp b/toonz/sources/common/tvectorimage/tsweepboundary.cpp index 8bd3bdb..3e4e3d9 100644 --- a/toonz/sources/common/tvectorimage/tsweepboundary.cpp +++ b/toonz/sources/common/tvectorimage/tsweepboundary.cpp @@ -14,7 +14,7 @@ #ifdef _WIN32 #include -#include +#include #endif #include "tsweepboundary.h" diff --git a/toonz/sources/common/tvrender/tfont_nt.cpp b/toonz/sources/common/tvrender/tfont_nt.cpp index 6098a49..f656778 100644 --- a/toonz/sources/common/tvrender/tfont_nt.cpp +++ b/toonz/sources/common/tvrender/tfont_nt.cpp @@ -427,7 +427,7 @@ struct TFontManager::Impl { // has the @-version, the library use it. bool m_vertical; - TFontManager::Impl() : m_loaded(false), m_currentFont(0), m_vertical(false) {} + Impl() : m_loaded(false), m_currentFont(0), m_vertical(false) {} }; //--------------------------------------------------------- diff --git a/toonz/sources/common/twain/ttwain_error.c b/toonz/sources/common/twain/ttwain_error.c index 80aab64..359b83b 100644 --- a/toonz/sources/common/twain/ttwain_error.c +++ b/toonz/sources/common/twain/ttwain_error.c @@ -1,6 +1,6 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/common/twain/ttwain_state.c b/toonz/sources/common/twain/ttwain_state.c index 6e5ed8e..a9c7984 100644 --- a/toonz/sources/common/twain/ttwain_state.c +++ b/toonz/sources/common/twain/ttwain_state.c @@ -1,6 +1,6 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/common/twain/ttwain_util.c b/toonz/sources/common/twain/ttwain_util.c index 6c8ea2e..4c16feb 100644 --- a/toonz/sources/common/twain/ttwain_util.c +++ b/toonz/sources/common/twain/ttwain_util.c @@ -1,6 +1,6 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/image/avi/tiio_avi.cpp b/toonz/sources/image/avi/tiio_avi.cpp index a72bfac..a43f423 100644 --- a/toonz/sources/image/avi/tiio_avi.cpp +++ b/toonz/sources/image/avi/tiio_avi.cpp @@ -1,6 +1,6 @@ -#if _MSC_VER >= 1400 +#if defined(_MSC_VER) && (_MSC_VER >= 1400) #define _CRT_SECURE_NO_DEPRECATE 1 #endif @@ -19,6 +19,8 @@ #include "timageinfo.h" #include "trasterimage.h" +#include + //------------------------------------------------------------------------------ namespace { @@ -1058,8 +1060,11 @@ LRESULT safe_ICClose(HIC hic) { return ICERR_OK; } -using hic_t = - std::unique_ptr, decltype(&safe_ICClose)>; +#ifdef _MSC_VER + typedef std::unique_ptr, decltype(&safe_ICClose)> hic_t; +#else + typedef std::unique_ptr::type, decltype(&safe_ICClose)> hic_t; +#endif hic_t safe_ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode) { #ifdef _MSC_VER diff --git a/toonz/sources/image/pli/pli_io.cpp b/toonz/sources/image/pli/pli_io.cpp index d712b4e..371aa8b 100644 --- a/toonz/sources/image/pli/pli_io.cpp +++ b/toonz/sources/image/pli/pli_io.cpp @@ -432,7 +432,7 @@ void ParsedPli::setMaxThickness(double maxThickness) { }; /* indirect inclusion of causes 'abs' to return double on Linux */ -#ifdef LINUX +#if defined(LINUX) || (defined(_WIN32) && defined(__GNUC__)) template T abs_workaround(T a) { return (a > 0) ? a : -a; @@ -470,7 +470,7 @@ static inline short complement2(USHORT val) { return (val & 0x8000) ? -(val & 0x7fff) : (val & 0x7fff); } -#ifdef LINUX +#if defined(LINUX) || (defined(_WIN32) && defined(__GNUC__)) #undef abs #endif diff --git a/toonz/sources/image/pli/pli_io.h b/toonz/sources/image/pli/pli_io.h index ecb2134..d57702b 100644 --- a/toonz/sources/image/pli/pli_io.h +++ b/toonz/sources/image/pli/pli_io.h @@ -3,7 +3,7 @@ #ifndef _PLI_IO_H #define _PLI_IO_H -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4661) #pragma warning(disable : 4018) #endif diff --git a/toonz/sources/image/pli/tags.cpp b/toonz/sources/image/pli/tags.cpp index 944f2ee..58fa3c6 100644 --- a/toonz/sources/image/pli/tags.cpp +++ b/toonz/sources/image/pli/tags.cpp @@ -1,6 +1,6 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4661) #endif diff --git a/toonz/sources/image/tif/tiio_tif.cpp b/toonz/sources/image/tif/tiio_tif.cpp index 3aff309..2f7086b 100644 --- a/toonz/sources/image/tif/tiio_tif.cpp +++ b/toonz/sources/image/tif/tiio_tif.cpp @@ -25,8 +25,11 @@ extern "C" { #include "tiio_tif.h" -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) +#endif + +#ifdef _WIN32 #include "windows.h" #endif diff --git a/toonz/sources/image/tzp/avl.c b/toonz/sources/image/tzp/avl.c index 1a7e1e7..ba49eb3 100644 --- a/toonz/sources/image/tzp/avl.c +++ b/toonz/sources/image/tzp/avl.c @@ -8,7 +8,7 @@ | | *----------------------------------------------------------------------------*/ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4113) #pragma warning(disable : 4996) diff --git a/toonz/sources/image/tzp/tiio_plt.cpp b/toonz/sources/image/tzp/tiio_plt.cpp index db0cd36..a92c16c 100644 --- a/toonz/sources/image/tzp/tiio_plt.cpp +++ b/toonz/sources/image/tzp/tiio_plt.cpp @@ -7,8 +7,11 @@ #include "tiffio.h" -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) +#endif + +#ifdef _WIN32 #include "windows.h" #endif diff --git a/toonz/sources/image/tzp/tiio_tzp.cpp b/toonz/sources/image/tzp/tiio_tzp.cpp index 8e638b6..6bbd524 100644 --- a/toonz/sources/image/tzp/tiio_tzp.cpp +++ b/toonz/sources/image/tzp/tiio_tzp.cpp @@ -11,8 +11,11 @@ //#include "tspecialstyleid.h" #include -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) +#endif + +#ifdef _WIN32 #include "windows.h" #endif diff --git a/toonz/sources/include/avicodecrestrictions.h b/toonz/sources/include/avicodecrestrictions.h index ad95d40..7212ab5 100644 --- a/toonz/sources/include/avicodecrestrictions.h +++ b/toonz/sources/include/avicodecrestrictions.h @@ -36,4 +36,4 @@ bool DVAPI canBeConfigured(const std::wstring &codecName); void DVAPI openConfiguration(const std::wstring &codecName, void *winId); } -#endif; // AVI_CODEC_RESTRICTIONS +#endif // AVI_CODEC_RESTRICTIONS diff --git a/toonz/sources/include/ext/Potential.h b/toonz/sources/include/ext/Potential.h index 19a17c8..bb18916 100644 --- a/toonz/sources/include/ext/Potential.h +++ b/toonz/sources/include/ext/Potential.h @@ -25,7 +25,7 @@ class TStroke; -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) // to avoid annoying warning #pragma warning(push) #pragma warning(disable : 4290) @@ -86,7 +86,7 @@ public: }; } -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) #pragma warning(pop) #endif diff --git a/toonz/sources/include/ext/StrokeDeformation.h b/toonz/sources/include/ext/StrokeDeformation.h index c28d177..7c87055 100644 --- a/toonz/sources/include/ext/StrokeDeformation.h +++ b/toonz/sources/include/ext/StrokeDeformation.h @@ -30,7 +30,7 @@ class TStroke; -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) // to avoid annoying warning #pragma warning(push) #pragma warning(disable : 4251) @@ -170,7 +170,7 @@ public: }; } -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) #pragma warning(pop) #endif diff --git a/toonz/sources/include/ext/StrokeDeformationImpl.h b/toonz/sources/include/ext/StrokeDeformationImpl.h index fce172d..052dcb8 100644 --- a/toonz/sources/include/ext/StrokeDeformationImpl.h +++ b/toonz/sources/include/ext/StrokeDeformationImpl.h @@ -21,7 +21,7 @@ #include "ExtUtil.h" -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) // to avoid annoying warning #pragma warning(push) #pragma warning(disable : 4251) @@ -139,7 +139,7 @@ public: }; } -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) #pragma warning(pop) #endif diff --git a/toonz/sources/include/ext/StrokeParametricDeformer.h b/toonz/sources/include/ext/StrokeParametricDeformer.h index dbfc757..824854e 100644 --- a/toonz/sources/include/ext/StrokeParametricDeformer.h +++ b/toonz/sources/include/ext/StrokeParametricDeformer.h @@ -20,7 +20,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) // to avoid annoying warning #pragma warning(push) #pragma warning(disable : 4290) @@ -130,7 +130,7 @@ private: }; } -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) #pragma warning(pop) #endif diff --git a/toonz/sources/include/ext/Types.h b/toonz/sources/include/ext/Types.h index 088a601..584be4b 100644 --- a/toonz/sources/include/ext/Types.h +++ b/toonz/sources/include/ext/Types.h @@ -24,7 +24,7 @@ #include #include -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) // to avoid annoying warning #pragma warning(push) #pragma warning(disable : 4290) @@ -113,7 +113,7 @@ public: }; } -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) #pragma warning(pop) #endif diff --git a/toonz/sources/include/ext/plasticskeleton.h b/toonz/sources/include/ext/plasticskeleton.h index 911f23c..a7a339f 100644 --- a/toonz/sources/include/ext/plasticskeleton.h +++ b/toonz/sources/include/ext/plasticskeleton.h @@ -169,8 +169,10 @@ private: //=============================================================================== #ifdef _WIN32 +#ifndef TFX_EXPORTS template class DVAPI TSmartPointerT; #endif +#endif typedef TSmartPointerT PlasticSkeletonP; diff --git a/toonz/sources/include/ext/plasticskeletondeformation.h b/toonz/sources/include/ext/plasticskeletondeformation.h index fbb62ff..215e5cb 100644 --- a/toonz/sources/include/ext/plasticskeletondeformation.h +++ b/toonz/sources/include/ext/plasticskeletondeformation.h @@ -298,8 +298,10 @@ typedef PlasticSkeletonDeformation SkD; //=============================================================================== #ifdef _WIN32 +#ifndef TFX_EXPORTS template class DVAPI TSmartPointerT; #endif +#endif typedef TSmartPointerT PlasticSkeletonDeformationP; typedef PlasticSkeletonDeformationP SkDP; diff --git a/toonz/sources/include/tcommon.h b/toonz/sources/include/tcommon.h index c1b506e..5d27757 100644 --- a/toonz/sources/include/tcommon.h +++ b/toonz/sources/include/tcommon.h @@ -3,7 +3,7 @@ #ifndef T_COMMON_INCLUDED #define T_COMMON_INCLUDED -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4786) #pragma warning(disable : 4251) #pragma warning(disable : 4146) @@ -154,7 +154,7 @@ const unsigned int c_maxuint = (unsigned int)(~0U); #define DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #define DV_ALIGNED(val) __declspec(align(val)) #else #define DV_ALIGNED(val) __attribute__((aligned(val))) diff --git a/toonz/sources/include/tdata.h b/toonz/sources/include/tdata.h index 8ffb4f5..dd64885 100644 --- a/toonz/sources/include/tdata.h +++ b/toonz/sources/include/tdata.h @@ -52,7 +52,7 @@ public: //------------------------------------------------------------------- -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4251) #endif @@ -69,7 +69,7 @@ public: TFilePath getFilePath(int i) const; }; -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/toonz/sources/include/tlevel_io.h b/toonz/sources/include/tlevel_io.h index 63e274e..cfd76e1 100644 --- a/toonz/sources/include/tlevel_io.h +++ b/toonz/sources/include/tlevel_io.h @@ -7,7 +7,7 @@ #include "timage_io.h" #include "tproperty.h" -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4290) #pragma warning(disable : 4251) diff --git a/toonz/sources/include/tmacrofx.h b/toonz/sources/include/tmacrofx.h index c2a12e8..334459b 100644 --- a/toonz/sources/include/tmacrofx.h +++ b/toonz/sources/include/tmacrofx.h @@ -15,7 +15,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/tnotanimatableparam.h b/toonz/sources/include/tnotanimatableparam.h index 5094363..b28497d 100644 --- a/toonz/sources/include/tnotanimatableparam.h +++ b/toonz/sources/include/tnotanimatableparam.h @@ -28,7 +28,7 @@ // TNotAnimatableParamChange //----------------------------------------------------------------------------- -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4251) #endif @@ -444,7 +444,7 @@ TUndo *TNotAnimatableParamChange::createUndo() const { //----------------------------------------------------------------------------- -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/toonz/sources/include/tnztypes.h b/toonz/sources/include/tnztypes.h index 66a9fc2..58000dd 100644 --- a/toonz/sources/include/tnztypes.h +++ b/toonz/sources/include/tnztypes.h @@ -3,7 +3,7 @@ #ifndef TNZTYPES_H #define TNZTYPES_H -#ifdef _WIN32 +#ifdef _MSC_VER #define TINT32 __int32 typedef unsigned __int32 TUINT32; typedef __int64 TINT64; @@ -34,9 +34,9 @@ typedef unsigned __int32_t TUINT32; typedef __int64_t TINT64; typedef unsigned __int64_t TUINT64; -#elif defined(LINUX) +#elif defined(LINUX) || defined(_WIN32) #include -#define TINT32 __int32_t +typedef int32_t TINT32; typedef uint32_t TUINT32; typedef int64_t TINT64; typedef uint64_t TUINT64; diff --git a/toonz/sources/include/toonz4.6/pixel.h b/toonz/sources/include/toonz4.6/pixel.h index e9792cc..645d806 100644 --- a/toonz/sources/include/toonz4.6/pixel.h +++ b/toonz/sources/include/toonz4.6/pixel.h @@ -66,7 +66,7 @@ typedef struct { unsigned short m, b, g, r; } SPIXEL; #define LPIXEL_B_SHIFT 16 #endif -#elif TNZ_MACHINE_CHANNEL_ORDER_RGBM +#elif defined(TNZ_MACHINE_CHANNEL_ORDER_RGBM) typedef struct _LPIXEL { unsigned char r, g, b, m; } LPIXEL; typedef struct _SPIXEL { unsigned short r, g, b, m; } SPIXEL; @@ -94,7 +94,7 @@ typedef struct _SPIXEL { unsigned short r, g, b, m; } SPIXEL; #define LPIXEL_G_SHIFT 16 #define LPIXEL_B_SHIFT 24 #endif -#elif TNZ_MACHINE_CHANNEL_ORDER_MRGB +#elif defined(TNZ_MACHINE_CHANNEL_ORDER_MRGB) typedef struct _LPIXEL { unsigned char m, r, g, b; } LPIXEL; typedef struct _SPIXEL { unsigned short m, r, g, b; } SPIXEL; diff --git a/toonz/sources/include/toonz4.6/toonzproc.h b/toonz/sources/include/toonz4.6/toonzproc.h index e9a883a..4b6a86c 100644 --- a/toonz/sources/include/toonz4.6/toonzproc.h +++ b/toonz/sources/include/toonz4.6/toonzproc.h @@ -22,7 +22,7 @@ typedef struct T_CHAN_REC *T_CHAN; #define TPROC_OPEN_READ_BINARY 0x4 #ifdef WIN32 -#include "Windows.h" +#include "windows.h" #define TPROC_LIB HMODULE #define TPROC_FUNC FARPROC #else diff --git a/toonz/sources/include/toonzqt/camerasettingswidget.h b/toonz/sources/include/toonzqt/camerasettingswidget.h index 1b2a995..c8dbac7 100644 --- a/toonz/sources/include/toonzqt/camerasettingswidget.h +++ b/toonz/sources/include/toonzqt/camerasettingswidget.h @@ -3,7 +3,7 @@ #ifndef CAMERASETTINGSWIDGET_H #define CAMERASETTINGSWIDGET_H -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/toonzqt/cleanupcamerasettingswidget.h b/toonz/sources/include/toonzqt/cleanupcamerasettingswidget.h index 90c5f29..4bdc934 100644 --- a/toonz/sources/include/toonzqt/cleanupcamerasettingswidget.h +++ b/toonz/sources/include/toonzqt/cleanupcamerasettingswidget.h @@ -3,7 +3,7 @@ #ifndef CLEANUPCAMERASETTINGSWIDGET_H #define CLEANUPCAMERASETTINGSWIDGET_H -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/toonzqt/colorfield.h b/toonz/sources/include/toonzqt/colorfield.h index 8bde1a1..19b9c02 100644 --- a/toonz/sources/include/toonzqt/colorfield.h +++ b/toonz/sources/include/toonzqt/colorfield.h @@ -3,7 +3,7 @@ #ifndef COLORFIELD_H #define COLORFIELD_H -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/toonzqt/combohistogram.h b/toonz/sources/include/toonzqt/combohistogram.h index ada157a..e9c60ab 100644 --- a/toonz/sources/include/toonzqt/combohistogram.h +++ b/toonz/sources/include/toonzqt/combohistogram.h @@ -21,7 +21,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/toonzqt/dvdialog.h b/toonz/sources/include/toonzqt/dvdialog.h index a177970..342296d 100644 --- a/toonz/sources/include/toonzqt/dvdialog.h +++ b/toonz/sources/include/toonzqt/dvdialog.h @@ -34,7 +34,7 @@ class QLabel; class TXsheetHandle; class TPalette; -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/toonzqt/dvtextedit.h b/toonz/sources/include/toonzqt/dvtextedit.h index 5b801d7..33edf49 100644 --- a/toonz/sources/include/toonzqt/dvtextedit.h +++ b/toonz/sources/include/toonzqt/dvtextedit.h @@ -3,7 +3,7 @@ #ifndef DVTEXTEDIT_H #define DVTEXTEDIT_H -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/toonzqt/fxsettings.h b/toonz/sources/include/toonzqt/fxsettings.h index 6f357c9..64386c0 100644 --- a/toonz/sources/include/toonzqt/fxsettings.h +++ b/toonz/sources/include/toonzqt/fxsettings.h @@ -3,7 +3,7 @@ #ifndef FXSETTINGS_H #define FXSETTINGS_H -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/toonzqt/histogram.h b/toonz/sources/include/toonzqt/histogram.h index 1f464b6..307c051 100644 --- a/toonz/sources/include/toonzqt/histogram.h +++ b/toonz/sources/include/toonzqt/histogram.h @@ -21,7 +21,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/toonzqt/paramfield.h b/toonz/sources/include/toonzqt/paramfield.h index 126cd18..c185924 100644 --- a/toonz/sources/include/toonzqt/paramfield.h +++ b/toonz/sources/include/toonzqt/paramfield.h @@ -3,7 +3,7 @@ #ifndef PARAMFIELD_H #define PARAMFIELD_H -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/toonzqt/swatchviewer.h b/toonz/sources/include/toonzqt/swatchviewer.h index 501ccca..d772d36 100644 --- a/toonz/sources/include/toonzqt/swatchviewer.h +++ b/toonz/sources/include/toonzqt/swatchviewer.h @@ -3,7 +3,7 @@ #ifndef SWATCHVIEWER_H #define SWATCHVIEWER_H -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/toonzqt/tabbar.h b/toonz/sources/include/toonzqt/tabbar.h index 3ff5245..09760b2 100644 --- a/toonz/sources/include/toonzqt/tabbar.h +++ b/toonz/sources/include/toonzqt/tabbar.h @@ -16,7 +16,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/tpalette.h b/toonz/sources/include/tpalette.h index e883e6d..63c41e7 100644 --- a/toonz/sources/include/tpalette.h +++ b/toonz/sources/include/tpalette.h @@ -23,7 +23,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4251) #endif @@ -445,7 +445,7 @@ template class DVAPI TSmartPointerT; //------------------------------------------------------------------- -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/toonz/sources/include/tparamset.h b/toonz/sources/include/tparamset.h index d4c213e..8f39985 100644 --- a/toonz/sources/include/tparamset.h +++ b/toonz/sources/include/tparamset.h @@ -42,7 +42,7 @@ public: //------------------------------------------------------------------------------ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4251) #endif @@ -104,7 +104,7 @@ private: TParamSetImp *m_imp = nullptr; }; -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/toonz/sources/include/tproperty.h b/toonz/sources/include/tproperty.h index 202eced..ae6ab1c 100644 --- a/toonz/sources/include/tproperty.h +++ b/toonz/sources/include/tproperty.h @@ -18,7 +18,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4251) #endif @@ -429,7 +429,7 @@ private: //--------------------------------------------------------- -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/toonz/sources/include/trasterfx.h b/toonz/sources/include/trasterfx.h index 43d126d..fa588e4 100644 --- a/toonz/sources/include/trasterfx.h +++ b/toonz/sources/include/trasterfx.h @@ -20,7 +20,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif @@ -432,12 +432,12 @@ void DVAPI removeRenderCache(const std::string &alias); //------------------------------------------------------------------- -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4251) #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/toonz/sources/include/tsmartpointer.h b/toonz/sources/include/tsmartpointer.h index 7f14e23..750cc10 100644 --- a/toonz/sources/include/tsmartpointer.h +++ b/toonz/sources/include/tsmartpointer.h @@ -101,7 +101,7 @@ public: \ //========================================================= template -class DVAPI TSmartPointerT { +class TSmartPointerT { protected: T *m_pointer; @@ -166,7 +166,7 @@ public: //========================================================= template -class DVAPI TDerivedSmartPointerT : public TSmartPointerT { +class TDerivedSmartPointerT : public TSmartPointerT { public: typedef TDerivedSmartPointerT DerivedSmartPointer; diff --git a/toonz/sources/include/tsound_t.h b/toonz/sources/include/tsound_t.h index 1735c98..466ffb2 100644 --- a/toonz/sources/include/tsound_t.h +++ b/toonz/sources/include/tsound_t.h @@ -137,14 +137,7 @@ from which it's created.It hasn't reference to the object. //! Applies a trasformation (echo, reverb, ect) to the object and returns the //! transformed soundtrack -#if defined(MACOSX) || defined(LINUX) TSoundTrackP apply(TSoundTransform *transform) override; -#else // _WIN32 - TSoundTrackP apply(TSoundTransform *transform) override { - assert(transform); - return transform->compute(*this); - } -#endif //---------------------------------------------------------------------------- //! Returns the pressure of the sample s about the channel chan @@ -389,11 +382,13 @@ public: }; //============================================================================== -#if defined(MACOSX) || defined(LINUX) + +#if !defined(_MSC_VER) || defined(TSOUND_EXPORTS) template -DVAPI TSoundTrackP TSoundTrackT::apply(TSoundTransform *transform) { +TSoundTrackP TSoundTrackT::apply(TSoundTransform *transform) { assert(transform); return transform->compute(*this); } #endif + #endif diff --git a/toonz/sources/include/tspectrum.h b/toonz/sources/include/tspectrum.h index c41c445..8c57ef0 100644 --- a/toonz/sources/include/tspectrum.h +++ b/toonz/sources/include/tspectrum.h @@ -16,7 +16,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif @@ -182,7 +182,7 @@ template class DVAPI TSpectrumT; typedef TSpectrumT TSpectrum; typedef TSpectrumT TSpectrum64; -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(default : 4251) #endif diff --git a/toonz/sources/include/tstrokeoutline.h b/toonz/sources/include/tstrokeoutline.h index 07bd70f..9be80f9 100644 --- a/toonz/sources/include/tstrokeoutline.h +++ b/toonz/sources/include/tstrokeoutline.h @@ -18,7 +18,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/ttokenizer.h b/toonz/sources/include/ttokenizer.h index ba6388a..745b4f0 100644 --- a/toonz/sources/include/ttokenizer.h +++ b/toonz/sources/include/ttokenizer.h @@ -5,7 +5,7 @@ #include "tcommon.h" -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4251) #endif @@ -90,7 +90,7 @@ public: } // namespace TSyntax -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/toonz/sources/include/ttonecurveparam.h b/toonz/sources/include/ttonecurveparam.h index 94063be..fe2013a 100644 --- a/toonz/sources/include/ttonecurveparam.h +++ b/toonz/sources/include/ttonecurveparam.h @@ -10,7 +10,7 @@ #include -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/include/tunit.h b/toonz/sources/include/tunit.h index 944c689..0843091 100644 --- a/toonz/sources/include/tunit.h +++ b/toonz/sources/include/tunit.h @@ -15,7 +15,7 @@ #define DVVAR DV_IMPORT_VAR #endif -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4251) #endif @@ -192,7 +192,7 @@ DVAPI void setCurrentDpiGetter(CurrentDpiGetter f); //--------------------------- -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/toonz/sources/stdfx/artcontourfx.cpp b/toonz/sources/stdfx/artcontourfx.cpp index d19f2f5..5d97c73 100644 --- a/toonz/sources/stdfx/artcontourfx.cpp +++ b/toonz/sources/stdfx/artcontourfx.cpp @@ -1,4 +1,4 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/stdfx/blendtzfx.cpp b/toonz/sources/stdfx/blendtzfx.cpp index 7160759..75f9379 100644 --- a/toonz/sources/stdfx/blendtzfx.cpp +++ b/toonz/sources/stdfx/blendtzfx.cpp @@ -1,4 +1,4 @@ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/stdfx/calligraphicfx.cpp b/toonz/sources/stdfx/calligraphicfx.cpp index f1e4113..d4e1e3e 100644 --- a/toonz/sources/stdfx/calligraphicfx.cpp +++ b/toonz/sources/stdfx/calligraphicfx.cpp @@ -2,8 +2,11 @@ #include "stdfx.h" -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) +#endif + +#ifdef _WIN32 #include "windows.h" #endif #include diff --git a/toonz/sources/stdfx/igs_line_blur.cpp b/toonz/sources/stdfx/igs_line_blur.cpp index 9be8816..0a9fac8 100644 --- a/toonz/sources/stdfx/igs_line_blur.cpp +++ b/toonz/sources/stdfx/igs_line_blur.cpp @@ -15,7 +15,7 @@ namespace { #define _pri_h_ /* Windowsではstdint.hが見付からない */ -#if defined _WIN32 +#if defined _MSC_VER typedef int int32_t; #else #include /* for int32_t */ @@ -211,7 +211,7 @@ private: #include /* Windowsではstdint.hが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER typedef int int32_t; typedef unsigned short uint16_t; #else @@ -316,7 +316,7 @@ list_node *list_root::pop(list_node *clp_old) { #include /* Windowsではstdint.hが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER typedef int int32_t; #else #include /* for int32_t */ @@ -631,7 +631,7 @@ int brush_curve_blur::save(double d_xp, double d_yp, const char *cp_fname) { #include /* Windowsではstdint.hが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER typedef int int32_t; typedef unsigned short uint16_t; #else @@ -1040,7 +1040,7 @@ private: #include "igs_line_blur.h" // "pri.h" "calculator_geometry.h" /* WindowsではM_PIが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER #define M_PI 3.14159265358979323846 #endif @@ -1138,7 +1138,7 @@ void calculator_geometry::get_dd_rotate_by_pos(double d_xp1, double d_yp1, #include /* Windowsではstdint.hが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER typedef int int32_t; typedef unsigned short uint16_t; #else @@ -1822,7 +1822,7 @@ void pixel_line_node::int2double_body(void) { #include "igs_line_blur.h" // "pri.h" "pixel_line_node.h" /* WindowsではM_PIが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER #define M_PI 3.14159265358979323846 #endif @@ -2473,7 +2473,7 @@ private: #include "igs_line_blur.h" // "pri.h" "pixel_line_root.h" "pixel_select_same_way.h" /* WindowsではM_PIが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER #define M_PI 3.14159265358979323846 #endif @@ -4012,7 +4012,7 @@ private: #include /* M_PI */ /* WindowsではM_PIが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER #define M_PI 3.14159265358979323846 #endif @@ -4428,7 +4428,7 @@ int pixel_select_curve_blur_root::save(double d_xp, double d_yp, #include /* Windowsではstdint.hが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER typedef int int32_t; typedef unsigned short uint16_t; #else diff --git a/toonz/sources/stdfx/igs_resource_msg_from_err_win.cpp b/toonz/sources/stdfx/igs_resource_msg_from_err_win.cpp index b3bd5f7..2869abb 100644 --- a/toonz/sources/stdfx/igs_resource_msg_from_err_win.cpp +++ b/toonz/sources/stdfx/igs_resource_msg_from_err_win.cpp @@ -1,4 +1,6 @@ #include "igs_resource_msg_from_err.h" +#include +#include /*------ localeを日本に設定し日本語を扱うことを指示 (しないと日本語文字部分のみ処理しない) diff --git a/toonz/sources/stdfx/igs_resource_msg_from_err_win.h b/toonz/sources/stdfx/igs_resource_msg_from_err_win.h index 331ba4a..fc18994 100644 --- a/toonz/sources/stdfx/igs_resource_msg_from_err_win.h +++ b/toonz/sources/stdfx/igs_resource_msg_from_err_win.h @@ -60,15 +60,30 @@ const std::string msg_from_err_(/* 直によんではいけない */ } } /*--- ::GetLastError()値からエラーメッセージを得る ---*/ -#define igs_resource_msg_from_err(tit, error_message_id) \ - igs::resource::msg_from_err_( \ - tit, error_message_id, TEXT(__FILE__), TEXT(igs_tostr(__LINE__)), \ - TEXT(__FUNCSIG__), TEXT(igs_tostr_(_MSC_VER)), \ - TEXT(igs_tostr(_MSC_FULL_VER)), TEXT(__DATE__), TEXT(__TIME__)) -/*--- エラーメッセージを得る ---*/ -#define igs_resource_msg_from_er(tit) \ - igs::resource::msg_from_err_( \ - tit, NO_ERROR, TEXT(__FILE__), TEXT(igs_tostr(__LINE__)), \ - TEXT(__FUNCSIG__), TEXT(igs_tostr_(_MSC_VER)), \ - TEXT(igs_tostr(_MSC_FULL_VER)), TEXT(__DATE__), TEXT(__TIME__)) +#ifdef _MSC_VER + #define igs_resource_msg_from_err(tit, error_message_id) \ + igs::resource::msg_from_err_( \ + tit, error_message_id, TEXT(__FILE__), TEXT(igs_tostr(__LINE__)), \ + TEXT(__FUNCSIG__), TEXT(igs_tostr_(_MSC_VER)), \ + TEXT(igs_tostr(_MSC_FULL_VER)), TEXT(__DATE__), TEXT(__TIME__)) + /*--- エラーメッセージを得る ---*/ + #define igs_resource_msg_from_er(tit) \ + igs::resource::msg_from_err_( \ + tit, NO_ERROR, TEXT(__FILE__), TEXT(igs_tostr(__LINE__)), \ + TEXT(__FUNCSIG__), TEXT(igs_tostr_(_MSC_VER)), \ + TEXT(igs_tostr(_MSC_FULL_VER)), TEXT(__DATE__), TEXT(__TIME__)) +#else + #define igs_resource_msg_from_err(tit, error_message_id) \ + igs::resource::msg_from_err_( \ + tit, error_message_id, TEXT(__FILE__), TEXT(igs_tostr(__LINE__)), \ + TEXT(__PRETTY_FUNCTION__), TEXT(__VERSION__), \ + TEXT(__VERSION__), TEXT(__DATE__), TEXT(__TIME__)) + /*--- エラーメッセージを得る ---*/ + #define igs_resource_msg_from_er(tit) \ + igs::resource::msg_from_err_( \ + tit, NO_ERROR, TEXT(__FILE__), TEXT(igs_tostr(__LINE__)), \ + TEXT(__PRETTY_FUNCTION__), TEXT(__VERSION__), \ + TEXT(__VERSION__), TEXT(__DATE__), TEXT(__TIME__)) +#endif + #endif /* !igs_resource_msg_from_err_h */ diff --git a/toonz/sources/stdfx/ino_line_blur.cpp b/toonz/sources/stdfx/ino_line_blur.cpp index dddd894..95c87f9 100644 --- a/toonz/sources/stdfx/ino_line_blur.cpp +++ b/toonz/sources/stdfx/ino_line_blur.cpp @@ -279,7 +279,7 @@ private: #include /* Windowsではstdint.hが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER typedef int int32_t; typedef unsigned short uint16_t; #else @@ -384,7 +384,7 @@ list_node *list_root::pop(list_node *clp_old) { #include /* Windowsではstdint.hが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER typedef int int32_t; #else #include /* for int32_t */ @@ -699,7 +699,7 @@ int brush_curve_blur::save(double d_xp, double d_yp, const char *cp_fname) { #include /* Windowsではstdint.hが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER typedef int int32_t; typedef unsigned short uint16_t; #else @@ -1108,7 +1108,7 @@ private: #include "igs_line_blur.h" // "pri.h" "calculator_geometry.h" /* WindowsではM_PIが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER #define M_PI 3.14159265358979323846 #endif @@ -1206,7 +1206,7 @@ void calculator_geometry::get_dd_rotate_by_pos(double d_xp1, double d_yp1, #include /* Windowsではstdint.hが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER typedef int int32_t; typedef unsigned short uint16_t; #else @@ -1890,7 +1890,7 @@ void pixel_line_node::int2double_body(void) { #include "igs_line_blur.h" // "pri.h" "pixel_line_node.h" /* WindowsではM_PIが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER #define M_PI 3.14159265358979323846 #endif @@ -2541,7 +2541,7 @@ private: #include "igs_line_blur.h" // "pri.h" "pixel_line_root.h" "pixel_select_same_way.h" /* WindowsではM_PIが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER #define M_PI 3.14159265358979323846 #endif @@ -4080,7 +4080,7 @@ private: #include /* M_PI */ /* WindowsではM_PIが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER #define M_PI 3.14159265358979323846 #endif @@ -4496,7 +4496,7 @@ int pixel_select_curve_blur_root::save(double d_xp, double d_yp, #include /* Windowsではstdint.hが見つからない */ -#if defined _WIN32 +#if defined _MSC_VER typedef int int32_t; typedef unsigned short uint16_t; #else diff --git a/toonz/sources/stdfx/pins.cpp b/toonz/sources/stdfx/pins.cpp index 1e041b7..1bf3018 100644 --- a/toonz/sources/stdfx/pins.cpp +++ b/toonz/sources/stdfx/pins.cpp @@ -9,7 +9,7 @@ #include //------------------------------------------------------------------------------ -#ifdef _WIN32 +#ifdef _MSC_VER #define ISNAN _isnan #else #define ISNAN std::isnan diff --git a/toonz/sources/stdfx/stdfx.cpp b/toonz/sources/stdfx/stdfx.cpp index e78f0cc..343d676 100644 --- a/toonz/sources/stdfx/stdfx.cpp +++ b/toonz/sources/stdfx/stdfx.cpp @@ -13,7 +13,7 @@ #include -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif #undef max diff --git a/toonz/sources/tnzext/Potential.cpp b/toonz/sources/tnzext/Potential.cpp index 37e645c..bdee8ce 100644 --- a/toonz/sources/tnzext/Potential.cpp +++ b/toonz/sources/tnzext/Potential.cpp @@ -3,7 +3,7 @@ #include "ext/Potential.h" #include -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) #pragma warning(push) #pragma warning(disable : 4290) #endif @@ -50,6 +50,6 @@ double ToonzExt::Potential::value(double at) const { // End Of File //----------------------------------------------------------------------------- -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) #pragma warning(pop) #endif diff --git a/toonz/sources/tnzext/Types.cpp b/toonz/sources/tnzext/Types.cpp index 6dd9ed7..3e4ad70 100644 --- a/toonz/sources/tnzext/Types.cpp +++ b/toonz/sources/tnzext/Types.cpp @@ -5,7 +5,7 @@ #endif #include "ext/Types.h" -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) // to avoid annoying warning #pragma warning(push) #pragma warning(disable : 4290) @@ -69,7 +69,7 @@ bool ToonzExt::EvenInt::isEven() const { return (bool)(!(val_ & 1)); } //----------------------------------------------------------------------------- -#if defined(_WIN32) && (_MSC_VER <= 1200) +#if defined(_MSC_VER) && (_MSC_VER <= 1200) #pragma warning(pop) #endif diff --git a/toonz/sources/toonz/batches.h b/toonz/sources/toonz/batches.h index c6d6b3e..1e4e31d 100644 --- a/toonz/sources/toonz/batches.h +++ b/toonz/sources/toonz/batches.h @@ -20,7 +20,7 @@ class TFarmController; //------------------------------------------------------------------------------ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4786) #endif @@ -143,7 +143,7 @@ public: //------------------------------------------------------------------------------ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(pop) #endif diff --git a/toonz/sources/toonz/filebrowsermodel.cpp b/toonz/sources/toonz/filebrowsermodel.cpp index abf7dd1..832f234 100644 --- a/toonz/sources/toonz/filebrowsermodel.cpp +++ b/toonz/sources/toonz/filebrowsermodel.cpp @@ -18,7 +18,7 @@ #ifdef _WIN32 #include -#include +#include #endif #ifdef MACOSX #include diff --git a/toonz/sources/toonz/metnum.cpp b/toonz/sources/toonz/metnum.cpp index c2569d2..9c1db73 100644 --- a/toonz/sources/toonz/metnum.cpp +++ b/toonz/sources/toonz/metnum.cpp @@ -12,6 +12,10 @@ #include #include "metnum.h" +#ifndef DBL_EPSILON +#define DBL_EPSILON 2.2204460492503131e-16 +#endif + using namespace MetNum; /*----------------------- funzioni globali ----------------------------*/ diff --git a/toonz/sources/toonzfarm/tfarm/service.cpp b/toonz/sources/toonzfarm/tfarm/service.cpp index aeae7ae..631b8b8 100644 --- a/toonz/sources/toonzfarm/tfarm/service.cpp +++ b/toonz/sources/toonzfarm/tfarm/service.cpp @@ -6,8 +6,11 @@ #include "tfilepath.h" -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) +#endif + +#ifdef _WIN32 #include #include #include diff --git a/toonz/sources/toonzfarm/tfarm/tlog.cpp b/toonz/sources/toonzfarm/tfarm/tlog.cpp index 7e14b56..7cc875e 100644 --- a/toonz/sources/toonzfarm/tfarm/tlog.cpp +++ b/toonz/sources/toonzfarm/tfarm/tlog.cpp @@ -5,8 +5,11 @@ #include "tfilepath_io.h" #include -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) +#endif + +#ifdef _WIN32 #include #include #include diff --git a/toonz/sources/toonzfarm/tfarm/ttcpipclient.cpp b/toonz/sources/toonzfarm/tfarm/ttcpipclient.cpp index db26f39..8d096be 100644 --- a/toonz/sources/toonzfarm/tfarm/ttcpipclient.cpp +++ b/toonz/sources/toonzfarm/tfarm/ttcpipclient.cpp @@ -4,7 +4,7 @@ #include "tconvert.h" #ifdef _WIN32 -#include +#include #else #include /* obligatory includes */ #include diff --git a/toonz/sources/toonzfarm/tfarm/ttcpipserver.cpp b/toonz/sources/toonzfarm/tfarm/ttcpipserver.cpp index 80fffe0..ac6df6e 100644 --- a/toonz/sources/toonzfarm/tfarm/ttcpipserver.cpp +++ b/toonz/sources/toonzfarm/tfarm/ttcpipserver.cpp @@ -4,7 +4,7 @@ #include "tconvert.h" #ifdef _WIN32 -#include +#include #else #include /* obligatory includes */ #include diff --git a/toonz/sources/toonzfarm/tnzcore_stuff/tthread.cpp b/toonz/sources/toonzfarm/tnzcore_stuff/tthread.cpp index 6211827..1f0006d 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(_MSC_VER) && (_MSC_VER == 1200) #pragma warning(disable : 4290) #endif static void milestone() throw(TThread::Interrupt); -#if defined(_WIN32) && (_MSC_VER == 1200) +#if defined(_MSC_VER) && (_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(_MSC_VER) && (_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(_MSC_VER) && (_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(_MSC_VER) && (_MSC_VER == 1200) #pragma warning(disable : 4290) #endif void TThread::milestone() throw(TThread::Interrupt) { Thread::milestone(); } -#if defined(_WIN32) && (_MSC_VER == 1200) +#if defined(_MSC_VER) && (_MSC_VER == 1200) #pragma warning(default : 4290) #endif diff --git a/toonz/sources/toonzlib/cleanupparameters.cpp b/toonz/sources/toonzlib/cleanupparameters.cpp index 2e4e038..b5bf9e7 100644 --- a/toonz/sources/toonzlib/cleanupparameters.cpp +++ b/toonz/sources/toonzlib/cleanupparameters.cpp @@ -12,7 +12,7 @@ #include "cleanuppalette.h" #include "tpalette.h" -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/toonzlib/sandor_fxs/BlurMatrix.cpp b/toonz/sources/toonzlib/sandor_fxs/BlurMatrix.cpp index 7d615df..7ad5196 100644 --- a/toonz/sources/toonzlib/sandor_fxs/BlurMatrix.cpp +++ b/toonz/sources/toonzlib/sandor_fxs/BlurMatrix.cpp @@ -4,7 +4,7 @@ // ////////////////////////////////////////////////////////////////////// #ifdef _WIN32 -#include "Windows.h" +#include "windows.h" #else #ifdef __sgi diff --git a/toonz/sources/toonzlib/sandor_fxs/CIL.cpp b/toonz/sources/toonzlib/sandor_fxs/CIL.cpp index f741c28..ce00c30 100644 --- a/toonz/sources/toonzlib/sandor_fxs/CIL.cpp +++ b/toonz/sources/toonzlib/sandor_fxs/CIL.cpp @@ -3,7 +3,7 @@ // CIL.cpp: implementation of the CCIL class. // ////////////////////////////////////////////////////////////////////// -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/toonzlib/sandor_fxs/InputParam.h b/toonz/sources/toonzlib/sandor_fxs/InputParam.h index 408ae8a..f75a49e 100644 --- a/toonz/sources/toonzlib/sandor_fxs/InputParam.h +++ b/toonz/sources/toonzlib/sandor_fxs/InputParam.h @@ -8,7 +8,7 @@ #define AFX_INPUTPARAM_H__41D42157_F2EE_11D5_B92D_0040F674BE6A__INCLUDED_ #ifdef _WIN32 -#include "Windows.h" +#include "windows.h" #endif #include #include diff --git a/toonz/sources/toonzlib/sandor_fxs/Params.h b/toonz/sources/toonzlib/sandor_fxs/Params.h index 9f7a8ee..7e8ad87 100644 --- a/toonz/sources/toonzlib/sandor_fxs/Params.h +++ b/toonz/sources/toonzlib/sandor_fxs/Params.h @@ -8,7 +8,7 @@ #define AFX_PARAMS_H__40D9A921_F329_11D5_B92E_0040F674BE6A__INCLUDED_ #ifdef _WIN32 -#include "Windows.h" +#include "windows.h" #endif #include #include diff --git a/toonz/sources/toonzlib/sandor_fxs/Pattern.cpp b/toonz/sources/toonzlib/sandor_fxs/Pattern.cpp index 298a2eb..5cd0882 100644 --- a/toonz/sources/toonzlib/sandor_fxs/Pattern.cpp +++ b/toonz/sources/toonzlib/sandor_fxs/Pattern.cpp @@ -3,7 +3,7 @@ // Pattern.cpp: implementation of the CPattern class. // ////////////////////////////////////////////////////////////////////// -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/toonzlib/sandor_fxs/PatternMapParam.cpp b/toonz/sources/toonzlib/sandor_fxs/PatternMapParam.cpp index e48c2d0..f502984 100644 --- a/toonz/sources/toonzlib/sandor_fxs/PatternMapParam.cpp +++ b/toonz/sources/toonzlib/sandor_fxs/PatternMapParam.cpp @@ -4,7 +4,7 @@ // ////////////////////////////////////////////////////////////////////// -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif #include diff --git a/toonz/sources/toonzlib/sandor_fxs/PatternPosition.cpp b/toonz/sources/toonzlib/sandor_fxs/PatternPosition.cpp index 8de9f56..3aac31d 100644 --- a/toonz/sources/toonzlib/sandor_fxs/PatternPosition.cpp +++ b/toonz/sources/toonzlib/sandor_fxs/PatternPosition.cpp @@ -4,7 +4,7 @@ // ////////////////////////////////////////////////////////////////////// -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/toonzlib/sandor_fxs/STColSelPic.h b/toonz/sources/toonzlib/sandor_fxs/STColSelPic.h index 45dfb74..06d1262 100644 --- a/toonz/sources/toonzlib/sandor_fxs/STColSelPic.h +++ b/toonz/sources/toonzlib/sandor_fxs/STColSelPic.h @@ -11,7 +11,7 @@ #if !defined(AFX_STCOLSELPIC_H__80D708B0_FCA2_11D5_B949_0040F674BE6A__INCLUDED_) #define AFX_STCOLSELPIC_H__80D708B0_FCA2_11D5_B949_0040F674BE6A__INCLUDED_ -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif #include diff --git a/toonz/sources/toonzlib/sandor_fxs/YOMBInputParam.cpp b/toonz/sources/toonzlib/sandor_fxs/YOMBInputParam.cpp index 925616c..b2e1995 100644 --- a/toonz/sources/toonzlib/sandor_fxs/YOMBInputParam.cpp +++ b/toonz/sources/toonzlib/sandor_fxs/YOMBInputParam.cpp @@ -4,7 +4,7 @@ // ////////////////////////////////////////////////////////////////////// -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif diff --git a/toonz/sources/toonzlib/sandor_fxs/YOMBParam.cpp b/toonz/sources/toonzlib/sandor_fxs/YOMBParam.cpp index 606eb22..4c86850 100644 --- a/toonz/sources/toonzlib/sandor_fxs/YOMBParam.cpp +++ b/toonz/sources/toonzlib/sandor_fxs/YOMBParam.cpp @@ -4,7 +4,7 @@ // ////////////////////////////////////////////////////////////////////// #ifdef _WIN32 -#include "Windows.h" +#include "windows.h" #endif #include #include diff --git a/toonz/sources/toonzlib/sandor_fxs/calligraph.cpp b/toonz/sources/toonzlib/sandor_fxs/calligraph.cpp index 1b2da12..49ecf6a 100644 --- a/toonz/sources/toonzlib/sandor_fxs/calligraph.cpp +++ b/toonz/sources/toonzlib/sandor_fxs/calligraph.cpp @@ -1,7 +1,9 @@ +#ifdef _MSC_VER +#pragma warning(disable : 4996) +#endif #ifdef _WIN32 -#pragma warning(disable : 4996) #include "windows.h" #endif #include diff --git a/toonz/sources/toonzlib/sandor_fxs/patternmap.cpp b/toonz/sources/toonzlib/sandor_fxs/patternmap.cpp index 486e4d3..60bc34d 100644 --- a/toonz/sources/toonzlib/sandor_fxs/patternmap.cpp +++ b/toonz/sources/toonzlib/sandor_fxs/patternmap.cpp @@ -1,7 +1,7 @@ #ifdef _WIN32 -#include "Windows.h" +#include "windows.h" #endif #include diff --git a/toonz/sources/toonzlib/sandor_fxs/toonz4_6staff.cpp b/toonz/sources/toonzlib/sandor_fxs/toonz4_6staff.cpp index a9b4508..a56a216 100644 --- a/toonz/sources/toonzlib/sandor_fxs/toonz4_6staff.cpp +++ b/toonz/sources/toonzlib/sandor_fxs/toonz4_6staff.cpp @@ -5,7 +5,7 @@ #include "tconvert.h" #include "toonz4.6/toonz.h" -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) #endif //--------------------------------------------------------------------- diff --git a/toonz/sources/toonzlib/screensavermaker.cpp b/toonz/sources/toonzlib/screensavermaker.cpp index 4cbd8cf..960699d 100644 --- a/toonz/sources/toonzlib/screensavermaker.cpp +++ b/toonz/sources/toonzlib/screensavermaker.cpp @@ -5,9 +5,11 @@ #include -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) +#endif +#ifdef _WIN32 #include #include //#include diff --git a/toonz/sources/toonzlib/tlog.cpp b/toonz/sources/toonzlib/tlog.cpp index fcbf77a..bc6241b 100644 --- a/toonz/sources/toonzlib/tlog.cpp +++ b/toonz/sources/toonzlib/tlog.cpp @@ -6,8 +6,11 @@ #include -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4996) +#endif + +#ifdef _WIN32 #include #include #include diff --git a/toonz/sources/toonzlib/tstageobject.cpp b/toonz/sources/toonzlib/tstageobject.cpp index dcedd02..e51026c 100644 --- a/toonz/sources/toonzlib/tstageobject.cpp +++ b/toonz/sources/toonzlib/tstageobject.cpp @@ -43,11 +43,11 @@ using namespace std; // il problema si verifica ruotando gli oggetti sul camera stand // -#ifdef _WIN32 +#ifdef _MSC_VER #pragma optimize("", off) #endif static TAffine makeRotation(double ang) { return TRotation(ang); } -#ifdef _WIN32 +#ifdef _MSC_VER #pragma optimize("", on) #endif diff --git a/toonz/sources/toonzqt/keyframenavigator.cpp b/toonz/sources/toonzqt/keyframenavigator.cpp index b8d1431..a9dae21 100644 --- a/toonz/sources/toonzqt/keyframenavigator.cpp +++ b/toonz/sources/toonzqt/keyframenavigator.cpp @@ -19,7 +19,7 @@ #include #include -#ifdef _WIN32 +#ifdef _MSC_VER #pragma warning(disable : 4251) #endif diff --git a/toonz/sources/toonzqt/toonz_plugin.h b/toonz/sources/toonzqt/toonz_plugin.h index 34333f7..d376d58 100644 --- a/toonz/sources/toonzqt/toonz_plugin.h +++ b/toonz/sources/toonzqt/toonz_plugin.h @@ -5,7 +5,7 @@ #include -#ifdef _MSC_VER +#ifdef _WIN32 #define TOONZ_EXPORT __declspec(dllexport) #define TOONZ_PACK #else