Skip to content

Commit ccc4c2b

Browse files
committed
Try to fix CI
1 parent f3c49f4 commit ccc4c2b

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

libcxx/src/debugging.cpp

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,37 @@
2727

2828
_LIBCPP_BEGIN_NAMESPACE_STD
2929

30+
#if defined(_LIBCPP_HAS_DEBUGGING)
31+
3032
// breakpoint()
3133

32-
#if defined(_LIBCPP_WIN32API)
34+
# if defined(_LIBCPP_WIN32API)
3335

3436
void __breakpoint() noexcept { DebugBreak(); }
3537

36-
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__linux__)
38+
# elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__linux__)
3739

3840
void __breakpoint() {
39-
# if __has_builtin(__builtin_debugtrap)
41+
# if __has_builtin(__builtin_debugtrap)
4042
__builtin_debugtrap();
41-
# else
43+
# else
4244
raise(SIGTRAP);
43-
# endif
45+
# endif
4446
}
4547

46-
#else
48+
# else
4749

48-
# error "'std::breakpoint()' is not implemented on this platform."
50+
# error "'std::breakpoint()' is not implemented on this platform."
4951

50-
#endif // defined(_LIBCPP_WIN32API)
52+
# endif // defined(_LIBCPP_WIN32API)
5153

5254
// is_debugger_present()
5355

54-
#if defined(_LIBCPP_WIN32API)
56+
# if defined(_LIBCPP_WIN32API)
5557

5658
bool __is_debugger_present() noexcept { return IsDebuggerPresent(); }
5759

58-
#elif defined(__APPLE__) || defined(__FreeBSD__)
60+
# elif defined(__APPLE__) || defined(__FreeBSD__)
5961

6062
// Returns true if the current process is being debugged (either
6163
// running under the debugger or has a debugger attached post facto).
@@ -87,7 +89,7 @@ bool __is_debugger_present() noexcept {
8789
return ((info.kp_proc.p_flag & P_TRACED) != 0);
8890
}
8991

90-
#elif defined(__linux__)
92+
# elif defined(__linux__)
9193

9294
bool __is_debugger_present() noexcept {
9395
// https://docs.kernel.org/filesystems/proc.html
@@ -114,11 +116,11 @@ bool __is_debugger_present() noexcept {
114116
return false;
115117
}
116118

117-
#else
119+
# else
118120

119-
# error "'std::is_debugger_present()' is not implemented on this platform."
121+
# error "'std::is_debugger_present()' is not implemented on this platform."
120122

121-
#endif // defined(_LIBCPP_WIN32API)
123+
# endif // defined(_LIBCPP_WIN32API)
122124

123125
_LIBCPP_EXPORTED_FROM_ABI void breakpoint() noexcept { __breakpoint(); }
124126

@@ -129,4 +131,6 @@ _LIBCPP_EXPORTED_FROM_ABI void breakpoint_if_debugging() noexcept {
129131

130132
_LIBCPP_EXPORTED_FROM_ABI bool is_debugger_present() noexcept { return __is_debugger_present(); }
131133

134+
#endif // defined(_LIBCPP_HAS_DEBUGGING)
135+
132136
_LIBCPP_END_NAMESPACE_STD

0 commit comments

Comments
 (0)