#pragma once
#include "CompilerDetect.h"
#if MPT_OS_WINDOWS
#if defined(MPT_BUILD_MSVC)
#if defined(MPT_BUILD_TARGET_XP)
#if defined(_M_X64)
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0502
#endif
#else
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
#endif
#else
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0601
#endif
#endif
#else
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
#endif
#ifndef WINVER
#define WINVER _WIN32_WINNT
#endif
#endif
#if defined(MODPLUG_TRACKER) && defined(LIBOPENMPT_BUILD)
#error "either MODPLUG_TRACKER or LIBOPENMPT_BUILD has to be defined"
#elif defined(MODPLUG_TRACKER)
#elif defined(LIBOPENMPT_BUILD)
#else
#error "either MODPLUG_TRACKER or LIBOPENMPT_BUILD has to be defined"
#endif
#if defined(HAVE_CONFIG_H)
#include "config.h"
#ifdef MPT_WITH_FLAC
#undef MPT_WITH_FLAC
#endif
#endif
#if defined(MPT_BUILD_MSVC)
#if defined(MODPLUG_TRACKER)
#define MPT_WITH_ASIO
#define MPT_WITH_LAME
#define MPT_WITH_LHASA
#define MPT_WITH_MINIZIP
#define MPT_WITH_NLOHMANNJSON
#define MPT_WITH_OPUS
#define MPT_WITH_OPUSENC
#define MPT_WITH_OPUSFILE
#define MPT_WITH_PORTAUDIO
#define MPT_WITH_RTAUDIO
#define MPT_WITH_SMBPITCHSHIFT
#define MPT_WITH_UNRAR
#define MPT_WITH_VORBISENC
#define MPT_WITH_FLAC
#if MPT_OS_WINDOWS
#if (_WIN32_WINNT >= 0x0601)
#define MPT_WITH_MEDIAFOUNDATION
#endif
#endif
#define MPT_WITH_MPG123
#define MPT_WITH_OGG
#define MPT_WITH_VORBIS
#define MPT_WITH_VORBISFILE
#define MPT_WITH_ZLIB
#endif
#if defined(LIBOPENMPT_BUILD)
#if defined(LIBOPENMPT_BUILD_FULL) && defined(LIBOPENMPT_BUILD_SMALL)
#error "only one of LIBOPENMPT_BUILD_FULL or LIBOPENMPT_BUILD_SMALL can be defined"
#endif
#if defined(LIBOPENMPT_BUILD_SMALL)
#define MPT_WITH_MINIMP3
#define MPT_WITH_MINIZ
#define MPT_WITH_STBVORBIS
#else
#define MPT_WITH_MPG123
#define MPT_WITH_OGG
#define MPT_WITH_VORBIS
#define MPT_WITH_VORBISFILE
#define MPT_WITH_ZLIB
#endif
#endif
#endif
#if defined(MPT_BUILD_XCODE)
#if defined(MODPLUG_TRACKER)
#endif
#if defined(LIBOPENMPT_BUILD)
#define MPT_WITH_MPG123
#define MPT_WITH_OGG
#define MPT_WITH_VORBIS
#define MPT_WITH_VORBISFILE
#define MPT_WITH_ZLIB
#endif
#endif
#if defined(MODPLUG_TRACKER)
#if defined(MPT_BUILD_DEBUG) || defined(MPT_BUILD_CHECKED)
#define ENABLE_TESTS
#endif
#if !defined(MPT_BUILD_DEBUG) && !defined(MPT_BUILD_CHECKED) && !defined(MPT_BUILD_WINESUPPORT)
#define MPT_LOG_GLOBAL_LEVEL_STATIC
#define MPT_LOG_GLOBAL_LEVEL 0
#endif
#if !defined(MPT_BUILD_DEBUG) && !defined(MPT_BUILD_CHECKED) && !defined(MPT_BUILD_WINESUPPORT)
#define NO_ASSERTS
#endif
#define MPT_EXTERNAL_SAMPLES
#define MPT_ENABLE_CHARSET_LOCALE
#define ENABLE_ASM
#define NO_LIBOPENMPT_C
#define NO_LIBOPENMPT_CXX
#endif
#if defined(LIBOPENMPT_BUILD)
#if (defined(_DEBUG) || defined(DEBUG)) && !defined(MPT_BUILD_DEBUG)
#define MPT_BUILD_DEBUG
#endif
#if defined(LIBOPENMPT_BUILD_TEST)
#define ENABLE_TESTS
#else
#define MODPLUG_NO_FILESAVE
#endif
#if defined(MPT_BUILD_ANALZYED) || defined(MPT_BUILD_DEBUG) || defined(MPT_BUILD_CHECKED) || defined(ENABLE_TESTS)
#else
#define NO_ASSERTS
#endif
#define MPT_FILEREADER_STD_ISTREAM
#define MPT_FILEREADER_CALLBACK_STREAM
#if defined(ENABLE_TESTS) || defined(MPT_BUILD_HACK_ARCHIVE_SUPPORT)
#define MPT_ENABLE_CHARSET_LOCALE
#else
#endif
#if defined(MPT_BUILD_HACK_ARCHIVE_SUPPORT)
#else
#define NO_ARCHIVE_SUPPORT
#endif
#define NO_DSP
#define NO_EQ
#define NO_AGC
#define NO_VST
#define NO_DMO
#endif
#if MPT_OS_WINDOWS
#define MPT_CHARSET_WIN32
#ifndef MPT_ENABLE_CHARSET_LOCALE
#define MPT_ENABLE_CHARSET_LOCALE
#endif
#elif MPT_OS_LINUX
#define MPT_CHARSET_ICONV
#elif MPT_OS_ANDROID
#define MPT_CHARSET_INTERNAL
#elif MPT_OS_EMSCRIPTEN
#define MPT_CHARSET_INTERNAL
#ifndef MPT_LOCALE_ASSUME_CHARSET
#define MPT_LOCALE_ASSUME_CHARSET CharsetUTF8
#endif
#elif MPT_OS_MACOSX_OR_IOS
#if defined(MPT_WITH_ICONV)
#define MPT_CHARSET_ICONV
#ifndef MPT_ICONV_NO_WCHAR
#define MPT_ICONV_NO_WCHAR
#endif
#else
#define MPT_CHARSET_INTERNAL
#endif
#elif MPT_OS_DJGPP
#define MPT_CHARSET_INTERNAL
#ifndef MPT_LOCALE_ASSUME_CHARSET
#define MPT_LOCALE_ASSUME_CHARSET CharsetCP437
#endif
#elif defined(MPT_WITH_ICONV)
#define MPT_CHARSET_ICONV
#endif
#if MPT_COMPILER_MSVC && !defined(MPT_USTRING_MODE_UTF8_FORCE)
#define MPT_USTRING_MODE_WIDE 1
#define MPT_USTRING_MODE_UTF8 0
#else
#define MPT_USTRING_MODE_WIDE 0
#define MPT_USTRING_MODE_UTF8 1
#endif
#if MPT_USTRING_MODE_UTF8
#define MPT_ENABLE_U8STRING 1
#else
#define MPT_ENABLE_U8STRING 0
#endif
#if defined(MODPLUG_TRACKER) || MPT_USTRING_MODE_WIDE
#define MPT_WSTRING_FORMAT 1
#else
#define MPT_WSTRING_FORMAT 0
#endif
#if MPT_OS_WINDOWS || MPT_USTRING_MODE_WIDE || MPT_WSTRING_FORMAT
#define MPT_WSTRING_CONVERT 1
#else
#define MPT_WSTRING_CONVERT 0
#endif
#if defined(MPT_BUILD_ANALYZED) || defined(MPT_BUILD_CHECKED)
#ifdef NO_ASSERTS
#undef NO_ASSERTS
#endif
#endif
#if defined(MPT_BUILD_FUZZER)
#ifndef MPT_FUZZ_TRACKER
#define MPT_FUZZ_TRACKER
#endif
#endif
#if !MPT_COMPILER_MSVC && defined(ENABLE_ASM)
#undef ENABLE_ASM
#endif
#if defined(ENABLE_ASM)
#if MPT_COMPILER_MSVC && defined(_M_IX86)
#define ENABLE_X86
#define ENABLE_MMX
#define ENABLE_SSE
#define ENABLE_SSE2
#define ENABLE_SSE3
#define ENABLE_SSE4
#if defined(MPT_BUILD_TARGET_XP)
#define ENABLE_X86_AMD
#endif
#elif MPT_COMPILER_MSVC && defined(_M_X64)
#define ENABLE_X64
#define ENABLE_SSE
#define ENABLE_SSE2
#define ENABLE_SSE3
#define ENABLE_SSE4
#endif #endif
#if defined(MPT_WITH_LAME) && defined(MPT_BUILD_MSVC) && defined(MPT_BUILD_MSVC_STATIC) && defined(MODPLUG_TRACKER) && !MPT_OS_WINDOWS_WINRT
#define MPT_ENABLE_LAME_DELAYLOAD
#endif
#if defined(MPT_WITH_MPG123) && defined(MPT_BUILD_MSVC) && defined(MPT_BUILD_MSVC_STATIC) && defined(MODPLUG_TRACKER) && !MPT_OS_WINDOWS_WINRT
#define MPT_ENABLE_MPG123_DELAYLOAD
#endif
#if defined(ENABLE_TESTS) && defined(MODPLUG_NO_FILESAVE)
#undef MODPLUG_NO_FILESAVE
#endif
#if defined(MPT_WITH_ZLIB) && defined(MPT_WITH_MINIZ)
#undef MPT_WITH_MINIZ
#endif
#if !MPT_OS_WINDOWS && defined(MPT_WITH_MEDIAFOUNDATION)
#undef MPT_WITH_MEDIAFOUNDATION
#endif
#if !MPT_COMPILER_MSVC && !MPT_COMPILER_CLANG && defined(MPT_WITH_MEDIAFOUNDATION)
#undef MPT_WITH_MEDIAFOUNDATION
#endif
#if defined(MPT_WITH_MEDIAFOUNDATION) && !defined(MPT_ENABLE_TEMPFILE)
#define MPT_ENABLE_TEMPFILE
#endif
#if defined(MODPLUG_TRACKER) && !defined(MPT_ENABLE_TEMPFILE)
#define MPT_ENABLE_TEMPFILE
#endif
#if MPT_CXX_AT_LEAST(17) && defined(MPT_CHARSET_CODECVTUTF8)
#undef MPT_CHARSET_CODECVTUTF8
#endif
#if !defined(MPT_CHARSET_WIN32) && !defined(MPT_CHARSET_ICONV) && !defined(MPT_CHARSET_CODECVTUTF8) && !defined(MPT_CHARSET_INTERNAL)
#define MPT_CHARSET_INTERNAL
#endif
#if defined(MODPLUG_TRACKER) && !defined(MPT_ENABLE_DYNBIND)
#define MPT_ENABLE_DYNBIND
#endif
#if defined(MPT_ENABLE_LAME_DELAYLOAD) && !defined(MPT_ENABLE_DYNBIND)
#define MPT_ENABLE_DYNBIND
#endif
#if defined(MPT_ENABLE_MPG123_DELAYLOAD) && !defined(MPT_ENABLE_DYNBIND)
#define MPT_ENABLE_DYNBIND
#endif
#if defined(MPT_WITH_MEDIAFOUNDATION) && !defined(MPT_ENABLE_DYNBIND)
#define MPT_ENABLE_DYNBIND
#endif
#if (defined(MPT_WITH_MPG123) || defined(MPT_WITH_MINIMP3)) && !defined(MPT_ENABLE_MP3_SAMPLES)
#define MPT_ENABLE_MP3_SAMPLES
#endif
#if defined(ENABLE_TESTS)
#define MPT_ENABLE_FILEIO
#endif
#if !MPT_OS_WINDOWS && !defined(MPT_FILEREADER_STD_ISTREAM)
#define MPT_FILEREADER_STD_ISTREAM
#endif
#if defined(MODPLUG_TRACKER) && !defined(MPT_ENABLE_FILEIO)
#define MPT_ENABLE_FILEIO
#endif
#if defined(MODPLUG_TRACKER) && !defined(MPT_ENABLE_THREAD)
#define MPT_ENABLE_THREAD
#endif
#if defined(MPT_EXTERNAL_SAMPLES) && !defined(MPT_ENABLE_FILEIO)
#define MPT_ENABLE_FILEIO
#endif
#if defined(NO_PLUGINS)
#define NO_VST
#define NO_DMO
#endif
#if defined(MODPLUG_TRACKER) && !defined(MPT_BUILD_WINESUPPORT) && !defined(MPT_BUILD_WINESUPPORT_WRAPPER)
#ifndef MPT_NO_NAMESPACE
#define MPT_NO_NAMESPACE
#endif
#endif
#if defined(MPT_NO_NAMESPACE)
#ifdef OPENMPT_NAMESPACE
#undef OPENMPT_NAMESPACE
#endif
#define OPENMPT_NAMESPACE
#ifdef OPENMPT_NAMESPACE_BEGIN
#undef OPENMPT_NAMESPACE_BEGIN
#endif
#define OPENMPT_NAMESPACE_BEGIN
#ifdef OPENMPT_NAMESPACE_END
#undef OPENMPT_NAMESPACE_END
#endif
#define OPENMPT_NAMESPACE_END
#else
#ifndef OPENMPT_NAMESPACE
#define OPENMPT_NAMESPACE OpenMPT
#endif
#ifndef OPENMPT_NAMESPACE_BEGIN
#define OPENMPT_NAMESPACE_BEGIN namespace OPENMPT_NAMESPACE {
#endif
#ifndef OPENMPT_NAMESPACE_END
#define OPENMPT_NAMESPACE_END }
#endif
#endif
#if defined(MODPLUG_TRACKER)
#if MPT_OS_WINDOWS
#if !defined(MPT_BUILD_WINESUPPORT)
#ifndef MPT_MFC_FULL
#define _AFX_NO_MFC_CONTROLS_IN_DIALOGS
#endif #endif #endif #endif
#if MPT_OS_WINDOWS
#define WIN32_LEAN_AND_MEAN
#define NOMEMMGR
#define NOMINMAX
#define NOSERVICE
#define NOCOMM
#define NOKANJI
#define NOPROFILER
#define NOMCX
#define MMNODRV
#define MMNOAUX
#define MMNOMIXER
#define MMNOJOY
#define MMNOMCI
#define NOMMIDS
#define NONEWRIFF
#define NOJPEGDIB
#define NONEWIC
#define NOBITMAP
#endif
#if MPT_COMPILER_CLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#define __STDC_CONSTANT_MACROS
#define __STDC_LIMIT_MACROS
#define _USE_MATH_DEFINES
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#endif
#if MPT_COMPILER_CLANG
#pragma clang diagnostic pop
#endif
#if MPT_COMPILER_MSVC
#define VC_EXTRALEAN
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT 1
#ifndef _SCL_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#endif
#ifndef NO_WARN_MBCS_MFC_DEPRECATION
#define NO_WARN_MBCS_MFC_DEPRECATION
#endif
#pragma warning(disable:4355)
#pragma warning(disable:4512)
#pragma warning(error:4309)
#ifdef MPT_BUILD_ANALYZED
#pragma warning(disable:6326)
#endif
#endif
#if MPT_COMPILER_CLANG
#if defined(MODPLUG_TRACKER)
#pragma clang diagnostic ignored "-Wunused-local-typedef"
#endif
#endif
#if defined(MODPLUG_TRACKER)
#endif
#ifdef MPT_WITH_FLAC
#ifdef MPT_BUILD_MSVC_STATIC
#define FLAC__NO_DLL
#endif
#endif
#ifdef MPT_WITH_SMBPITCHSHIFT
#ifdef MPT_BUILD_MSVC_SHARED
#define SMBPITCHSHIFT_USE_DLL
#endif
#endif
#ifdef MPT_WITH_STBVORBIS
#define STB_VORBIS_HEADER_ONLY
#ifndef STB_VORBIS_NO_PULLDATA_API
#define STB_VORBIS_NO_PULLDATA_API
#endif
#ifndef STB_VORBIS_NO_STDIO
#define STB_VORBIS_NO_STDIO
#endif
#endif
#ifdef MPT_WITH_VORBISFILE
#ifndef OV_EXCLUDE_STATIC_CALLBACKS
#define OV_EXCLUDE_STATIC_CALLBACKS
#endif
#endif
#ifdef MPT_WITH_ZLIB
#ifdef MPT_BUILD_MSVC_SHARED
#define ZLIB_DLL
#endif
#endif