[clang] Handle __declspec() attributes in using
[llvm-project.git] / compiler-rt / lib / gwp_asan / utilities.h
blobd8bc0e491a3d2e099d5e9dc81cb4bb86f4be04ef
1 //===-- utilities.h ---------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef GWP_ASAN_UTILITIES_H_
10 #define GWP_ASAN_UTILITIES_H_
12 #include "gwp_asan/definitions.h"
14 #include <stddef.h>
16 namespace gwp_asan {
17 // Terminates in a platform-specific way with `Message`.
18 void die(const char *Message);
20 // Checks that `Condition` is true, otherwise dies with `Message`.
21 GWP_ASAN_ALWAYS_INLINE void Check(bool Condition, const char *Message) {
22 if (Condition)
23 return;
24 die(Message);
26 } // namespace gwp_asan
28 #endif // GWP_ASAN_UTILITIES_H_