Wwise Version
Wwise SDK 2021.1.5
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.5 Build: 7749
25  Copyright (c) 2006-2021 Audiokinetic Inc.
26 *******************************************************************************/
27 
28 // AkTypes.h
29 
30 /// \file
31 /// Data type definitions.
32 
33 #pragma once
34 
35 #include <sys/types.h>
36 #include <pthread.h>
37 #include <semaphore.h>
38 #include <stdio.h>
39 #include <limits.h>
40 #include <string.h>
41 #include <stdint.h>
42 
43 #define AK_RESTRICT __restrict ///< Refers to the __restrict compilation flag available on some platforms
44 #define AK_EXPECT_FALSE( _x ) (_x)
45 #ifndef AkForceInline
46 #define AkForceInline inline ///< Force inlining
47 #endif
48 #define AkNoInline __attribute__ ((noinline)) ///< Disable inlining
49 
50 #define AK_SIMD_ALIGNMENT 16 ///< Platform-specific alignment requirement for SIMD data
51 #define AK_ALIGN_SIMD( _declaration_ ) AK_ALIGN( _declaration_, AK_SIMD_ALIGNMENT ) ///< Platform-specific alignment requirement for SIMD data
52 #define AK_BUFFER_ALIGNMENT AK_SIMD_ALIGNMENT
53 
54 #define AK_DLLEXPORT __attribute__ ((visibility("default")))
55 #define AK_DLLIMPORT
56 
57 typedef uint8_t AkUInt8; ///< Unsigned 8-bit integer
58 typedef uint16_t AkUInt16; ///< Unsigned 16-bit integer
59 typedef uint32_t AkUInt32; ///< Unsigned 32-bit integer
60 typedef uint64_t AkUInt64; ///< Unsigned 64-bit integer
61 typedef uintptr_t AkUIntPtr;
62 typedef int8_t AkInt8; ///< Signed 8-bit integer
63 typedef int16_t AkInt16; ///< Signed 16-bit integer
64 typedef int32_t AkInt32; ///< Signed 32-bit integer
65 typedef int64_t AkInt64; ///< Signed 64-bit integer
66 typedef intptr_t AkIntPtr;
67 
68 typedef char AkOSChar; ///< Generic character string
69 
70 typedef float AkReal32; ///< 32-bit floating point
71 typedef double AkReal64; ///< 64-bit floating point
72 
73 typedef pthread_t AkThread; ///< Thread handle
74 typedef pthread_t AkThreadID; ///< Thread ID
75 typedef void* (*AkThreadRoutine)( void* lpThreadParameter ); ///< Thread routine
76 #ifndef AK_APPLE
77 typedef sem_t AkEvent; ///< Event handle
78 typedef sem_t AkSemaphore; ///< Semaphore handle
79 #endif
80 typedef FILE* AkFileHandle; ///< File handle
81 
82 typedef AkUInt16 AkUtf16; ///< Type for 2 byte chars. Used for communication
83  ///< with the authoring tool.
84 
85 #define AK_UINT_MAX UINT_MAX
86 
87 // For strings.
88 #define AK_MAX_PATH 260 ///< Maximum path length.
89 
90 typedef AkUInt32 AkFourcc; ///< Riff chunk
91 
92 /// Create Riff chunk
93 #define AkmmioFOURCC( ch0, ch1, ch2, ch3 ) \
94  ( (AkFourcc)(AkUInt8)(ch0) | ( (AkFourcc)(AkUInt8)(ch1) << 8 ) | \
95  ( (AkFourcc)(AkUInt8)(ch2) << 16 ) | ( (AkFourcc)(AkUInt8)(ch3) << 24 ) )
96 
97 #define AK_BANK_PLATFORM_DATA_ALIGNMENT (16) ///< Required memory alignment for bank loading by memory address (see LoadBank())
98 
99 /// Format for printing AkOSChar string using OutputDebugMsgV
100 /// Corresponds to "%ls" if AK_OS_WCHAR, else "%s".
101 /// \remark Usage: AKPLATFORM::OutputDebugMsgV(AKTEXT("Print this string: " AK_OSCHAR_FMT "\n", msg));
102 #define AK_OSCHAR_FMT "%s"
103 
104 #define AKTEXT(x) x
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
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
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