Mesa (master): util: Fix strndup prototype on C++.
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Tue Sep 29 15:03:12 UTC 2015
Module: Mesa
Branch: master
Commit: 952366a60e0743ae025edaf370a233d0633edf7b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=952366a60e0743ae025edaf370a233d0633edf7b
Author: Jose Fonseca <jfonseca at vmware.com>
Date: Tue Sep 29 16:01:22 2015 +0100
util: Fix strndup prototype on C++.
Trivial.
---
src/util/strndup.c | 1 +
src/util/strndup.h | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/util/strndup.c b/src/util/strndup.c
index 2c24d37..ca1c6f5 100644
--- a/src/util/strndup.c
+++ b/src/util/strndup.c
@@ -23,6 +23,7 @@
#if defined(_WIN32)
#include <stdlib.h>
+#include <string.h>
#include "strndup.h"
char *
diff --git a/src/util/strndup.h b/src/util/strndup.h
index 5434682..c5ed7a8 100644
--- a/src/util/strndup.h
+++ b/src/util/strndup.h
@@ -27,6 +27,14 @@
#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
More information about the mesa-commit
mailing list