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 #ifndef OS_LINUX
34 #define OS_LINUX
35 #endif
36#elif defined __EMSCRIPTEN__
37 #define OS_WEB
38#else
39 #error "No OS defined!"
40#endif
41
42#if defined(_WIN64) || defined(__LP64__)
43 #define ARCH_64BIT
44#endif
45
46#if __cplusplus == 201402L
47#define IPLUG_CPP14
48#endif
49
50//these two components of the c standard library are used thoughtout IPlug/WDL
51#include <cstring>
52#include <cstdlib>
53
54#ifdef PARAMS_MUTEX
55 #define ENTER_PARAMS_MUTEX mParams_mutex.Enter(); Trace(TRACELOC, "%s", "ENTER_PARAMS_MUTEX");
56 #define LEAVE_PARAMS_MUTEX mParams_mutex.Leave(); Trace(TRACELOC, "%s", "LEAVE_PARAMS_MUTEX");
57 #define ENTER_PARAMS_MUTEX_STATIC _this->mParams_mutex.Enter(); Trace(TRACELOC, "%s", "ENTER_PARAMS_MUTEX");
58 #define LEAVE_PARAMS_MUTEX_STATIC _this->mParams_mutex.Leave(); Trace(TRACELOC, "%s", "LEAVE_PARAMS_MUTEX");
59#else
60 #define ENTER_PARAMS_MUTEX
61 #define LEAVE_PARAMS_MUTEX
62 #define ENTER_PARAMS_MUTEX_STATIC
63 #define LEAVE_PARAMS_MUTEX_STATIC
64#endif
65
66#define BEGIN_IPLUG_NAMESPACE namespace iplug {
67#define END_IPLUG_NAMESPACE }
68
69#define BEGIN_IGRAPHICS_NAMESPACE namespace igraphics {
70#define END_IGRAPHICS_NAMESPACE }
71
72namespace iplug {namespace igraphics {}};
73
74#if defined IGRAPHICS_GLES2 || IGRAPHICS_GLES3 || IGRAPHICS_GL2 || defined IGRAPHICS_GL3
75 #define IGRAPHICS_GL
76#endif