Version
menu_open
link
Target Platform(s):
Wwise SDK 2021.1.14
AkTypes.h
Go to the documentation of this file.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Version: v2021.1.14 Build: 6590
25  Copyright (c) 2006-2023 Audiokinetic Inc.
26 *******************************************************************************/
27 
28 // AkTypes.h
29 
30 /// \file
31 /// Data type definitions.
32 
33 #ifndef _AK_DATA_TYPES_PLATFORM_H_
34 #define _AK_DATA_TYPES_PLATFORM_H_
35 
36 #include <stdint.h>
37 #include <limits.h>
38 
39 #ifndef __cplusplus
40  #include <wchar.h> // wchar_t not a built-in type in C
41 #endif
42 
43 #define AK_WIN ///< Compiling for Windows
44 
45 #if defined _M_IX86
46  #define AK_CPU_X86 ///< Compiling for 32-bit x86 CPU
47 #elif defined _M_AMD64
48  #define AK_CPU_X86_64 ///< Compiling for 64-bit x86 CPU
49 #elif defined _M_ARM
50  #define AK_CPU_ARM
51  #define AK_CPU_ARM_NEON
52 #elif defined _M_ARM64
53  #define AK_CPU_ARM_64
54  #define AK_CPU_ARM_NEON
55 #endif
56 
57 #ifdef WINAPI_FAMILY
58  #include <winapifamily.h>
59  #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
60  #define AK_USE_UWP_API
61  #define AK_USE_METRO_API // deprecated
62  #ifdef __cplusplus_winrt
63  #define AK_UWP_CPP_CX // To test for UWP code which uses Microsoft's C++/CX extended language (not all projects do)
64  #endif
65  #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PC_APP)
66  #define AK_WIN_UNIVERSAL_APP
67  #endif
68  #endif
69 #endif
70 
71 #ifndef _WIN32_WINNT
72  #ifdef AK_WIN_UNIVERSAL_APP
73  #define _WIN32_WINNT 0x0A00 // _WIN32_WINNT_WIN10
74  #else
75  #define _WIN32_WINNT 0x0602
76  #endif
77 #endif
78 
79 #define AK_71FROMSTEREOMIXER
80 #define AK_51FROMSTEREOMIXER
81 
82 #define AK_SUPPORT_WCHAR ///< Can support wchar
83 #define AK_OS_WCHAR ///< Use wchar natively
84 
85 #define AK_SUPPORT_THREAD_LOCAL ///< Support thread_local C++11 keyword with no restrictions
86 
87 #define AK_RESTRICT __restrict ///< Refers to the __restrict compilation flag available on some platforms
88 #define AK_EXPECT_FALSE( _x ) (_x)
89 #define AkForceInline __forceinline ///< Force inlining
90 #define AkNoInline __declspec(noinline) ///< Disable inlining
91 
92 #define AK_SIMD_ALIGNMENT 16 ///< Platform-specific alignment requirement for SIMD data
93 #define AK_ALIGN_SIMD( _declaration_ ) AK_ALIGN( _declaration_, AK_SIMD_ALIGNMENT ) ///< Platform-specific alignment requirement for SIMD data
94 #define AK_BUFFER_ALIGNMENT AK_SIMD_ALIGNMENT
95 #define AK_XAUDIO2_FLAGS 0
96 
97 #ifdef AK_USE_UWP_API
98 #define AK_WINRT_DEVICENOTIFICATION
99 #else
100 #define AK_DEVICE_CACHE_SUPPORT ///< Supports output device notifications & cache
101 #endif
102 
103 #if defined AK_CPU_X86 || defined AK_CPU_X86_64 || defined AK_CPU_ARM_NEON
104 #define AKSIMD_V4F32_SUPPORTED
105 #endif
106 
107 /// These flags defined that a given class of SIMD extensions is available.
108 /// Note that runtime checks MUST be done before entering code that explicitly utilizes one of these classes
109 #if defined AK_CPU_X86_64
110 #define AKSIMD_AVX2_SUPPORTED
111 #define AKSIMD_AVX_SUPPORTED
112 #endif
113 
114 #define AKSOUNDENGINE_CALL __cdecl ///< Calling convention for the Wwise API
115 
116 #define AK_DLLEXPORT __declspec(dllexport)
117 #define AK_DLLIMPORT __declspec(dllimport)
118 
119 typedef uint8_t AkUInt8; ///< Unsigned 8-bit integer
120 typedef uint16_t AkUInt16; ///< Unsigned 16-bit integer
121 typedef uint32_t AkUInt32; ///< Unsigned 32-bit integer
122 typedef uint64_t AkUInt64; ///< Unsigned 64-bit integer
123 
124 typedef intptr_t AkIntPtr; ///< Integer type for pointers
125 typedef uintptr_t AkUIntPtr; ///< Integer (unsigned) type for pointers
126 
127 typedef int8_t AkInt8; ///< Signed 8-bit integer
128 typedef int16_t AkInt16; ///< Signed 16-bit integer
129 typedef int32_t AkInt32; ///< Signed 32-bit integer
130 typedef int64_t AkInt64; ///< Signed 64-bit integer
131 
132 typedef wchar_t AkOSChar; ///< Generic character string
133 
134 typedef float AkReal32; ///< 32-bit floating point
135 typedef double AkReal64; ///< 64-bit floating point
136 
137 typedef void * AkThread; ///< Thread handle
138 typedef AkUInt32 AkThreadID; ///< Thread ID
139 typedef unsigned long (__stdcall *AkThreadRoutine)( void* lpThreadParameter ); ///< Thread routine
140 
141 typedef void * AkEvent; ///< Event handle
142 typedef void * AkSemaphore; ///< Semaphore handle
143 
144 typedef void * AkFileHandle; ///< File handle
145 typedef wchar_t AkUtf16; ///< Type for 2 byte chars. Used for communication
146  ///< with the authoring tool.
147 
148 typedef void* AkStackTrace[ 64 ];
149 
150 #define AK_UINT_MAX UINT_MAX
151 
152 // For strings.
153 #define AK_MAX_PATH 260 ///< Maximum path length.
154 
155 typedef AkUInt32 AkFourcc; ///< Riff chunk
156 
157 /// Create Riff chunk
158 #define AkmmioFOURCC( ch0, ch1, ch2, ch3 ) \
159  ( (AkFourcc)(AkUInt8)(ch0) | ( (AkFourcc)(AkUInt8)(ch1) << 8 ) | \
160  ( (AkFourcc)(AkUInt8)(ch2) << 16 ) | ( (AkFourcc)(AkUInt8)(ch3) << 24 ) )
161 
162 #define AK_BANK_PLATFORM_DATA_ALIGNMENT (16) ///< Required memory alignment for bank loading by memory address (see LoadBank())
163 
164 /// Format for printing AkOSChar string using OutputDebugMsgV
165 /// Corresponds to "%ls" if AK_OS_WCHAR, else "%s".
166 /// \remark Usage: AKPLATFORM::OutputDebugMsgV(AKTEXT("Print this string: " AK_OSCHAR_FMT "\n", msg));
167 #define AK_OSCHAR_FMT "%ls"
168 
169 /// Macro that takes a string litteral and changes it to an AkOSChar string at compile time
170 /// \remark This is similar to the TEXT() and _T() macros that can be used to turn string litterals into wchar_t strings
171 /// \remark Usage: AKTEXT( "Some Text" )
172 #define AKTEXT(x) L ## x
173 
174 #endif //_AK_DATA_TYPES_PLATFORM_H_
175 
float AkReal32
32-bit floating point
Definition: AkTypes.h:70
pthread_t AkThread
Thread handle.
Definition: AkTypes.h:73
semaphore_t AkEvent
Definition: AkTypes.h:73
pthread_t AkThreadID
Thread ID.
Definition: AkTypes.h:74
intptr_t AkIntPtr
Definition: AkTypes.h:66
uint8_t AkUInt8
Unsigned 8-bit integer.
Definition: AkTypes.h:57
uintptr_t AkUIntPtr
Definition: AkTypes.h:61
double AkReal64
64-bit floating point
Definition: AkTypes.h:71
char AkOSChar
Generic character string.
Definition: AkTypes.h:68
FILE * AkFileHandle
File handle.
Definition: AkTypes.h:80
AkUInt16 AkUtf16
Definition: AkTypes.h:82
int16_t AkInt16
Signed 16-bit integer.
Definition: AkTypes.h:63
uint64_t AkUInt64
Unsigned 64-bit integer.
Definition: AkTypes.h:60
nn::os::ThreadFunction AkThreadRoutine
Thread routine.
Definition: AkTypes.h:99
int8_t AkInt8
Signed 8-bit integer.
Definition: AkTypes.h:62
uint16_t AkUInt16
Unsigned 16-bit integer.
Definition: AkTypes.h:58
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkTypes.h:59
void * AkStackTrace[64]
Definition: AkTypes.h:58
AkUInt32 AkFourcc
Riff chunk.
Definition: AkTypes.h:90
int32_t AkInt32
Signed 32-bit integer.
Definition: AkTypes.h:64
semaphore_t AkSemaphore
Definition: AkTypes.h:74
int64_t AkInt64
Signed 64-bit integer.
Definition: AkTypes.h:65

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise