Squashed 'third_party/osqp/' content from commit 33454b3e23
Change-Id: I056df0582ca06664e86554c341a94c47ab932001
git-subtree-dir: third_party/osqp
git-subtree-split: 33454b3e236f1f44193bfbbb6b8c8e71f8f04e9a
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/include/error.h b/include/error.h
new file mode 100644
index 0000000..9d7879f
--- /dev/null
+++ b/include/error.h
@@ -0,0 +1,38 @@
+#ifndef ERROR_H
+# define ERROR_H
+
+/* OSQP error handling */
+
+# ifdef __cplusplus
+extern "C" {
+# endif // ifdef __cplusplus
+
+# include "types.h"
+
+
+/* OSQP error macro */
+# if __STDC_VERSION__ >= 199901L
+/* The C99 standard gives the __func__ macro, which is preferred over __FUNCTION__ */
+# define osqp_error(error_code) _osqp_error(error_code, __func__);
+#else
+# define osqp_error(error_code) _osqp_error(error_code, __FUNCTION__);
+#endif
+
+
+
+/**
+ * Internal function to print error description and return error code.
+ * @param Error code
+ * @param Function name
+ * @return Error code
+ */
+ c_int _osqp_error(enum osqp_error_type error_code,
+ const char * function_name);
+
+
+
+# ifdef __cplusplus
+}
+# endif // ifdef __cplusplus
+
+#endif // ifndef ERROR_H