menu
 
版本
2023.1.13.8732

2024.1.5.8803

2023.1.13.8732

2022.1.19.8584

2021.1.14.8108

2019.2.15.7667

2019.1.11.7296

2018.1.11.6987

2017.2.10.6745

2017.1.9.6501

2016.2.6.6153

2015.1.9.5624


menu_open
Wwise SDK 2023.1.13
AkPlatforms.h
浏览该文件的文档.
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) 2025 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 /// \file
28 /// Audiokinetic platform checks. This is where we detect which platform
29 /// is being compiled, and where we define the corresponding AK-specific
30 /// symbols.
31 
32 #pragma once
33 
34 #if defined( NN_NINTENDO_SDK )
35  #include "nn/nn_Platform.h"
36 #endif
37 
38 #if defined( AK_NULL_PLATFORM )
39  // AK_NULL_PLATFORM can be defined as a part of standing up a new platform in client code,
40  // which may not be fully supported by Wwise.
41  #include <AK/SoundEngine/Platforms/Generic/AkTypes.h>
42 
43 #elif defined( NN_BUILD_TARGET_PLATFORM_NX )
44 
46 
47 #elif defined( NN_BUILD_TARGET_PLATFORM_OUNCE )
48 
50 
51 #elif defined( _GAMING_XBOX )
52 
54 
55 #elif defined( _WIN32 ) || defined ( _WIN64 ) || defined( WINAPI_FAMILY )
56 
58 
59 #elif defined( __APPLE__ )
60 
62 
63 #elif defined( __ORBIS__ )
64 
66 
67 #elif defined(__HARMONY__)
68 
70 
71 #elif defined( __PROSPERO__ )
72 
74 
75 #elif defined( __ANDROID__ ) && !defined (AK_LINUX_AOSP)
76 
78 
79 #elif defined( __linux__ )
80 
82 
83 #elif defined( __EMSCRIPTEN__ )
84 
86 
87 #elif defined( __QNX__ )
88 
89  #include <AK/SoundEngine/Platforms/QNX/AkTypes.h>
90 
91 #elif defined(__has_include)
92 
93 // AkTypes included here should have internal guardrails to prevent processing if not applicable for current platform
94 
95 #else
96 
97  #error Unsupported platform, or platform-specific symbols not defined
98 
99 #endif
100 
101 #ifndef AK_ALIGN
102 #if defined(SWIG)
103 #define AK_ALIGN( _declaration_, _alignment_ ) _declaration_
104 #else
105 #if defined(_MSC_VER)
106 #define AK_ALIGN( _declaration_, _alignment_ ) __declspec( align( _alignment_ ) ) _declaration_
107 #else
108 #define AK_ALIGN( _declaration_, _alignment_ ) _declaration_ __attribute__( ( aligned( _alignment_ ) ) )
109 #endif // _MSC_VER
110 #endif // SWIG
111 #endif // AK_ALIGN
112 
113 #define AK_ALIGN_TO_NEXT_BOUNDARY( __num__, __boundary__ ) (((__num__) + ((__boundary__)-1)) & ~((__boundary__)-1))
114 
115 #if !defined(AK_ENDIANNESS_LITTLE) && !defined(AK_ENDIANNESS_BIG)
116 #define AK_ENDIANNESS_LITTLE
117 #endif
118 
119 /// AK_UNALIGNED refers to the __unaligned compilation flag available on some platforms. Note that so far, on the tested platform this should always be placed before the pointer symbol *.
120 #ifndef AK_UNALIGNED
121 #if defined(__GNUC__)
122 #define AK_UNALIGNED __attribute__((aligned(1)))
123 #elif defined(_MSC_VER) && !defined(AK_CPU_X86) // __unaligned not supported on 32-bit x86
124 #define AK_UNALIGNED __unaligned
125 #else
126 #define AK_UNALIGNED
127 #endif
128 #endif // AK_UNALIGNED
129 
130 #ifndef AK_SELECTANY
131 #if defined(__GNUC__)
132 #define AK_SELECTANY __attribute__((weak))
133 #elif defined(_MSC_VER)
134 #define AK_SELECTANY __declspec(selectany)
135 #else
136 #define AK_SELECTANY
137 #endif
138 #endif // AK_SELECTANY
139 
140 #if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L)
141 #define AK_CPP11
142 #endif
143 
144 #if (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
145 #define AK_CPP14
146 #endif
147 
148 #if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
149 #define AK_CPP17
150 #endif
151 
152 #if defined(AK_CPP11)
153 #define AK_FINAL final ///< Refers to the C++11 final keyword
154 #else
155 #define AK_FINAL
156 #endif
157 
158 #if defined(AK_CPP17)
159 #define AK_NODISCARD [[nodiscard]] ///< Refers to the C++17 [[nodiscard]] keyword
160 #else
161 #define AK_NODISCARD
162 #endif
163 
164 #if defined(AK_CPU_X86_64) || defined(AK_CPU_ARM_64)
165 #define AK_POINTER_64
166 #endif // #if defined(AK_CPU_X86_64) || defined(AK_CPU_ARM_64)
167 
168 #if !defined(AK_UNUSEDVAR)
169 // use to mark variables as unused to avoid warnings
170 #define AK_UNUSEDVAR(x) ((void)(x))
171 #endif
172 
173 #if defined(AK_SUPPORT_THREADS)
174 #define AK_THREAD_LOCAL thread_local
175 #else
176 #define AK_THREAD_LOCAL
177 #endif
178 
179 // Helper macro to disable optimizations in a specific file (or part of a file)
180 // (no code using these macros should be checked in)
181 #if defined(__clang__)
182 #define AK_DISABLE_OPTIMIZATIONS _Pragma("clang optimize off")
183 #define AK_ENABLE_OPTIMIZATIONS _Pragma("clang optimize on")
184 #elif defined(__GNUC__)
185 #define AK_DISABLE_OPTIMIZATIONS _Pragma("GCC optimize (\"O0\")")
186 #define AK_ENABLE_OPTIMIZATIONS _Pragma("GCC optimize (\"O2\")")
187 #elif defined(_MSC_VER)
188 #define AK_DISABLE_OPTIMIZATIONS __pragma(optimize("", off))
189 #define AK_ENABLE_OPTIMIZATIONS __pragma(optimize("", on))
190 #endif

此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅