Skip to content

Commit 2060199

Browse files
author
Advenam Tacet
committed
Fixes based on the code review
(1) Renamed to `_LIBCPP_IF_ASAN`. (2) Moved to `__config`. (3) Added `{ ... }` after `_LIBCPP_IF_ASAN()`. Missing: `#ifdef` around ASan related variables.
1 parent df31c7d commit 2060199

File tree

2 files changed

+144
-97
lines changed

2 files changed

+144
-97
lines changed

libcxx/include/__config

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,6 +1490,16 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c
14901490
# define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
14911491
# endif
14921492

1493+
// ASan related macros
1494+
// _LIBCPP_IF_ASAN is used to removed ASan related code, whenever compiled without ASan.
1495+
#ifndef _LIBCPP_IF_ASAN
1496+
# ifndef _LIBCPP_HAS_NO_ASAN
1497+
# define _LIBCPP_IF_ASAN() if _LIBCPP_CONSTEXPR (true)
1498+
# else
1499+
# define _LIBCPP_IF_ASAN() if _LIBCPP_CONSTEXPR (false)
1500+
# endif
1501+
#endif
1502+
14931503
#endif // __cplusplus
14941504

14951505
#endif // _LIBCPP___CONFIG

0 commit comments

Comments
 (0)