util: Fix strndup prototype on C++.
authorJose Fonseca <jfonseca@vmware.com>
Tue, 29 Sep 2015 15:01:22 +0000 (16:01 +0100)
committerJose Fonseca <jfonseca@vmware.com>
Tue, 29 Sep 2015 15:01:56 +0000 (16:01 +0100)
Trivial.

src/util/strndup.c
src/util/strndup.h

index 2c24d3789c2fd99fa974d9f2bb58dfde6387784f..ca1c6f53b575bb5e722944c568952c08df9680cd 100644 (file)
@@ -23,6 +23,7 @@
 
 #if defined(_WIN32)
 #include <stdlib.h>
+#include <string.h>
 #include "strndup.h"
 
 char *
index 54346823596e760387abcbb92d98ba00fb298da4..c5ed7a8c8d2323ba71c71598842bf6997b8867e0 100644 (file)
 
 #if defined(_WIN32)
 
-extern char *strndup(const char *str, size_t max);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char *strndup(const char *str, size_t max);
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif