1 /* Copyright (c) 2017-2019. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 /* Check availability of AddressSanitizer */
9 #if defined(__has_feature)
10 #define HAS_FEATURE(x) __has_feature(x)
12 #define HAS_FEATURE(x) 0
15 #if not HAS_FEATURE(address_sanitizer) && not defined(__SANITIZE_ADDRESS__)
16 #error "ASan feature not found."
19 #include <sanitizer/asan_interface.h>
21 #if defined(CHECK_FIBER_SUPPORT)
22 // Verify the existence of the fiber annotation interface, with the expected signature
23 void (*start_fiber)(void**, const void*, size_t) = __sanitizer_start_switch_fiber;
24 void (*finish_fiber)(void*, const void**, size_t*) = __sanitizer_finish_switch_fiber;