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

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