Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ghedini <alessandro@ghedini.me>2013-11-27 17:17:40 +0400
committerAlessandro Ghedini <alessandro@ghedini.me>2013-11-27 17:31:22 +0400
commit758f2f1022d09e1423f3cd8c5d52ca633e9fc317 (patch)
treecaba538917873316fa7e5af1bb96eabfbeda245d /src/posix.h
parenta2e873d1a15df03d7ecfac2a1bec56cf66b8cc40 (diff)
posix: Solaris doesn't have strnlen either
Diffstat (limited to 'src/posix.h')
-rw-r--r--src/posix.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/posix.h b/src/posix.h
index 14c92b93d..f529914fe 100644
--- a/src/posix.h
+++ b/src/posix.h
@@ -89,7 +89,12 @@ extern struct tm * p_gmtime_r (const time_t *timer, struct tm *result);
# include "unix/posix.h"
#endif
-#ifndef __MINGW32__
+#if defined(__MINGW32__) || defined(__sun)
+GIT_INLINE(size_t) p_strnlen(const char *s, size_t maxlen) {
+ const char *end = memchr(s, 0, maxlen);
+ return end ? (size_t)(end - s) : maxlen;
+}
+#else
# define p_strnlen strnlen
#endif