summaryrefslogtreecommitdiff
path: root/src/settings.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2018-02-27 22:53:14 -0800
committerVito Caputo <vcaputo@pengaru.com>2018-02-27 23:03:10 -0800
commit6f39c7145f19a2644d36bde00a77f7514e1f4545 (patch)
tree783ef52d47b89aaf6822b4287a92825dc4bceac5 /src/settings.c
parentb18fc1ca50570b0674095ee87711e19ee95ae8df (diff)
*: make buildable for windows w/mingw32
strndup is missing, add trivial implementation signals are missing so fps counter is disabled for now
Diffstat (limited to 'src/settings.c')
-rw-r--r--src/settings.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/settings.c b/src/settings.c
index 7d87811..d8be774 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -5,6 +5,24 @@
#include <string.h>
#include "settings.h"
+#include "util.h"
+
+#ifdef __WIN32__
+char * strndup(const char *s, size_t n)
+{
+ size_t len;
+ char *buf;
+
+ len = MIN(strlen(s), n);
+ buf = calloc(len + 1, sizeof(char));
+ if (!buf)
+ return NULL;
+
+ memcpy(buf, s, len);
+
+ return buf;
+}
+#endif
/* Split form of key=value[,key=value...] settings string */
typedef struct settings_t {
© All Rights Reserved