diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-02-28 00:09:35 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-02-28 00:09:35 +0000 |
commit | 9eeb15369401d4f3f07d209e0298665394ed125a (patch) | |
tree | a759217b5f340ab359ceaf22e7feec7770b70cc9 /Build/source/libs/zziplib/zziplib-src | |
parent | f567ba9b2c68b5c79e8d00ced203e99a2125443f (diff) |
zziplib: support old solaris
git-svn-id: svn://tug.org/texlive/trunk@46760 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/zziplib/zziplib-src')
-rw-r--r-- | Build/source/libs/zziplib/zziplib-src/zzip/__string.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Build/source/libs/zziplib/zziplib-src/zzip/__string.h b/Build/source/libs/zziplib/zziplib-src/zzip/__string.h index 351b0c14162..294ac3943cf 100644 --- a/Build/source/libs/zziplib/zziplib-src/zzip/__string.h +++ b/Build/source/libs/zziplib/zziplib-src/zzip/__string.h @@ -18,6 +18,18 @@ #define _zzip_strndup strndup #else +#if defined(sun) || defined(__sun) +static size_t my_strnlen(const char* str, size_t maxlen) +{ + char *p = memchr(str, 0, maxlen); + if (p == NULL) + return maxlen; + else + return (p - str); +} +#define strnlen(x,y) my_strnlen((x),(y)) +#endif /* sun || __sun */ + /* if your system does not have strndup: */ zzip__new__ static char * _zzip_strndup(char const *p, size_t maxlen) |