summaryrefslogtreecommitdiff
path: root/misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'misc.h')
-rw-r--r--misc.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/misc.h b/misc.h
new file mode 100644
index 0000000..a42396d
--- /dev/null
+++ b/misc.h
@@ -0,0 +1,23 @@
+#ifndef UTILS_H
+#define UTILS_H
+
+//Signum function
+#ifdef WIN32
+extern _inline int sign(float i);
+#else
+extern inline int sign(float i);
+#endif
+
+#ifdef WIN32
+extern _inline unsigned clamp_flt(float f, float min, float max);
+#else
+extern inline unsigned clamp_flt(float f, float min, float max);
+#endif
+
+#ifdef WIN32
+extern _inline float restrict_flt(float f, float min, float max);
+#else
+extern inline float restrict_flt(float f, float min, float max);
+#endif
+
+#endif \ No newline at end of file