Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
17c47da0
Unverified
Commit
17c47da0
authored
Mar 18, 2019
by
Luca Boccassi
Committed by
GitHub
Mar 18, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3452 from jacquesg/strnlen
Problem: strnlen may not be available
parents
c1d2e718
b26542bb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
1 deletion
+18
-1
CMakeLists.txt
CMakeLists.txt
+4
-0
platform.hpp.in
builds/cmake/platform.hpp.in
+1
-0
configure.ac
configure.ac
+1
-1
ipc_address.cpp
src/ipc_address.cpp
+12
-0
No files found.
CMakeLists.txt
View file @
17c47da0
...
...
@@ -417,6 +417,10 @@ if(NOT MSVC)
set
(
CMAKE_REQUIRED_INCLUDES sys/socket.h
)
check_function_exists
(
accept4 HAVE_ACCEPT4
)
set
(
CMAKE_REQUIRED_INCLUDES
)
set
(
CMAKE_REQUIRED_INCLUDES string.h
)
check_function_exists
(
strnlen HAVE_STRNLEN
)
set
(
CMAKE_REQUIRED_INCLUDES
)
endif
()
add_definitions
(
-D_REENTRANT -D_THREAD_SAFE
)
...
...
builds/cmake/platform.hpp.in
View file @
17c47da0
...
...
@@ -49,6 +49,7 @@
#cmakedefine ZMQ_HAVE_PTHREAD_SETNAME_3
#cmakedefine ZMQ_HAVE_PTHREAD_SET_NAME
#cmakedefine HAVE_ACCEPT4
#cmakedefine HAVE_STRNLEN
#cmakedefine ZMQ_HAVE_OPENPGM
#cmakedefine ZMQ_MAKE_VALGRIND_HAPPY
...
...
configure.ac
View file @
17c47da0
...
...
@@ -675,7 +675,7 @@ AC_LANG_POP([C++])
# Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(perror gettimeofday clock_gettime memset socket getifaddrs freeifaddrs fork mkdtemp accept4)
AC_CHECK_FUNCS(perror gettimeofday clock_gettime memset socket getifaddrs freeifaddrs fork mkdtemp accept4
strnlen
)
AC_CHECK_HEADERS([alloca.h])
# pthread_setname is non-posix, and there are at least 4 different implementations
...
...
src/ipc_address.cpp
View file @
17c47da0
...
...
@@ -37,6 +37,18 @@
#include <string>
#ifndef HAVE_STRNLEN
static
size_t
strnlen
(
const
char
*
s
,
size_t
len
)
{
for
(
size_t
i
=
0
;
i
<
len
;
i
++
)
{
if
(
s
[
i
]
==
'\0'
)
return
i
+
1
;
}
return
len
;
}
#endif
zmq
::
ipc_address_t
::
ipc_address_t
()
{
memset
(
&
_address
,
0
,
sizeof
_address
);
...
...
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