Skip to content

Commit

Permalink
fwd: Enable C89 and C++98 with Clang-CL
Browse files Browse the repository at this point in the history
  • Loading branch information
lhmouse committed Dec 4, 2024
1 parent b26ef85 commit a601729
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions mcfgthread/fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ __MCF_CXX(extern "C" {)
# define __MCF_nullptr nullptr
#endif

#if defined __cplusplus && (defined _MSC_VER || (__cplusplus >= 201103L))
#if defined __cplusplus && ((__cplusplus >= 201103L) || (defined _MSC_VER && !defined __clang__))
# undef __MCF_CXX11
# define __MCF_CXX11(...) __VA_ARGS__
# undef __MCF_noexcept
Expand All @@ -93,7 +93,7 @@ __MCF_CXX(extern "C" {)
# define __MCF_nullptr nullptr
#endif

#if defined __cplusplus && (defined _MSC_VER || (__cplusplus >= 201402L))
#if defined __cplusplus && ((__cplusplus >= 201402L) || (defined _MSC_VER && !defined __clang__))
# undef __MCF_CXX14
# define __MCF_CXX14(...) __VA_ARGS__
#endif
Expand Down
6 changes: 3 additions & 3 deletions test/cxx11_pedantic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* LICENSE.TXT as a whole. The GCC Runtime Library Exception applies
* to this file. */

#if defined _MSC_VER
#if defined _MSC_VER // MSVC standard library doesn't compile as C++11.
int
main(void)
{
return 77;
}
#else // _MSC_VER
#else // MSVC

#include "../mcfgthread/cxx11.hpp"

Expand All @@ -25,4 +25,4 @@ main(void)
return 0;
}

#endif // _MSC_VER
#endif // MSVC
6 changes: 3 additions & 3 deletions test/gthr_cxx98_pedantic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* LICENSE.TXT as a whole. The GCC Runtime Library Exception applies
* to this file. */

#if defined _MSC_VER
#if defined _MSC_VER && !defined __clang__
int
main(void)
{
return 77;
}
#else // _MSC_VER
#else // MSVC

#include "../mcfgthread/atomic.h"
#include "../mcfgthread/c11.h"
Expand Down Expand Up @@ -42,4 +42,4 @@ main(void)
return 0;
}

#endif // _MSC_VER
#endif // MSVC

0 comments on commit a601729

Please sign in to comment.