diff --git a/src/libprojectM/Common.hpp b/src/libprojectM/Common.hpp index 66d46d0db..03b890f1b 100755 --- a/src/libprojectM/Common.hpp +++ b/src/libprojectM/Common.hpp @@ -26,22 +26,22 @@ #ifndef COMMON_HPP #define COMMON_HPP + +#include #include #include #include +#include #include #include -#include -#include - //CPP17: std::filesystem::path::preferred_separator /** Per-platform path separators */ -#ifdef WIN32 +#ifdef _WIN32 char constexpr pathSeparator{'\\'}; #else char constexpr pathSeparator{'/'}; -#endif /** WIN32 */ +#endif /** _WIN32 */ size_t constexpr maxTokenSize{512}; size_t constexpr maxPathSize{4096}; diff --git a/src/libprojectM/FileScanner.cpp b/src/libprojectM/FileScanner.cpp index 74bfe4235..9c4ac57ca 100644 --- a/src/libprojectM/FileScanner.cpp +++ b/src/libprojectM/FileScanner.cpp @@ -7,7 +7,7 @@ #include "FileScanner.hpp" #include "Common.hpp" -#ifndef WIN32 +#ifndef _WIN32 #include #include #endif @@ -109,7 +109,7 @@ void FileScanner::scanGeneric(ScanCallback cb, const char *currentDir) { std::string fullPath = std::string(currentDir) + pathSeparator + filename; -#ifndef WIN32 +#ifndef _WIN32 // filesystems are free to return DT_UNKNOWN if (dir_entry->d_type == DT_UNKNOWN) { diff --git a/src/libprojectM/MilkdropPresetFactory/MilkdropPreset.cpp b/src/libprojectM/MilkdropPresetFactory/MilkdropPreset.cpp index 78aa9b7d4..72536b51b 100755 --- a/src/libprojectM/MilkdropPresetFactory/MilkdropPreset.cpp +++ b/src/libprojectM/MilkdropPresetFactory/MilkdropPreset.cpp @@ -20,16 +20,14 @@ */ #include -#include #include +#include -#ifdef WIN32 +#ifdef _WIN32 #include "dirent.h" #else - #include - -#endif /** WIN32 */ +#endif /** _WIN32 */ #include diff --git a/src/libprojectM/ProjectM.cpp b/src/libprojectM/ProjectM.cpp index b8a84fe96..067db9dd1 100644 --- a/src/libprojectM/ProjectM.cpp +++ b/src/libprojectM/ProjectM.cpp @@ -32,7 +32,7 @@ #include "fatal.h" #include "projectM-opengl.h" -#ifdef WIN32 +#ifdef _WIN32 #include "dirent.h" #else #include @@ -136,7 +136,7 @@ void ProjectM::ReadConfig(const std::string& configurationFilename) m_settings.presetPath = config.read("Preset Path", "../Resources/presets"); #endif -#ifdef WIN32 +#ifdef _WIN32 m_settings.presetPath = config.read("Preset Path", "/usr/local/share/projectM/presets"); #endif diff --git a/src/libprojectM/ProjectM.hpp b/src/libprojectM/ProjectM.hpp index f2f658f52..0b6fbf56b 100644 --- a/src/libprojectM/ProjectM.hpp +++ b/src/libprojectM/ProjectM.hpp @@ -26,7 +26,7 @@ #include "event.h" #include "fatal.h" -#ifdef WIN32 +#ifdef _WIN32 #ifdef _MSC_VER // libs required for win32 @@ -40,7 +40,7 @@ #include #else #include -#endif /** WIN32 */ +#endif /** _WIN32 */ #include diff --git a/src/libprojectM/Renderer/ShaderEngine.cpp b/src/libprojectM/Renderer/ShaderEngine.cpp index db64c9261..efa248b01 100644 --- a/src/libprojectM/Renderer/ShaderEngine.cpp +++ b/src/libprojectM/Renderer/ShaderEngine.cpp @@ -899,9 +899,9 @@ void ShaderEngine::reset() GLuint ShaderEngine::CompileShaderProgram(const std::string & VertexShaderCode, const std::string & FragmentShaderCode, const std::string & shaderTypeString){ -#if defined(WIN32) && !defined(EYETUNE_WINRT) +#if defined(_WIN32) && !defined(EYETUNE_WINRT) GLenum err = glewInit(); -#endif /** WIN32 */ +#endif /** _WIN32 */ // Create the shaders GLuint VertexShaderID = glCreateShader(GL_VERTEX_SHADER); diff --git a/src/libprojectM/Renderer/Waveform.cpp b/src/libprojectM/Renderer/Waveform.cpp index eadbe9545..86cdc78a1 100644 --- a/src/libprojectM/Renderer/Waveform.cpp +++ b/src/libprojectM/Renderer/Waveform.cpp @@ -6,9 +6,9 @@ #include -#ifdef WIN32 +#ifdef _WIN32 #include -#endif /** WIN32 */ +#endif /** _WIN32 */ Waveform::Waveform(int _samples) : RenderItem() diff --git a/src/libprojectM/Renderer/hlslparser/src/HLSLParser.cpp b/src/libprojectM/Renderer/hlslparser/src/HLSLParser.cpp index 04c24a7c2..bbf2902aa 100755 --- a/src/libprojectM/Renderer/hlslparser/src/HLSLParser.cpp +++ b/src/libprojectM/Renderer/hlslparser/src/HLSLParser.cpp @@ -14,15 +14,16 @@ #include "HLSLTree.h" #include -#include -#include -#include -#include #include #include -#if defined WIN32 && !defined alloca +#include +#include +#include +#include + +#if defined _WIN32 && !defined alloca #include -#endif /** WIN32 */ +#endif /** _WIN32 */ namespace M4 @@ -1098,13 +1099,13 @@ struct CompareRanks static CompareFunctionsResult CompareFunctions(HLSLTree* tree, const HLSLFunctionCall* call, const HLSLFunction* function1, const HLSLFunction* function2) { -#if defined WIN32 && !defined alloca +#if defined _WIN32 && !defined alloca int* function1Ranks = static_cast(_alloca(sizeof(int) * call->numArguments)); int* function2Ranks = static_cast(_alloca(sizeof(int) * call->numArguments)); #else int* function1Ranks = static_cast(alloca(sizeof(int) * call->numArguments)); int* function2Ranks = static_cast(alloca(sizeof(int) * call->numArguments)); -#endif /** WIN32 */ +#endif /** _WIN32 && ! alloca */ const bool function1Viable = GetFunctionCallCastRanks(tree, call, function1, function1Ranks); const bool function2Viable = GetFunctionCallCastRanks(tree, call, function2, function2Ranks); diff --git a/src/libprojectM/sdltoprojectM.h b/src/libprojectM/sdltoprojectM.h index a2763c3d8..70e54dfde 100755 --- a/src/libprojectM/sdltoprojectM.h +++ b/src/libprojectM/sdltoprojectM.h @@ -37,8 +37,7 @@ #include "event.h" - //#include "projectM/projectM.hpp" -#ifdef WIN32 +#ifdef _WIN32 #include #else #include diff --git a/src/libprojectM/wipemalloc.h b/src/libprojectM/wipemalloc.h index 26b9fa0f2..cce3666d2 100755 --- a/src/libprojectM/wipemalloc.h +++ b/src/libprojectM/wipemalloc.h @@ -33,11 +33,11 @@ #ifndef MACOS #ifndef HAVE_AIX /** AIX has malloc() defined in a strange place... */ -#ifdef WIN32 +#ifdef _WIN32 #include #endif -#include #include +#include #else #include #endif /** !HAVE_AIX */ @@ -48,7 +48,7 @@ #include #ifdef PANTS -#if defined(WIN32) && !defined(inline) +#if defined(_WIN32) && !defined(inline) #define inline #endif #endif diff --git a/src/sdl-test-ui/pmSDL.hpp b/src/sdl-test-ui/pmSDL.hpp index 27425e661..c119de43d 100644 --- a/src/sdl-test-ui/pmSDL.hpp +++ b/src/sdl-test-ui/pmSDL.hpp @@ -31,9 +31,9 @@ // Disable LOOPBACK and FAKE audio to enable microphone input -#ifdef WIN32 +#ifdef _WIN32 #define WASAPI_LOOPBACK 1 -#endif /** WIN32 */ +#endif /** _WIN32 */ #define FAKE_AUDIO 0 // ---------------------------- #define TEST_ALL_PRESETS 0 @@ -75,12 +75,12 @@ #endif /** WASAPI_LOOPBACK */ -#ifdef WIN32 +#ifdef _WIN32 #define SDL_MAIN_HANDLED #include "SDL.h" #else #include -#endif /** WIN32 */ +#endif /** _WIN32 */ // DATADIR_PATH should be set by the root Makefile if this is being @@ -91,9 +91,9 @@ #warning "DATADIR_PATH is not defined - falling back to ./" #else #define DATADIR_PATH "/usr/local/share/projectM" -#ifndef WIN32 +#ifndef _WIN32 #warning "DATADIR_PATH is not defined - falling back to /usr/local/share/projectM" -#endif /** WIN32 */ +#endif /** _WIN32 */ #endif #endif diff --git a/src/sdl-test-ui/setup.cpp b/src/sdl-test-ui/setup.cpp index 779c9e75f..74a0fce1f 100644 --- a/src/sdl-test-ui/setup.cpp +++ b/src/sdl-test-ui/setup.cpp @@ -79,7 +79,7 @@ std::string getConfigFilePath(std::string datadir_path) { void seedRand() { -#ifndef WIN32 +#ifndef _WIN32 srand((int)(time(NULL))); #endif } @@ -172,9 +172,9 @@ projectMSDL *setupSDLApp() { SDL_GLContext glCtx = SDL_GL_CreateContext(win); -#if defined(WIN32) +#if defined(_WIN32) GLenum err = glewInit(); -#endif /** WIN32 */ +#endif /** _WIN32 */ dumpOpenGLInfo();