BuildSettings.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. /*
  2. * BuildSettings.h
  3. * ---------------
  4. * Purpose: Global, user settable compile time flags (and some global system header configuration)
  5. * Notes : (currently none)
  6. * Authors: OpenMPT Devs
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #pragma once
  10. #include "mpt/base/detect_compiler.hpp"
  11. #include "mpt/base/detect_os.hpp"
  12. #include "mpt/base/detect_quirks.hpp"
  13. // set windows version early so that we can deduce dependencies from SDK version
  14. #if MPT_OS_WINDOWS
  15. #if !defined(WINVER) && !defined(_WIN32_WINDOWS) && !defined(_WIN32_WINNT)
  16. #if MPT_COMPILER_CLANG
  17. #pragma clang diagnostic push
  18. #pragma clang diagnostic ignored "-Wreserved-id-macro"
  19. #endif // MPT_COMPILER_CLANG
  20. #define _WIN32_WINNT 0x0601 // _WIN32_WINNT_WIN7
  21. #if MPT_COMPILER_CLANG
  22. #pragma clang diagnostic pop
  23. #endif // MPT_COMPILER_CLANG
  24. #endif
  25. #ifndef WINVER
  26. #if defined(_WIN32_WINNT)
  27. #define WINVER _WIN32_WINNT
  28. #elif defined(_WIN32_WINDOWS)
  29. #define WINVER _WIN32_WINDOWS
  30. #endif
  31. #endif
  32. #endif // MPT_OS_WINDOWS
  33. #if defined(MODPLUG_TRACKER) && defined(LIBOPENMPT_BUILD)
  34. #error "either MODPLUG_TRACKER or LIBOPENMPT_BUILD has to be defined"
  35. #elif defined(MODPLUG_TRACKER)
  36. // nothing
  37. #define MPT_INLINE_NS mptx
  38. #elif defined(LIBOPENMPT_BUILD)
  39. // nothing
  40. #define MPT_INLINE_NS mpt_libopenmpt
  41. #else
  42. #error "either MODPLUG_TRACKER or LIBOPENMPT_BUILD has to be defined"
  43. #endif // MODPLUG_TRACKER || LIBOPENMPT_BUILD
  44. #if defined(LIBOPENMPT_BUILD)
  45. // Fixup dependencies which are currently not used in libopenmpt itself,
  46. // however might be set by some build systems like autotools anyway for simplicity.
  47. #ifdef MPT_WITH_FLAC
  48. #undef MPT_WITH_FLAC
  49. #endif
  50. #endif // LIBOPENMPT_BUILD
  51. // Dependencies from the MSVC build system
  52. #if defined(MPT_BUILD_MSVC)
  53. // This section defines which dependencies are available when building with
  54. // MSVC. Other build systems provide MPT_WITH_* macros via command-line or other
  55. // means.
  56. // OpenMPT and libopenmpt should compile and run successfully (albeit with
  57. // reduced functionality) with any or all dependencies missing/disabled.
  58. // The defaults match the bundled third-party libraries with the addition of
  59. // ASIO and VST SDKs.
  60. #if defined(MODPLUG_TRACKER)
  61. #if MPT_OS_WINDOWS
  62. #if !defined(MPT_BUILD_WINESUPPORT) && !defined(MPT_BUILD_UPDATESIGNTOOL)
  63. #define MPT_WITH_MFC
  64. #endif // !MPT_BUILD_WINESUPPORT && !MPT_BUILD_UPDATESIGNTOOL
  65. #endif // MPT_OS_WINDOWS
  66. // OpenMPT-only dependencies
  67. #define MPT_WITH_ANCIENT
  68. #if !defined(MPT_BUILD_RETRO) && !MPT_COMPILER_CLANG && !MPT_MSVC_BEFORE(2019,0)
  69. // disabled for VS2017 because of multiple initialization of inline variables
  70. // https://developercommunity.visualstudio.com/t/static-inline-variable-gets-destroyed-multiple-tim/297876
  71. #define MPT_WITH_ASIO
  72. #endif
  73. #if defined(MPT_BUILD_RETRO)
  74. #define MPT_WITH_DIRECTSOUND
  75. #endif
  76. #define MPT_WITH_DMO
  77. #define MPT_WITH_LAME
  78. #define MPT_WITH_LHASA
  79. #define MPT_WITH_MINIZIP
  80. #define MPT_WITH_NLOHMANNJSON
  81. #define MPT_WITH_OPUS
  82. #define MPT_WITH_OPUSENC
  83. #define MPT_WITH_OPUSFILE
  84. #define MPT_WITH_PORTAUDIO
  85. //#define MPT_WITH_PULSEAUDIO
  86. //#define MPT_WITH_PULSEAUDIOSIMPLE
  87. #define MPT_WITH_RTAUDIO
  88. #define MPT_WITH_SMBPITCHSHIFT
  89. #define MPT_WITH_UNRAR
  90. #define MPT_WITH_VORBISENC
  91. #define MPT_WITH_VST
  92. // OpenMPT and libopenmpt dependencies (not for openmp123, player plugins or examples)
  93. //#define MPT_WITH_DL
  94. #define MPT_WITH_FLAC
  95. //#define MPT_WITH_LTDL
  96. #if MPT_OS_WINDOWS
  97. #if (_WIN32_WINNT >= 0x0601)
  98. #define MPT_WITH_MEDIAFOUNDATION
  99. #endif
  100. #endif
  101. //#define MPT_WITH_MINIMP3
  102. //#define MPT_WITH_MINIZ
  103. #define MPT_WITH_MPG123
  104. #define MPT_WITH_OGG
  105. //#define MPT_WITH_STBVORBIS
  106. #define MPT_WITH_VORBIS
  107. #define MPT_WITH_VORBISFILE
  108. #if MPT_OS_WINDOWS
  109. #if (_WIN32_WINNT >= 0x0A00)
  110. #define MPT_WITH_WINDOWS10
  111. #endif
  112. #endif
  113. #define MPT_WITH_ZLIB
  114. #endif // MODPLUG_TRACKER
  115. #if defined(LIBOPENMPT_BUILD)
  116. // OpenMPT and libopenmpt dependencies (not for openmp123, player plugins or examples)
  117. #if defined(LIBOPENMPT_BUILD_FULL) && defined(LIBOPENMPT_BUILD_SMALL)
  118. #error "only one of LIBOPENMPT_BUILD_FULL or LIBOPENMPT_BUILD_SMALL can be defined"
  119. #endif // LIBOPENMPT_BUILD_FULL && LIBOPENMPT_BUILD_SMALL
  120. #if defined(LIBOPENMPT_BUILD_SMALL)
  121. //#define MPT_WITH_DL
  122. //#define MPT_WITH_FLAC
  123. //#define MPT_WITH_LTDL
  124. //#define MPT_WITH_MEDIAFOUNDATION
  125. #define MPT_WITH_MINIMP3
  126. #define MPT_WITH_MINIZ
  127. //#define MPT_WITH_MPG123
  128. //#define MPT_WITH_OGG
  129. #define MPT_WITH_STBVORBIS
  130. //#define MPT_WITH_VORBIS
  131. //#define MPT_WITH_VORBISFILE
  132. //#define MPT_WITH_ZLIB
  133. #else // !LIBOPENMPT_BUILD_SMALL
  134. //#define MPT_WITH_DL
  135. //#define MPT_WITH_FLAC
  136. //#define MPT_WITH_LTDL
  137. //#define MPT_WITH_MEDIAFOUNDATION
  138. //#define MPT_WITH_MINIMP3
  139. //#define MPT_WITH_MINIZ
  140. #define MPT_WITH_MPG123
  141. #define MPT_WITH_OGG
  142. //#define MPT_WITH_STBVORBIS
  143. #define MPT_WITH_VORBIS
  144. #define MPT_WITH_VORBISFILE
  145. #define MPT_WITH_ZLIB
  146. #endif // LIBOPENMPT_BUILD_SMALL
  147. #endif // LIBOPENMPT_BUILD
  148. #endif // MPT_BUILD_MSVC
  149. #if defined(MPT_BUILD_XCODE)
  150. #if defined(MODPLUG_TRACKER)
  151. // n/a
  152. #endif // MODPLUG_TRACKER
  153. #if defined(LIBOPENMPT_BUILD)
  154. //#define MPT_WITH_DL
  155. //#define MPT_WITH_FLAC
  156. //#define MPT_WITH_LTDL
  157. //#define MPT_WITH_MEDIAFOUNDATION
  158. //#define MPT_WITH_MINIMP3
  159. //#define MPT_WITH_MINIZ
  160. #define MPT_WITH_MPG123
  161. #define MPT_WITH_OGG
  162. //#define MPT_WITH_STBVORBIS
  163. #define MPT_WITH_VORBIS
  164. #define MPT_WITH_VORBISFILE
  165. #define MPT_WITH_ZLIB
  166. #endif // LIBOPENMPT_BUILD
  167. #endif // MPT_BUILD_XCODE
  168. #if defined(MODPLUG_TRACKER)
  169. // Enable built-in test suite.
  170. #if defined(MPT_BUILD_DEBUG) || defined(MPT_BUILD_CHECKED)
  171. #define ENABLE_TESTS
  172. #endif
  173. // Disable any file saving functionality (not really useful except for the player library)
  174. //#define MODPLUG_NO_FILESAVE
  175. // Disable any debug logging
  176. #if !defined(MPT_BUILD_DEBUG) && !defined(MPT_BUILD_CHECKED) && !defined(MPT_BUILD_WINESUPPORT)
  177. #define MPT_LOG_GLOBAL_LEVEL_STATIC
  178. #define MPT_LOG_GLOBAL_LEVEL 0
  179. #endif
  180. // Enable all individual logging macros and MPT_LOG calls
  181. //#define MPT_ALL_LOGGING
  182. // Disable all runtime asserts
  183. #if !defined(MPT_BUILD_DEBUG) && !defined(MPT_BUILD_CHECKED) && !defined(MPT_BUILD_WINESUPPORT)
  184. #define NO_ASSERTS
  185. #endif
  186. // Enable global ComponentManager
  187. #define MPT_COMPONENT_MANAGER 1
  188. // Support for externally linked samples e.g. in MPTM files
  189. #define MPT_EXTERNAL_SAMPLES
  190. // Support mpt::ChartsetLocale
  191. #define MPT_ENABLE_CHARSET_LOCALE
  192. // Use architecture-specific intrinsics
  193. #define MPT_ENABLE_ARCH_INTRINSICS
  194. #if !defined(MPT_BUILD_RETRO)
  195. #define MPT_ENABLE_UPDATE
  196. #endif // !MPT_BUILD_RETRO
  197. // Disable unarchiving support
  198. //#define NO_ARCHIVE_SUPPORT
  199. // Disable the built-in reverb effect
  200. //#define NO_REVERB
  201. // Disable built-in miscellaneous DSP effects (surround, mega bass, noise reduction)
  202. //#define NO_DSP
  203. // Disable the built-in equalizer.
  204. //#define NO_EQ
  205. // Disable the built-in automatic gain control
  206. //#define NO_AGC
  207. // (HACK) Define to build without any plugin support
  208. //#define NO_PLUGINS
  209. #endif // MODPLUG_TRACKER
  210. #if defined(LIBOPENMPT_BUILD)
  211. #if (defined(_DEBUG) || defined(DEBUG)) && !defined(MPT_BUILD_DEBUG)
  212. #define MPT_BUILD_DEBUG
  213. #endif
  214. #if defined(LIBOPENMPT_BUILD_TEST)
  215. #define ENABLE_TESTS
  216. #else
  217. #define MODPLUG_NO_FILESAVE
  218. #endif
  219. #if defined(MPT_BUILD_ANALZYED) || defined(MPT_BUILD_DEBUG) || defined(MPT_BUILD_CHECKED) || defined(ENABLE_TESTS)
  220. // enable asserts
  221. #else
  222. #define NO_ASSERTS
  223. #endif
  224. //#define MPT_ALL_LOGGING
  225. #define MPT_COMPONENT_MANAGER 0
  226. //#define MPT_EXTERNAL_SAMPLES
  227. #if defined(ENABLE_TESTS) || defined(MPT_BUILD_HACK_ARCHIVE_SUPPORT)
  228. #define MPT_ENABLE_CHARSET_LOCALE
  229. #else
  230. //#define MPT_ENABLE_CHARSET_LOCALE
  231. #endif
  232. // Do not use architecture-specifid intrinsics in library builds. There is just about no codepath which would use it anyway.
  233. //#define MPT_ENABLE_ARCH_INTRINSICS
  234. #if defined(MPT_BUILD_HACK_ARCHIVE_SUPPORT)
  235. //#define NO_ARCHIVE_SUPPORT
  236. #else
  237. #define NO_ARCHIVE_SUPPORT
  238. #endif
  239. //#define NO_REVERB
  240. #define NO_DSP
  241. #define NO_EQ
  242. #define NO_AGC
  243. //#define NO_PLUGINS
  244. #endif // LIBOPENMPT_BUILD
  245. #if MPT_OS_WINDOWS
  246. #ifndef MPT_ENABLE_CHARSET_LOCALE
  247. #define MPT_ENABLE_CHARSET_LOCALE
  248. #endif
  249. #elif MPT_OS_LINUX
  250. #elif MPT_OS_ANDROID
  251. #elif MPT_OS_EMSCRIPTEN
  252. #elif MPT_OS_MACOSX_OR_IOS
  253. #elif MPT_OS_DJGPP
  254. #endif
  255. #if (MPT_COMPILER_MSVC && !defined(MPT_USTRING_MODE_UTF8_FORCE)) || defined(MODPLUG_TRACKER)
  256. // Use wide strings for MSVC because this is the native encoding on
  257. // microsoft platforms.
  258. // mpt::ToWString, mpt::wfmt, ConvertStrTo<std::wstring>
  259. // Required by the tracker to ease interfacing with WinAPI.
  260. // Required by MPT_USTRING_MODE_WIDE to ease type tunneling in mpt::format.
  261. #define MPT_WSTRING_FORMAT 1
  262. #else
  263. #define MPT_WSTRING_FORMAT 0
  264. #endif
  265. #if (MPT_COMPILER_MSVC && !defined(MPT_USTRING_MODE_UTF8_FORCE)) || MPT_OS_WINDOWS || MPT_WSTRING_FORMAT
  266. // mpt::ToWide
  267. // Required on Windows by mpt::PathString.
  268. // Required by MPT_USTRING_MODE_WIDE as they share the conversion functions.
  269. // Required by MPT_WSTRING_FORMAT because of std::string<->std::wstring conversion in mpt::ToAString and mpt::ToWString.
  270. #define MPT_WSTRING_CONVERT 1
  271. #else
  272. #define MPT_WSTRING_CONVERT 0
  273. #endif
  274. // fixing stuff up
  275. #if defined(MPT_BUILD_ANALYZED) || defined(MPT_BUILD_CHECKED)
  276. #ifdef NO_ASSERTS
  277. #undef NO_ASSERTS // static or dynamic analyzers want assertions on
  278. #endif
  279. #endif
  280. #if defined(MPT_BUILD_FUZZER)
  281. #ifndef MPT_FUZZ_TRACKER
  282. #define MPT_FUZZ_TRACKER
  283. #endif
  284. #endif
  285. #if defined(MPT_ENABLE_ARCH_INTRINSICS)
  286. #if MPT_COMPILER_MSVC && defined(_M_IX86)
  287. #define MPT_ENABLE_ARCH_X86
  288. #define MPT_ENABLE_ARCH_INTRINSICS_SSE
  289. #define MPT_ENABLE_ARCH_INTRINSICS_SSE2
  290. #elif MPT_COMPILER_MSVC && defined(_M_X64)
  291. #define MPT_ENABLE_ARCH_AMD64
  292. #define MPT_ENABLE_ARCH_INTRINSICS_SSE
  293. #define MPT_ENABLE_ARCH_INTRINSICS_SSE2
  294. #endif // arch
  295. #endif // MPT_ENABLE_ARCH_INTRINSICS
  296. #if defined(ENABLE_TESTS) && defined(MODPLUG_NO_FILESAVE)
  297. #undef MODPLUG_NO_FILESAVE // tests recommend file saving
  298. #endif
  299. #if defined(MPT_WITH_ZLIB) && defined(MPT_WITH_MINIZ)
  300. // Only one deflate implementation should be used. Prefer zlib.
  301. #undef MPT_WITH_MINIZ
  302. #endif
  303. #if !MPT_OS_WINDOWS && defined(MPT_WITH_MEDIAFOUNDATION)
  304. #undef MPT_WITH_MEDIAFOUNDATION // MediaFoundation requires Windows
  305. #endif
  306. #if !MPT_COMPILER_MSVC && !MPT_COMPILER_CLANG && defined(MPT_WITH_MEDIAFOUNDATION)
  307. #undef MPT_WITH_MEDIAFOUNDATION // MediaFoundation requires MSVC or Clang due to ATL (no MinGW support)
  308. #endif
  309. #if (defined(MPT_WITH_MPG123) || defined(MPT_WITH_MINIMP3)) && !defined(MPT_ENABLE_MP3_SAMPLES)
  310. #define MPT_ENABLE_MP3_SAMPLES
  311. #endif
  312. #if defined(ENABLE_TESTS)
  313. #define MPT_ENABLE_FILEIO // Test suite requires PathString for file loading.
  314. #endif
  315. #if defined(MODPLUG_TRACKER) && !defined(MPT_ENABLE_FILEIO)
  316. #define MPT_ENABLE_FILEIO // Tracker requires disk file io
  317. #endif
  318. #if defined(MPT_EXTERNAL_SAMPLES) && !defined(MPT_ENABLE_FILEIO)
  319. #define MPT_ENABLE_FILEIO // External samples require disk file io
  320. #endif
  321. #if defined(NO_PLUGINS)
  322. // Any plugin type requires NO_PLUGINS to not be defined.
  323. #if defined(MPT_WITH_VST)
  324. #undef MPT_WITH_VST
  325. #endif
  326. #endif
  327. #if defined(MODPLUG_TRACKER) && !defined(MPT_BUILD_WINESUPPORT) && !defined(MPT_BUILD_WINESUPPORT_WRAPPER)
  328. #ifndef MPT_NO_NAMESPACE
  329. #define MPT_NO_NAMESPACE
  330. #endif
  331. #endif
  332. #if defined(MPT_NO_NAMESPACE)
  333. #ifdef OPENMPT_NAMESPACE
  334. #undef OPENMPT_NAMESPACE
  335. #endif
  336. #define OPENMPT_NAMESPACE
  337. #ifdef OPENMPT_NAMESPACE_BEGIN
  338. #undef OPENMPT_NAMESPACE_BEGIN
  339. #endif
  340. #define OPENMPT_NAMESPACE_BEGIN
  341. #ifdef OPENMPT_NAMESPACE_END
  342. #undef OPENMPT_NAMESPACE_END
  343. #endif
  344. #define OPENMPT_NAMESPACE_END
  345. #else
  346. #ifndef OPENMPT_NAMESPACE
  347. #define OPENMPT_NAMESPACE OpenMPT
  348. #endif
  349. #ifndef OPENMPT_NAMESPACE_BEGIN
  350. #define OPENMPT_NAMESPACE_BEGIN namespace OPENMPT_NAMESPACE {
  351. #endif
  352. #ifndef OPENMPT_NAMESPACE_END
  353. #define OPENMPT_NAMESPACE_END }
  354. #endif
  355. #endif
  356. // platform configuration
  357. #ifdef MPT_WITH_MFC
  358. //#define MPT_MFC_FULL // use full MFC, including MFC controls
  359. #define _CSTRING_DISABLE_NARROW_WIDE_CONVERSION
  360. #endif // MPT_WITH_MFC
  361. #if defined(MODPLUG_TRACKER)
  362. #if MPT_OS_WINDOWS
  363. #if !defined(MPT_BUILD_WINESUPPORT)
  364. #ifndef MPT_MFC_FULL
  365. #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS // Do not include support for MFC controls in dialogs (reduces binary bloat; remove this #define if you want to use MFC controls)
  366. #endif // !MPT_MFC_FULL
  367. #endif // !MPT_BUILD_WINESUPPORT
  368. #endif // MPT_OS_WINDOWS
  369. #endif // MODPLUG_TRACKER
  370. #if MPT_OS_WINDOWS
  371. #define WIN32_LEAN_AND_MEAN
  372. // windows.h excludes
  373. #define NOMEMMGR // GMEM_*, LMEM_*, GHND, LHND, associated routines
  374. #ifndef NOMINMAX
  375. #define NOMINMAX // Macros min(a,b) and max(a,b)
  376. #endif
  377. #define NOSERVICE // All Service Controller routines, SERVICE_ equates, etc.
  378. #define NOCOMM // COMM driver routines
  379. #define NOKANJI // Kanji support stuff.
  380. #define NOPROFILER // Profiler interface.
  381. #define NOMCX // Modem Configuration Extensions
  382. // mmsystem.h excludes
  383. #define MMNODRV
  384. //#define MMNOSOUND
  385. //#define MMNOWAVE
  386. //#define MMNOMIDI
  387. #define MMNOAUX
  388. #define MMNOMIXER
  389. //#define MMNOTIMER
  390. #define MMNOJOY
  391. #define MMNOMCI
  392. //#define MMNOMMIO
  393. //#define MMNOMMSYSTEM
  394. // mmreg.h excludes
  395. #define NOMMIDS
  396. //#define NONEWWAVE
  397. #define NONEWRIFF
  398. #define NOJPEGDIB
  399. #define NONEWIC
  400. #define NOBITMAP
  401. #endif // MPT_OS_WINDOWS
  402. // stdlib configuration
  403. #if MPT_COMPILER_CLANG
  404. #pragma clang diagnostic push
  405. #pragma clang diagnostic ignored "-Wreserved-id-macro"
  406. #endif
  407. #define __STDC_CONSTANT_MACROS
  408. #define __STDC_FORMAT_MACROS
  409. #define __STDC_LIMIT_MACROS
  410. #define _USE_MATH_DEFINES
  411. #ifndef _FILE_OFFSET_BITS
  412. #define _FILE_OFFSET_BITS 64
  413. #endif
  414. #if MPT_COMPILER_CLANG
  415. #pragma clang diagnostic pop
  416. #endif
  417. // compiler configuration
  418. #if MPT_COMPILER_MSVC
  419. #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
  420. #pragma warning(default:4800) // Implicit conversion from 'int' to bool. Possible information loss
  421. #pragma warning(disable:4355) // 'this' : used in base member initializer list
  422. // happens for immutable classes (i.e. classes containing const members)
  423. #pragma warning(disable:4512) // assignment operator could not be generated
  424. #pragma warning(error:4309) // Treat "truncation of constant value"-warning as error.
  425. #pragma warning(error:4463) // Treat overflow; assigning value to bit-field that can only hold values from low_value to high_value"-warning as error.
  426. #ifdef MPT_BUILD_ANALYZED
  427. // Disable Visual Studio static analyzer warnings that generate too many false positives in VS2010.
  428. //#pragma warning(disable:6246)
  429. //#pragma warning(disable:6262)
  430. #pragma warning(disable:6297) // 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value.
  431. #pragma warning(disable:6326) // Potential comparison of a constant with another constant
  432. //#pragma warning(disable:6385)
  433. //#pragma warning(disable:6386)
  434. #endif // MPT_BUILD_ANALYZED
  435. #endif // MPT_COMPILER_MSVC
  436. #if MPT_COMPILER_CLANG
  437. #if defined(MPT_BUILD_MSVC)
  438. #pragma clang diagnostic warning "-Wimplicit-fallthrough"
  439. #endif // MPT_BUILD_MSVC
  440. #if defined(MODPLUG_TRACKER)
  441. #pragma clang diagnostic ignored "-Wunused-local-typedef"
  442. #endif // MODPLUG_TRACKER
  443. #endif // MPT_COMPILER_CLANG
  444. // standard library quirks
  445. // third-party library configuration
  446. #if MPT_OS_WINDOWS
  447. #ifndef UNICODE
  448. #define MPT_CHECK_WINDOWS_IGNORE_WARNING_NO_UNICODE
  449. #endif // !UNICODE
  450. #endif // MPT_OS_WINDOWS
  451. #ifdef MPT_WITH_ANCIENT
  452. #ifdef MPT_BUILD_MSVC_SHARED
  453. #define ANCIENT_API_DECLSPEC_DLLIMPORT
  454. #endif
  455. #endif
  456. #ifdef MPT_WITH_FLAC
  457. #ifdef MPT_BUILD_MSVC_STATIC
  458. #define FLAC__NO_DLL
  459. #endif
  460. #endif
  461. #ifdef MPT_WITH_SMBPITCHSHIFT
  462. #ifdef MPT_BUILD_MSVC_SHARED
  463. #define SMBPITCHSHIFT_USE_DLL
  464. #endif
  465. #endif
  466. #ifdef MPT_WITH_STBVORBIS
  467. #define STB_VORBIS_HEADER_ONLY
  468. #ifndef STB_VORBIS_NO_PULLDATA_API
  469. #define STB_VORBIS_NO_PULLDATA_API
  470. #endif
  471. #ifndef STB_VORBIS_NO_STDIO
  472. #define STB_VORBIS_NO_STDIO
  473. #endif
  474. #endif
  475. #ifdef MPT_WITH_VORBISFILE
  476. #ifndef OV_EXCLUDE_STATIC_CALLBACKS
  477. #define OV_EXCLUDE_STATIC_CALLBACKS
  478. #endif
  479. #endif
  480. #ifdef MPT_WITH_ZLIB
  481. #ifdef MPT_BUILD_MSVC_SHARED
  482. #define ZLIB_DLL
  483. #endif
  484. #endif
  485. #ifdef __cplusplus
  486. #include "mpt/base/namespace.hpp"
  487. OPENMPT_NAMESPACE_BEGIN
  488. namespace mpt {
  489. #ifndef MPT_NO_NAMESPACE
  490. using namespace ::mpt;
  491. #endif
  492. } // namespace mpt
  493. OPENMPT_NAMESPACE_END
  494. #endif