Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
9d36aad4
Commit
9d36aad4
authored
Dec 15, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libport: Add a replacement implementation for strnlen.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
acdbea2b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
0 deletions
+42
-0
configure
configure
+1
-0
configure.ac
configure.ac
+1
-0
config.h.in
include/config.h.in
+3
-0
port.h
include/wine/port.h
+5
-0
Makefile.in
libs/port/Makefile.in
+1
-0
strnlen.c
libs/port/strnlen.c
+31
-0
No files found.
configure
View file @
9d36aad4
...
...
@@ -15747,6 +15747,7 @@ for ac_func in \
strdup
\
strerror
\
strncasecmp
\
strnlen
\
strtold
\
strtoll
\
strtoull
\
...
...
configure.ac
View file @
9d36aad4
...
...
@@ -2125,6 +2125,7 @@ AC_CHECK_FUNCS(\
strdup \
strerror \
strncasecmp \
strnlen \
strtold \
strtoll \
strtoull \
...
...
include/config.h.in
View file @
9d36aad4
...
...
@@ -921,6 +921,9 @@
/* Define to 1 if you have the `strncasecmp' function. */
#undef HAVE_STRNCASECMP
/* Define to 1 if you have the `strnlen' function. */
#undef HAVE_STRNLEN
/* Define to 1 if you have the <stropts.h> header file. */
#undef HAVE_STROPTS_H
...
...
include/wine/port.h
View file @
9d36aad4
...
...
@@ -344,6 +344,10 @@ int strncasecmp(const char *str1, const char *str2, size_t n);
# endif
#endif
/* !defined(HAVE_STRNCASECMP) */
#ifndef HAVE_STRNLEN
size_t
strnlen
(
const
char
*
str
,
size_t
maxlen
);
#endif
/* !defined(HAVE_STRNLEN) */
#ifndef HAVE_STRERROR
const
char
*
strerror
(
int
err
);
#endif
/* !defined(HAVE_STRERROR) */
...
...
@@ -538,6 +542,7 @@ extern __int64 interlocked_cmpxchg64( __int64 *dest, __int64 xchg, __int64 compa
#define strcasecmp __WINE_NOT_PORTABLE(strcasecmp)
#define strerror __WINE_NOT_PORTABLE(strerror)
#define strncasecmp __WINE_NOT_PORTABLE(strncasecmp)
#define strnlen __WINE_NOT_PORTABLE(strnlen)
#define usleep __WINE_NOT_PORTABLE(usleep)
#endif
/* NO_LIBWINE_PORT */
...
...
libs/port/Makefile.in
View file @
9d36aad4
...
...
@@ -102,6 +102,7 @@ C_SRCS = \
strcasecmp.c
\
strerror.c
\
strncasecmp.c
\
strnlen.c
\
symlink.c
\
usleep.c
\
utf8.c
\
...
...
libs/port/strnlen.c
0 → 100644
View file @
9d36aad4
/*
* strnlen function
*
* Copyright 2017 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#ifndef HAVE_STRNLEN
size_t
strnlen
(
const
char
*
str
,
size_t
maxlen
)
{
const
char
*
ptr
=
memchr
(
str
,
0
,
maxlen
);
if
(
!
ptr
)
return
maxlen
;
return
ptr
-
str
;
}
#endif
/* HAVE_STRNLEN */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment