Руслан Урядинский / libuavcan

Dependents:   UAVCAN UAVCAN_Subscriber

Revision:
0:dfe6edabb8ec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libuavcan_drivers/linux/apps/debug.hpp	Sat Apr 14 10:25:32 2018 +0000
@@ -0,0 +1,14 @@
+/*
+ * Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
+ */
+
+#pragma once
+
+#include <stdexcept>
+
+#ifndef STRINGIZE
+#  define STRINGIZE2(x)   #x
+#  define STRINGIZE(x)    STRINGIZE2(x)
+#endif
+#define ENFORCE(x) if (!(x)) { throw std::runtime_error(__FILE__ ":" STRINGIZE(__LINE__) ": " #x); }
+