Skip to content

Commit 8140ab9

Browse files
committed
Generalize source_location test
1 parent b823706 commit 8140ab9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

include/cpp2util.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
#ifndef __CPP2_UTIL
2121
#define __CPP2_UTIL
2222

23+
// If this implementation doesn't support source_location yet, disable it
24+
#if !defined(_MSC_VER) && !defined(__cpp_lib_source_location)
25+
#undef CPP2_USE_SOURCE_LOCATION
26+
#endif
27+
2328
// If the cppfront user requested -pure-cpp2, this will be set
2429
// and we should be using modules only
2530
#ifdef CPP2_USE_MODULES
@@ -186,10 +191,6 @@
186191
#include <optional>
187192
#include <cstddef>
188193

189-
// If this compiler doesn't support <source_location> yet, disable it
190-
#if !defined(__cpp_lib_source_location)
191-
#undef CPP2_USE_SOURCE_LOCATION
192-
#endif
193194
#if defined(CPP2_USE_SOURCE_LOCATION)
194195
#include <source_location>
195196
#endif

0 commit comments

Comments
 (0)