summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/misc.c b/misc.c
index fe50b32..ade3c3c 100644
--- a/misc.c
+++ b/misc.c
@@ -1,10 +1,12 @@
+#include <stdlib.h>
+#include <string.h>
#include "misc.h"
//Signum function
#ifdef WIN32
-_inline int sign(float i)
+_inline int isign(float i)
#else
-inline int sign(float i)
+inline int isign(float i)
#endif
{
if (i<0)
@@ -38,4 +40,16 @@ inline float restrict_flt(float f, float min, float max)
if(f>max)
return max;
return f;
+}
+
+char *mystrdup(char *s)
+{
+ char *x;
+ if(s)
+ {
+ x = malloc(strlen(s)+1);
+ strcpy(x, s);
+ return x;
+ }
+ return s;
} \ No newline at end of file