Wwise Version
Wwise SDK 2021.1.3
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.3 Build: 7665
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 #define AkForceInline inline ///< Force inlining
46 #define AkNoInline __attribute__ ((noinline)) ///< Disable inlining
47 
48 #define AK_SIMD_ALIGNMENT 16 ///< Platform-specific alignment requirement for SIMD data
49 #define AK_ALIGN_SIMD( _declaration_ ) AK_ALIGN( _declaration_, AK_SIMD_ALIGNMENT ) ///< Platform-specific alignment requirement for SIMD data
50 #define AK_BUFFER_ALIGNMENT AK_SIMD_ALIGNMENT
51 
52 #define AK_DLLEXPORT __attribute__ ((visibility("default")))
53 #define AK_DLLIMPORT
54 
55 typedef uint8_t AkUInt8; ///< Unsigned 8-bit integer
56 typedef uint16_t AkUInt16; ///< Unsigned 16-bit integer
57 typedef uint32_t AkUInt32; ///< Unsigned 32-bit integer
58 typedef uint64_t AkUInt64; ///< Unsigned 64-bit integer
59 typedef uintptr_t AkUIntPtr;
60 typedef int8_t AkInt8; ///< Signed 8-bit integer
61 typedef int16_t AkInt16; ///< Signed 16-bit integer
62 typedef int32_t AkInt32; ///< Signed 32-bit integer
63 typedef int64_t AkInt64; ///< Signed 64-bit integer
64 typedef intptr_t AkIntPtr;
65 
66 typedef char AkOSChar; ///< Generic character string
67 
68 typedef float AkReal32; ///< 32-bit floating point
69 typedef double AkReal64; ///< 64-bit floating point
70 
71 typedef pthread_t AkThread; ///< Thread handle
72 typedef pthread_t AkThreadID; ///< Thread ID
73 typedef void* (*AkThreadRoutine)( void* lpThreadParameter ); ///< Thread routine
74 #ifndef AK_APPLE
75 typedef sem_t AkEvent; ///< Event handle
76 typedef sem_t AkSemaphore; ///< Semaphore handle
77 #endif
78 typedef FILE* AkFileHandle; ///< File handle
79 
80 typedef AkUInt16 AkUtf16; ///< Type for 2 byte chars. Used for communication
81  ///< with the authoring tool.
82 
83 #define AK_UINT_MAX UINT_MAX
84 
85 // For strings.
86 #define AK_MAX_PATH 260 ///< Maximum path length.
87 
88 typedef AkUInt32 AkFourcc; ///< Riff chunk
89 
90 /// Create Riff chunk
91 #define AkmmioFOURCC( ch0, ch1, ch2, ch3 ) \
92  ( (AkFourcc)(AkUInt8)(ch0) | ( (AkFourcc)(AkUInt8)(ch1) << 8 ) | \
93  ( (AkFourcc)(AkUInt8)(ch2) << 16 ) | ( (AkFourcc)(AkUInt8)(ch3) << 24 ) )
94 
95 #define AK_BANK_PLATFORM_DATA_ALIGNMENT (16) ///< Required memory alignment for bank loading by memory address (see LoadBank())
96 
97 /// Format for printing AkOSChar string using OutputDebugMsgV
98 /// Corresponds to "%ls" if AK_OS_WCHAR, else "%s".
99 /// \remark Usage: AKPLATFORM::OutputDebugMsgV(AKTEXT("Print this string: " AK_OSCHAR_FMT "\n", msg));
100 #define AK_OSCHAR_FMT "%s"
101 
102 #define AKTEXT(x) x
float AkReal32
32-bit floating point
Definition: AkTypes.h:68
pthread_t AkThread
Thread handle.
Definition: AkTypes.h:71
semaphore_t AkEvent
Definition: AkTypes.h:73
pthread_t AkThreadID
Thread ID.
Definition: AkTypes.h:72
intptr_t AkIntPtr
Definition: AkTypes.h:64
uint8_t AkUInt8
Unsigned 8-bit integer.
Definition: AkTypes.h:55
uintptr_t AkUIntPtr
Definition: AkTypes.h:59
double AkReal64
64-bit floating point
Definition: AkTypes.h:69
char AkOSChar
Generic character string.
Definition: AkTypes.h:66
FILE * AkFileHandle
File handle.
Definition: AkTypes.h:78
AkUInt16 AkUtf16
Definition: AkTypes.h:80
int16_t AkInt16
Signed 16-bit integer.
Definition: AkTypes.h:61
uint64_t AkUInt64
Unsigned 64-bit integer.
Definition: AkTypes.h:58
int8_t AkInt8
Signed 8-bit integer.
Definition: AkTypes.h:60
uint16_t AkUInt16
Unsigned 16-bit integer.
Definition: AkTypes.h:56
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkTypes.h:57
AkUInt32 AkFourcc
Riff chunk.
Definition: AkTypes.h:88
int32_t AkInt32
Signed 32-bit integer.
Definition: AkTypes.h:62
semaphore_t AkSemaphore
Definition: AkTypes.h:74
int64_t AkInt64
Signed 64-bit integer.
Definition: AkTypes.h:63