Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fplatform.h 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. //-----------------------------------------------------------------------------
  2. // Project : SDK Core
  3. //
  4. // Category : SDK Core Interfaces
  5. // Filename : pluginterfaces/base/fplatform.h
  6. // Created by : Steinberg, 01/2004
  7. // Description : Detect platform and set define
  8. //
  9. //-----------------------------------------------------------------------------
  10. // This file is part of a Steinberg SDK. It is subject to the license terms
  11. // in the LICENSE file found in the top-level directory of this distribution
  12. // and at www.steinberg.net/sdklicenses.
  13. // No part of the SDK, including this file, may be copied, modified, propagated,
  14. // or distributed except according to the terms contained in the LICENSE file.
  15. //-----------------------------------------------------------------------------
  16. #pragma once
  17. #define kLittleEndian 0
  18. #define kBigEndian 1
  19. #undef PLUGIN_API
  20. #undef WINDOWS
  21. #undef MAC
  22. //-----------------------------------------------------------------------------
  23. // WIN32 AND WIN64
  24. #if defined (_WIN32)
  25. #define WINDOWS 1
  26. #define BYTEORDER kLittleEndian
  27. #define COM_COMPATIBLE 1
  28. #define PLUGIN_API __stdcall
  29. #ifndef _CRT_SECURE_NO_WARNINGS
  30. #define _CRT_SECURE_NO_WARNINGS
  31. #endif
  32. #pragma warning (disable : 4244) // Conversion from 'type1' to 'type2', possible loss of data.
  33. #pragma warning (disable : 4250) // Inheritance via dominance is allowed
  34. #pragma warning (disable : 4996) // deprecated functions
  35. #pragma warning (3 : 4189) // local variable is initialized but not referenced
  36. #pragma warning (3 : 4238) // nonstandard extension used : class rvalue used as lvalue
  37. #if defined (_WIN64) // WIN64 only
  38. #define PLATFORM_64 1
  39. #endif
  40. #ifndef WIN32
  41. #define WIN32 1
  42. #endif
  43. #ifdef __cplusplus
  44. #define SMTG_CPP11 __cplusplus >= 201103L || _MSC_VER > 1600 || __INTEL_CXX11_MODE__
  45. #define SMTG_CPP11_STDLIBSUPPORT SMTG_CPP11
  46. #endif
  47. //-----------------------------------------------------------------------------
  48. // LINUX
  49. #elif __gnu_linux__
  50. #define LINUX 1
  51. #include <endian.h>
  52. #if __BYTE_ORDER == __LITTLE_ENDIAN
  53. #define BYTEORDER kLittleEndian
  54. #else
  55. #define BYTEORDER kBigEndian
  56. #endif
  57. #define COM_COMPATIBLE 0
  58. #define PLUGIN_API
  59. #define PTHREADS 1
  60. #if __LP64__
  61. #define PLATFORM_64 1
  62. #endif
  63. #ifdef __cplusplus
  64. #include <cstddef>
  65. #define SMTG_CPP11 (__cplusplus >= 201103L)
  66. #ifndef SMTG_CPP11
  67. #error unsupported compiler
  68. #endif
  69. #define SMTG_CPP11_STDLIBSUPPORT 1
  70. #endif
  71. //-----------------------------------------------------------------------------
  72. // Mac and iOS
  73. #elif __APPLE__
  74. #include <TargetConditionals.h>
  75. #define MAC 1
  76. #define PTHREADS 1
  77. #if !TARGET_OS_IPHONE
  78. #ifndef __CF_USE_FRAMEWORK_INCLUDES__
  79. #define __CF_USE_FRAMEWORK_INCLUDES__
  80. #endif
  81. #ifndef TARGET_API_MAC_CARBON
  82. #define TARGET_API_MAC_CARBON 1
  83. #endif
  84. #endif
  85. #if __LP64__
  86. #define PLATFORM_64 1
  87. #endif
  88. #if defined (__BIG_ENDIAN__)
  89. #define BYTEORDER kBigEndian
  90. #else
  91. #define BYTEORDER kLittleEndian
  92. #endif
  93. #define COM_COMPATIBLE 0
  94. #define PLUGIN_API
  95. #if !defined(__PLIST__) && !defined(SMTG_DISABLE_DEFAULT_DIAGNOSTICS)
  96. #ifdef __clang__
  97. #pragma GCC diagnostic ignored "-Wswitch-enum"
  98. #pragma GCC diagnostic ignored "-Wparentheses"
  99. #pragma GCC diagnostic ignored "-Wuninitialized"
  100. #if __clang_major__ >= 3
  101. #pragma GCC diagnostic ignored "-Wtautological-compare"
  102. #pragma GCC diagnostic ignored "-Wunused-value"
  103. #if __clang_major__ >= 4 || __clang_minor__ >= 1
  104. #pragma GCC diagnostic ignored "-Wswitch"
  105. #pragma GCC diagnostic ignored "-Wcomment"
  106. #endif
  107. #if __clang_major__ >= 5
  108. #pragma GCC diagnostic ignored "-Wunsequenced"
  109. #if __clang_minor__ >= 1
  110. #pragma GCC diagnostic ignored "-Wunused-const-variable"
  111. #endif
  112. #endif
  113. #endif
  114. #endif
  115. #endif
  116. #ifdef __cplusplus
  117. #include <cstddef>
  118. #define SMTG_CPP11 (__cplusplus >= 201103L || __INTEL_CXX11_MODE__)
  119. #if defined (_LIBCPP_VERSION) && SMTG_CPP11
  120. #define SMTG_CPP11_STDLIBSUPPORT 1
  121. #else
  122. #define SMTG_CPP11_STDLIBSUPPORT 0
  123. #endif
  124. #endif
  125. #else
  126. #pragma error unknown platform
  127. #endif
  128. //-----------------------------------------------------------------------------
  129. //-----------------------------------------------------------------------------
  130. #if SMTG_CPP11
  131. #define SMTG_OVERRIDE override
  132. #else
  133. #define SMTG_OVERRIDE
  134. #endif