summaryrefslogtreecommitdiff
path: root/include/libcamera/base
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-11-28 00:05:35 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-12-03 19:20:29 +0200
commit6b1e25693402a1db6cde995ae8e1b8bf74b88e17 (patch)
tree0e30abfd5792fcf40bceaf84aa859ae711f3e567 /include/libcamera/base
parent4b24b0bfe6dd1ec716a605b683e45cd47a0bd6ee (diff)
libcamera: Move compiler.h to base/
In preparation for usage of __nodiscard in the base API, move the compiler.h header to base. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'include/libcamera/base')
-rw-r--r--include/libcamera/base/compiler.h14
-rw-r--r--include/libcamera/base/meson.build1
2 files changed, 15 insertions, 0 deletions
diff --git a/include/libcamera/base/compiler.h b/include/libcamera/base/compiler.h
new file mode 100644
index 00000000..02564f2f
--- /dev/null
+++ b/include/libcamera/base/compiler.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2021, Google Inc.
+ *
+ * compiler.h - Compiler support
+ */
+
+#pragma once
+
+#if __cplusplus >= 201703L
+#define __nodiscard [[nodiscard]]
+#else
+#define __nodiscard
+#endif
diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build
index 37c4435a..210a54f8 100644
--- a/include/libcamera/base/meson.build
+++ b/include/libcamera/base/meson.build
@@ -6,6 +6,7 @@ libcamera_base_headers = files([
'backtrace.h',
'bound_method.h',
'class.h',
+ 'compiler.h',
'event_dispatcher.h',
'event_dispatcher_poll.h',
'event_notifier.h',