346ab441862cb0c9075c968cdcc4b532ed32817e
[ardour.git] / libs / backends / wavesaudio / wavesapi / BasicTypes / WUDefines.h
1 #ifndef __WUDefines_h__
2     #define __WUDefines_h__
3
4 /*Copy to include
5 #include "BasicTypes/WUDefines.h"
6 */
7
8 #include "1.0/WavesPublicAPI_Defines.h"
9
10 // When changing wvNS value also do the same change in Objective_C_MangledNames.h
11 // because CWSAUCocoaViewFactoryAsString is hard coded there
12 #define wvNS wvWavesV9_3 
13 #ifdef __MACOS__
14     #define ObjCNameSpace(__className__) wvWavesV9_3_ ## __className__
15 #endif
16
17 #ifdef INSIDE_NETSHELL
18     #define DllExport
19 #else
20     #define DllExport   WPAPI_DllExport 
21 #endif
22
23 #define __CDECL     __WPAPI_CDECL
24 #define __STDCALL   __WPAPI_STDCALL
25
26
27 #ifndef NULL
28     #define NULL (0)
29 #endif
30
31 #ifndef nil
32     #define nil NULL
33 #endif
34
35 #define PASCAL_MAC_ONLY #error do not use PASCAL_MAC_ONLY. See defintions in WavesFTT.h for replacment.
36 #define CALLCON #error do not use CALLCON. See defintions in WavesFTT.h for replacment.
37 #define FUNCEXP #error do not use FUNCEXP. See defintions in WavesFTT.h for replacment.
38
39 #define WUNUSED_PARAM(__SOME_UNUSED_PARAM__) ((void)__SOME_UNUSED_PARAM__)
40
41 #ifdef __MACOS__
42     const char* const  OS_NAME = "Mac";
43
44     #define WIN_ONLY(__Something_only_for_windows__)
45     #define MAC_ONLY(__Something_only_for_mac__) __Something_only_for_mac__
46     
47     #if defined(i386) || defined(__i386) || defined(__i386__)
48         #define kNumArchBits 32
49     #endif
50     #if defined(__x86_64) || defined(__x86_64__)
51         #define kNumArchBits 64
52     #endif 
53
54     #if (__i386 || __x86_64) && !defined(__LITTLE_ENDIAN__)
55         #define __LITTLE_ENDIAN__ 
56     #endif
57     #if !(__i386 || __x86_64) && !defined(__BIG_ENDIAN__)
58         #define __BIG_ENDIAN__
59     #endif
60     #ifdef __GNUC__
61         #define STD_EXCEPT_WIN std
62         #define FAR 
63         #define PASCAL 
64         // #define HINSTANCE void*
65         #define WINAPI
66     
67     #else
68     
69         #define DllExport_WinOnly
70         #define STD_EXCEPT_WIN std
71         #define FAR 
72         #define PASCAL          // windows' pascal
73         #define HINSTANCE void*
74         #define WINAPI
75
76     #endif
77     #define THROW_SPEC(THROW_OBJ) throw (THROW_OBJ)
78
79     #define WUNUSED_PARAM_ON_MAC(__SOME_UNUSED_PARAM__) WUNUSED_PARAM(__SOME_UNUSED_PARAM__)
80     #define WUNUSED_PARAM_ON_WIN(__SOME_UNUSED_PARAM__)
81 #endif
82
83
84 #ifdef _WINDOWS
85     const char* const  OS_NAME = "Win";
86
87     #define WIN_ONLY(__Something_only_for_windows__) __Something_only_for_windows__
88     #define MAC_ONLY(__Something_only_for_mac__)
89
90     #if defined(_M_X64)
91         #define kNumArchBits 64
92     #else // not sure what are the VisualStudio macros for 32 bits
93         #define kNumArchBits 32
94     #endif
95
96     #define DllExport_WinOnly DllExport     // help solve window specific link errors
97     #define STD_EXCEPT_WIN
98
99     #if !defined(__MINGW64__)
100                 #define round(x) (floor(x+0.5))
101         #endif
102
103     #define __LITTLE_ENDIAN__
104     #define THROW_SPEC(THROW_OBJ) throw (...)
105
106     #define WUNUSED_PARAM_ON_MAC(__SOME_UNUSED_PARAM__)
107     #define WUNUSED_PARAM_ON_WIN(__SOME_UNUSED_PARAM__) WUNUSED_PARAM(__SOME_UNUSED_PARAM__)
108
109 #endif 
110
111 #ifdef __linux__
112     const char* const  OS_NAME = "Linux";
113
114     #define WIN_ONLY(__Something_only_for_windows__)
115     #define MAC_ONLY(__Something_only_for_mac__)
116
117     #define DllExport_WinOnly
118     #define STD_EXCEPT_WIN std
119     #define FAR 
120     #define PASCAL 
121     // #define HINSTANCE void*
122     #define WINAPI
123     #if __i386 && !defined(__LITTLE_ENDIAN__)
124         #define __LITTLE_ENDIAN__ 
125     #endif
126     #if !__i386 && !defined(__BIG_ENDIAN__)
127         #define __BIG_ENDIAN__
128     #endif
129     #define THROW_SPEC(THROW_OBJ) throw (THROW_OBJ)
130     
131     #if defined(__x86_64) || defined(__LP64__)
132         #error "64 bit not suported yet on linux"
133     #else
134         #define kNumArchBits 32
135     #endif
136 #endif
137
138 #ifndef _WU_DECL
139     #define _WU_DECL __CDECL // the default is calling model is cdecl, but you can also set this macro from the outside to something different 
140 #endif
141
142 #ifndef _XML_DECL
143     #define _XML_DECL __CDECL // the default is calling model is cdecl, but you can also set this macro from the outside to something different 
144 #endif
145
146 #ifndef kNumArchBits
147     #error Macro kNumArchBits was not defined
148 #endif
149
150 #if kNumArchBits == 64
151     const char* const kNumArchBits_c_str = "64";
152 #endif
153 #if kNumArchBits == 32
154     const char* const kNumArchBits_c_str = "32";
155 #endif
156
157 #endif //__WUDefines_h__