iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
IPlugPlatform.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the iPlug 2 library. Copyright (C) the iPlug 2 developers.
5
6 See LICENSE.txt for more info.
7
8 ==============================================================================
9*/
10
11#pragma once
12
18#ifdef _WIN32
19 #define OS_WIN
20 // Include WDL's UTF-8 wrappers early so #define fopen fopenUTF8 is active
21 // before any third-party headers (like nanosvg.h) use fopen
22 #include "win32_utf8.h"
23#elif defined __APPLE__
24 #include <TargetConditionals.h>
25 #if TARGET_OS_IPHONE
26 #define OS_IOS
27 #elif TARGET_OS_MAC
28 #define OS_MAC
29 #elif TARGET_OS_VISION
30 #define OS_VISION
31 #endif
32#elif defined __linux || defined __linux__ || defined linux
33 #define OS_LINUX
34#elif defined EMSCRIPTEN
35 #define OS_WEB
36#else
37 #error "No OS defined!"
38#endif
39
40#if defined(_WIN64) || defined(__LP64__)
41 #define ARCH_64BIT
42#endif
43
44#if __cplusplus == 201402L
45#define IPLUG_CPP14
46#endif
47
48//these two components of the c standard library are used thoughtout IPlug/WDL
49#include <cstring>
50#include <cstdlib>
51
52#ifdef PARAMS_MUTEX
53 #define ENTER_PARAMS_MUTEX mParams_mutex.Enter(); Trace(TRACELOC, "%s", "ENTER_PARAMS_MUTEX");
54 #define LEAVE_PARAMS_MUTEX mParams_mutex.Leave(); Trace(TRACELOC, "%s", "LEAVE_PARAMS_MUTEX");
55 #define ENTER_PARAMS_MUTEX_STATIC _this->mParams_mutex.Enter(); Trace(TRACELOC, "%s", "ENTER_PARAMS_MUTEX");
56 #define LEAVE_PARAMS_MUTEX_STATIC _this->mParams_mutex.Leave(); Trace(TRACELOC, "%s", "LEAVE_PARAMS_MUTEX");
57#else
58 #define ENTER_PARAMS_MUTEX
59 #define LEAVE_PARAMS_MUTEX
60 #define ENTER_PARAMS_MUTEX_STATIC
61 #define LEAVE_PARAMS_MUTEX_STATIC
62#endif
63
64#define BEGIN_IPLUG_NAMESPACE namespace iplug {
65#define END_IPLUG_NAMESPACE }
66
67#define BEGIN_IGRAPHICS_NAMESPACE namespace igraphics {
68#define END_IGRAPHICS_NAMESPACE }
69
70namespace iplug {namespace igraphics {}};
71
72#if defined IGRAPHICS_GLES2 || IGRAPHICS_GLES3 || IGRAPHICS_GL2 || defined IGRAPHICS_GL3
73 #define IGRAPHICS_GL
74#endif