Skip to content

Commit

Permalink
<stdatomic.h>: Simplify preprocessor logic (#2615)
Browse files Browse the repository at this point in the history
  • Loading branch information
barcharcraz authored Mar 28, 2022
1 parent f307b76 commit 1b6fa43
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions stl/inc/stdatomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
#ifndef _STDATOMIC_H_
#define _STDATOMIC_H_

#if defined(RC_INVOKED) || defined(Q_MOC_RUN) || defined(__midl)
// do nothing, see _STL_COMPILER_PREPROCESSOR in yvals_core.h
#else // ^^^ non-compiler tools / C and C++ compilers vvv
// see _STL_COMPILER_PREPROCESSOR in yvals_core.h
#if !defined(RC_INVOKED) && !defined(Q_MOC_RUN) && !defined(__midl)

// provide a specific error message for C compilers, before the general error message in yvals_core.h
#ifndef __cplusplus
#error <stdatomic.h> is not yet supported when compiling as C, but this is planned for a future release.
#endif // __cplusplus
#endif // ^^^ C and C++ compilers ^^^

#include <yvals.h>
#if _STL_COMPILER_PREPROCESSOR

#ifdef _M_CEE_PURE
#error <stdatomic.h> is not supported when compiling with /clr:pure.
Expand Down Expand Up @@ -135,5 +133,5 @@ _STL_RESTORE_CLANG_WARNINGS
#pragma pack(pop)
#endif // ^^^ _HAS_CXX23 ^^^

#endif // _STL_COMPILER_PREPROCESSOR
#endif // !defined(RC_INVOKED) && !defined(Q_MOC_RUN) && !defined(__midl)
#endif // _STDATOMIC_H_

0 comments on commit 1b6fa43

Please sign in to comment.