mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-22 07:01:23 +08:00
Update Vlpp.h
This commit is contained in:
+18
-4
@@ -22,7 +22,7 @@ Licensed under https://github.com/vczh-libraries/License
|
||||
#define new VCZH_CHECK_MEMORY_LEAKS_NEW
|
||||
#endif
|
||||
|
||||
#if defined _WIN64 || __x86_64 || __LP64__
|
||||
#if defined _WIN64 || defined __x86_64 || defined __LP64__ || defined __aarch64__
|
||||
#define VCZH_64
|
||||
#endif
|
||||
|
||||
@@ -35,6 +35,10 @@ Licensed under https://github.com/vczh-libraries/License
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined __arm__ || defined __aarch64__
|
||||
#define VCZH_ARM
|
||||
#endif
|
||||
|
||||
#if defined VCZH_MSVC
|
||||
#define VCZH_WCHAR_UTF16
|
||||
#elif defined VCZH_GCC
|
||||
@@ -49,10 +53,14 @@ static_assert(sizeof(wchar_t) == sizeof(char32_t), "wchar_t is not UTF-32.");
|
||||
static_assert(false, "wchar_t configuration is not right.");
|
||||
#endif
|
||||
|
||||
#if defined VCZH_MSVC
|
||||
#if defined VCZH_ARM
|
||||
#elif defined VCZH_MSVC
|
||||
#include <intrin.h>
|
||||
#elif defined VCZH_GCC
|
||||
#include <x86intrin.h>
|
||||
#endif
|
||||
|
||||
#if defined VCZH_GCC
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <wchar.h>
|
||||
@@ -145,7 +153,10 @@ x86 and x64 Compatbility
|
||||
#define UITOW_S _ui64tow_s
|
||||
#define UI64TOA_S _ui64toa_s
|
||||
#define UI64TOW_S _ui64tow_s
|
||||
#if defined VCZH_MSVC
|
||||
#if defined VCZH_ARM
|
||||
#define INCRC(x) (__atomic_add_fetch(x, 1, __ATOMIC_SEQ_CST))
|
||||
#define DECRC(x) (__atomic_sub_fetch(x, 1, __ATOMIC_SEQ_CST))
|
||||
#elif defined VCZH_MSVC
|
||||
#define INCRC(x) (_InterlockedIncrement64(x))
|
||||
#define DECRC(x) (_InterlockedDecrement64(x))
|
||||
#elif defined VCZH_GCC
|
||||
@@ -161,7 +172,10 @@ x86 and x64 Compatbility
|
||||
#define UITOW_S _ui64tow_s
|
||||
#define UI64TOA_S _ui64toa_s
|
||||
#define UI64TOW_S _ui64tow_s
|
||||
#if defined VCZH_MSVC
|
||||
#if defined VCZH_ARM
|
||||
#define INCRC(x) (__atomic_add_fetch(x, 1, __ATOMIC_SEQ_CST))
|
||||
#define DECRC(x) (__atomic_sub_fetch(x, 1, __ATOMIC_SEQ_CST))
|
||||
#elif defined VCZH_MSVC
|
||||
#define INCRC(x) (_InterlockedIncrement((volatile long*)(x)))
|
||||
#define DECRC(x) (_InterlockedDecrement((volatile long*)(x)))
|
||||
#elif defined VCZH_GCC
|
||||
|
||||
Reference in New Issue
Block a user