-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to latest, add features, force static only
- Loading branch information
JackBoosY
committed
Sep 22, 2022
1 parent
ad00f26
commit ca5b872
Showing
4 changed files
with
171 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,27 @@ | ||
--- a/Import/Vlpp.h | ||
+++ b/Import/Vlpp.h | ||
@@ -50,13 +50,12 @@ | ||
#define abstract | ||
#endif | ||
- | ||
+#include <stdlib.h> | ||
#if defined VCZH_MSVC | ||
#include <intrin.h> | ||
#elif defined VCZH_GCC | ||
-#include <x86intrin.h> | ||
#include <stdint.h> | ||
#include <stddef.h> | ||
#include <wchar.h> | ||
#define abstract | ||
#define __thiscall | ||
#define __forceinline inline | ||
@@ -160,14 +159,14 @@ | ||
#define UI64TOA_S _ui64toa_s | ||
#define UI64TOW_S _ui64tow_s | ||
#if defined VCZH_MSVC | ||
#define INCRC(x) (_InterlockedIncrement((volatile long*)(x))) | ||
#define DECRC(x) (_InterlockedDecrement((volatile long*)(x))) | ||
#elif defined VCZH_GCC | ||
-#define INCRC(x) (__sync_add_and_fetch(x, 1)) | ||
-#define DECRC(x) (__sync_sub_and_fetch(x, 1)) | ||
+#define INCRC(x) (__atomic_add_fetch(x, 1, __ATOMIC_SEQ_CST)) | ||
+#define DECRC(x) (__atomic_sub_fetch(x, 1, __ATOMIC_SEQ_CST)) | ||
#endif | ||
#endif | ||
|
||
/*********************************************************************** | ||
Basic Types | ||
***********************************************************************/ | ||
diff --git a/Import/Vlpp.h b/Import/Vlpp.h | ||
index cf59b80..b00c9b8 100644 | ||
--- a/Import/Vlpp.h | ||
+++ b/Import/Vlpp.h | ||
@@ -49,10 +49,10 @@ static_assert(sizeof(wchar_t) == sizeof(char32_t), "wchar_t is not UTF-32."); | ||
static_assert(false, "wchar_t configuration is not right."); | ||
#endif | ||
|
||
+#include <stdlib.h> | ||
#if defined VCZH_MSVC | ||
#include <intrin.h> | ||
#elif defined VCZH_GCC | ||
-#include <x86intrin.h> | ||
#include <stdint.h> | ||
#include <stddef.h> | ||
#include <wchar.h> | ||
@@ -149,8 +149,8 @@ x86 and x64 Compatbility | ||
#define INCRC(x) (_InterlockedIncrement64(x)) | ||
#define DECRC(x) (_InterlockedDecrement64(x)) | ||
#elif defined VCZH_GCC | ||
-#define INCRC(x) (__sync_add_and_fetch(x, 1)) | ||
-#define DECRC(x) (__sync_sub_and_fetch(x, 1)) | ||
+#define INCRC(x) (__atomic_add_fetch(x, 1, __ATOMIC_SEQ_CST)) | ||
+#define DECRC(x) (__atomic_sub_fetch(x, 1, __ATOMIC_SEQ_CST)) | ||
#endif | ||
#else | ||
#define ITOA_S _itoa_s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters