summaryrefslogtreecommitdiff
path: root/include/libcamera/compiler.h
AgeCommit message (Collapse)Author
2021-12-03libcamera: Move compiler.h to base/Laurent Pinchart
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>
2021-11-24libcamera: Convert to pragma onceKieran Bingham
Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
2021-02-04libcamera: Add macro to conditionally use [[nodiscard]]Laurent Pinchart
The [[nodiscard]] attribute has been added to C++17. It can thus be used inside libcamera, but would prevent applications compiled for C++14 to use libcamera if the attribute was used in public headers. To offer this feature when the application is compiled with a recent-enough C++ version, as well as for compiling libcamera itself, add a __nodiscard macro that expands as [[nodiscard]] when using C++17 or newer. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>