summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/stdnoreturn.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/builtin/stdnoreturn.h b/builtin/stdnoreturn.h
new file mode 100644
index 0000000000..659d3c540f
--- /dev/null
+++ b/builtin/stdnoreturn.h
@@ -0,0 +1,20 @@
+/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef __CROS_EC_STDNORETURN_H__
+#define __CROS_EC_STDNORETURN_H__
+
+/*
+ * Only defined for C: https://en.cppreference.com/w/c/language/_Noreturn
+ *
+ * C++ uses [[noreturn]]: https://en.cppreference.com/w/cpp/language/attributes/noreturn
+ */
+#ifndef __cplusplus
+#ifndef noreturn
+#define noreturn _Noreturn
+#endif
+#endif
+
+#endif /* __CROS_EC_STDNORETURN_H__ */