atomic:support ATOMIC_VAR_INIT in others platform

Summary:
  This change mainly appears in the compilation environment of MVSC
  Since MVSC supports the c++11 standard in VS2019 preview3 (https://en.cppreference.com/w/cpp/compiler_support/11), we can do static initialization using the c++11 approach
atomic_int a = 1

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
chenrun1 2024-08-09 12:41:22 +08:00 committed by Xiang Xiao
parent 900e713cd0
commit aade7c7c2d

View File

@ -80,6 +80,9 @@ extern "C++"
# endif
# include <stdbool.h>
# include <stdatomic.h>
# ifndef ATOMIC_VAR_INIT
# define ATOMIC_VAR_INIT(value) (value)
# endif
# else
# include <nuttx/lib/stdatomic.h>
# endif