Go to the documentation of this file.
37 #define AK_SEC_TO_NANOSEC 1000000000ULL
39 #define AK_THREAD_INIT_CODE(_threadProperties) \
40 if (_threadProperties.dwAffinityMask != AK_THREAD_AFFINITY_DEFAULT) \
43 CPU_ZERO(&affinity); \
44 for (AkUInt32 i = 0; i < 32; ++i) { \
45 if (_threadProperties.dwAffinityMask & ( 1 << i )){\
46 CPU_SET(i, &affinity); \
49 sched_setaffinity(0, sizeof(cpu_set_t), &affinity); \
60 struct timespec clockNow;
61 clock_gettime(CLOCK_MONOTONIC, &clockNow);
73 template<
class destType,
class srcType>
74 inline size_t AkSimpleConvertString( destType* in_pdDest,
const srcType* in_pSrc,
size_t in_MaxSize,
size_t destStrLen(
const destType *),
size_t srcStrLen(
const srcType *) )
77 size_t lenToCopy = srcStrLen(in_pSrc);
79 lenToCopy = (lenToCopy > in_MaxSize-1) ? in_MaxSize-1 : lenToCopy;
80 for(i = 0; i < lenToCopy; i++)
82 in_pdDest[i] = (destType) in_pSrc[i];
84 in_pdDest[lenToCopy] = (destType)0;
89 #define CONVERT_UTF16_TO_CHAR( _astring_, _charstring_ ) \
90 _charstring_ = (char*)AkAlloca( (1 + AKPLATFORM::AkUtf16StrLen((const AkUtf16*)_astring_)) * sizeof(char) ); \
91 AK_UTF16_TO_CHAR( _charstring_, (const AkUtf16*)_astring_, AKPLATFORM::AkUtf16StrLen((const AkUtf16*)_astring_)+1 )
93 #define AK_UTF16_TO_CHAR( in_pdDest, in_pSrc, in_MaxSize ) AKPLATFORM::AkSimpleConvertString( in_pdDest, in_pSrc, in_MaxSize, strlen, AKPLATFORM::AkUtf16StrLen )
94 #define AK_UTF8_TO_OSCHAR( in_pdDest, in_pSrc, in_MaxSize ) AKPLATFORM::AkSimpleConvertString( in_pdDest, in_pSrc, in_MaxSize, strlen, strlen )
95 #define AK_UTF16_TO_OSCHAR( in_pdDest, in_pSrc, in_MaxSize ) AKPLATFORM::AkSimpleConvertString( in_pdDest, in_pSrc, in_MaxSize, strlen, AKPLATFORM::AkUtf16StrLen )
96 #define AK_UTF16_TO_WCHAR( in_pdDest, in_pSrc, in_MaxSize ) AKPLATFORM::AkSimpleConvertString( in_pdDest, in_pSrc, in_MaxSize, wcslen, AKPLATFORM::AkUtf16StrLen )
97 #define AK_CHAR_TO_UTF16( in_pdDest, in_pSrc, in_MaxSize ) AKPLATFORM::AkSimpleConvertString( in_pdDest, in_pSrc, in_MaxSize, AKPLATFORM::AkUtf16StrLen, strlen )
98 #define AK_OSCHAR_TO_UTF16( in_pdDest, in_pSrc, in_MaxSize ) AKPLATFORM::AkSimpleConvertString( in_pdDest, in_pSrc, in_MaxSize, AKPLATFORM::AkUtf16StrLen, strlen )
99 #define AK_WCHAR_TO_UTF16( in_pdDest, in_pSrc, in_MaxSize ) AKPLATFORM::AkSimpleConvertString( in_pdDest, in_pSrc, in_MaxSize, AKPLATFORM::AkUtf16StrLen, wcslen )
101 #define AK_FILEHANDLE_TO_UINTPTR(_h) ((AkUIntPtr)_h)
102 #define AK_SET_FILEHANDLE_TO_UINTPTR(_h,_u) _h = (AkFileHandle)_u
105 #define AkAlloca( _size_ ) __builtin_alloca( _size_ )
Platform-dependent helpers.
void PerformanceCounter(AkInt64 *out_piLastTime)
Platform Independent Helper.
int64_t AkInt64
Signed 64-bit integer.
void PerformanceFrequency(AkInt64 *out_piFreq)
Platform Independent Helper.
size_t AkSimpleConvertString(destType *in_pdDest, const srcType *in_pSrc, size_t in_MaxSize, size_t destStrLen(const destType *), size_t srcStrLen(const srcType *))
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