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
bf6bde3a
Commit
bf6bde3a
authored
May 14, 2018
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: unnecessary ifdefs regarding handling of int vs. SOCKET at various places
Solution: use a typedef instead
parent
e8877f78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
23 deletions
+7
-23
fd.hpp
src/fd.hpp
+3
-0
zmq.cpp
src/zmq.cpp
+4
-23
No files found.
src/fd.hpp
View file @
bf6bde3a
...
...
@@ -38,6 +38,9 @@ namespace zmq
{
#ifdef ZMQ_HAVE_WINDOWS
#if defined _MSC_VER && _MSC_VER <= 1400
///< \todo zmq.h uses SOCKET unconditionally, so probably VS versions before
/// VS2008 are unsupported anyway. Apart from that, this seems to depend on
/// the Windows SDK version rather than the VS version.
typedef
UINT_PTR
fd_t
;
enum
{
...
...
src/zmq.cpp
View file @
bf6bde3a
...
...
@@ -1219,13 +1219,8 @@ static int check_poller_registration_args (void *const poller_, void *const s_)
return
0
;
}
#if defined _WIN32
static
int
check_poller_fd_registration_args
(
void
*
const
poller_
,
const
SOCKET
fd_
)
#else
static
int
check_poller_fd_registration_args
(
void
*
const
poller_
,
const
int
fd_
)
#endif
const
zmq
::
fd_t
fd_
)
{
if
(
-
1
==
check_poller
(
poller_
))
return
-
1
;
...
...
@@ -1250,14 +1245,10 @@ int zmq_poller_add (void *poller_, void *s_, void *user_data_, short events_)
->
add
(
socket
,
user_data_
,
events_
);
}
#if defined _WIN32
int
zmq_poller_add_fd
(
void
*
poller_
,
SOCKET
fd_
,
zmq
::
fd_t
fd_
,
void
*
user_data_
,
short
events_
)
#else
int
zmq_poller_add_fd
(
void
*
poller_
,
int
fd_
,
void
*
user_data_
,
short
events_
)
#endif
{
if
(
-
1
==
check_poller_fd_registration_args
(
poller_
,
fd_
)
||
-
1
==
check_events
(
events_
))
...
...
@@ -1279,12 +1270,7 @@ int zmq_poller_modify (void *poller_, void *s_, short events_)
return
((
zmq
::
socket_poller_t
*
)
poller_
)
->
modify
(
socket
,
events_
);
}
#if defined _WIN32
int
zmq_poller_modify_fd
(
void
*
poller_
,
SOCKET
fd_
,
short
events_
)
#else
int
zmq_poller_modify_fd
(
void
*
poller_
,
int
fd_
,
short
events_
)
#endif
int
zmq_poller_modify_fd
(
void
*
poller_
,
zmq
::
fd_t
fd_
,
short
events_
)
{
if
(
-
1
==
check_poller_fd_registration_args
(
poller_
,
fd_
)
||
-
1
==
check_events
(
events_
))
...
...
@@ -1293,7 +1279,6 @@ int zmq_poller_modify_fd (void *poller_, int fd_, short events_)
return
((
zmq
::
socket_poller_t
*
)
poller_
)
->
modify_fd
(
fd_
,
events_
);
}
int
zmq_poller_remove
(
void
*
poller_
,
void
*
s_
)
{
if
(
-
1
==
check_poller_registration_args
(
poller_
,
s_
))
...
...
@@ -1304,11 +1289,7 @@ int zmq_poller_remove (void *poller_, void *s_)
return
((
zmq
::
socket_poller_t
*
)
poller_
)
->
remove
(
socket
);
}
#if defined _WIN32
int
zmq_poller_remove_fd
(
void
*
poller_
,
SOCKET
fd_
)
#else
int
zmq_poller_remove_fd
(
void
*
poller_
,
int
fd_
)
#endif
int
zmq_poller_remove_fd
(
void
*
poller_
,
zmq
::
fd_t
fd_
)
{
if
(
-
1
==
check_poller_fd_registration_args
(
poller_
,
fd_
))
return
-
1
;
...
...
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