/* * Copyright 2011-2022 Cuberite Contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Globals.h // This file is used for precompiled header generation in MSVC // OS-dependent stuff: #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #define _WIN32_WINNT 0x501 // We want to target WinXP and higher #include #include #include // IPv6 stuff // Windows SDK defines min and max macros, messing up with our std::min and std::max usage #undef min #undef max // Windows SDK defines GetFreeSpace as a constant, probably a Win16 API remnant #ifdef GetFreeSpace #undef GetFreeSpace #endif // GetFreeSpace #else #include #include // for mkdir #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif // CRT stuff: #include #include #include #include // STL stuff: #include #include #include #include #include #include #include #include #include // Common headers (part 1, without macros): #include "../../src/StringUtils.h" // Common definitions: /** Evaluates to the number of elements in an array (compile-time!) */ #define ARRAYCOUNT(X) (sizeof(X) / sizeof(*(X))) /** Allows arithmetic expressions like "32 KiB" (but consider using parenthesis around it, "(32 KiB)") */ #define KiB * 1024 #define MiB * 1024 * 1024 #define ASSERT assert