Skip to content

Commit 75a7a52

Browse files
mganandrajfacebook-github-bot
authored andcommitted
fixing ATOMIC_VAR_INIT call (#26238)
Summary: We're trying to build react-native on Windows (part of the Microsoft\react-native-windows project) with MSVC compiler with WITH_FBSYSTRACE set to true (to route the traces to ETW). This change is to fix a compilation error due to the non standard usage of ATOMIC_VAR_INIT macro called with no parameters. It's not absolutely clear to me the objective of this macro in the standard at all (to be used in c context ?), and which compiler does support this parameterless version (gcc?). Also, I'm more inclined towards changing the statement to just "std::atomic_uint_least32_t m_systraceCookie{};". Please confirm. ## Changelog [General] [Fixed] - Removing the non-standard usage of ATOMIC_VAR_INIT macro from code with systrace enabled Pull Request resolved: #26238 Test Plan: Build verification should suffice as there is no semantic change introduced by this change. Differential Revision: D17259213 Pulled By: cpojer fbshipit-source-id: 9fe44f9220f18399a58f94f0f01d5fa93e6458e0
1 parent cc35d0f commit 75a7a52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactCommon/cxxreact/NativeToJsBridge.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class NativeToJsBridge {
107107
bool m_applicationScriptHasFailure = false;
108108

109109
#ifdef WITH_FBSYSTRACE
110-
std::atomic_uint_least32_t m_systraceCookie = ATOMIC_VAR_INIT();
110+
std::atomic_uint_least32_t m_systraceCookie = ATOMIC_VAR_INIT(0);
111111
#endif
112112
};
113113

0 commit comments

Comments
 (0)