summaryrefslogtreecommitdiff
path: root/v4l2++/src/helpers.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2021-10-06 10:26:00 +0300
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2021-10-06 10:44:26 +0300
commit2b1a8f48f3a414e565cefb809f3e6a7c6aa5f8a7 (patch)
tree3f274b92d00754e6a5980f07b2c9cefcbf2cae53 /v4l2++/src/helpers.cpp
parentf691ed65d6bcfff0abbc2d7ce58e560af3ee63dc (diff)
Split V4L2 code into separate libs
Create v4l2++ library and pyv4l2, which are independent from the rest of the kms++. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Diffstat (limited to 'v4l2++/src/helpers.cpp')
-rw-r--r--v4l2++/src/helpers.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/v4l2++/src/helpers.cpp b/v4l2++/src/helpers.cpp
new file mode 100644
index 0000000..db80408
--- /dev/null
+++ b/v4l2++/src/helpers.cpp
@@ -0,0 +1,16 @@
+#include <v4l2++/helpers.h>
+
+void __my_throw(const char* file, int line, const char *funcname, const char *cond, fmt::string_view format, fmt::format_args args)
+{
+ std::string str = fmt::vformat(format, args);
+
+ fmt::print(stderr, "{}:{}: {}:\n{}", file, line, funcname, str);
+ if (cond)
+ fmt::print(stderr, " ({})\n", cond);
+ else
+ fmt::print("\n");
+
+ fflush(stderr);
+
+ throw std::runtime_error(str);
+}