Skip to content

Commit

Permalink
fixes #439 exposing nn_sleep() was a mistake
Browse files Browse the repository at this point in the history
Revert "fixes #437 inconsistent DLL linkage for nn_sleep"
This reverts commit 3d97815.

Revert "Allowed nn_sleep to be exported on Windows."
This reverts commit e3588bc.
  • Loading branch information
gdamore committed Jul 22, 2015
1 parent 3d97815 commit 25de63f
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Expand Up @@ -141,6 +141,7 @@ NANOMSG_UTILS = \
src/utils/random.c \
src/utils/sem.h \
src/utils/sem.c \
src/utils/sleep.h \
src/utils/sleep.c \
src/utils/stopwatch.h \
src/utils/stopwatch.c \
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Expand Up @@ -126,6 +126,7 @@ set (NN_SOURCES
utils/random.c
utils/sem.h
utils/sem.c
utils/sleep.h
utils/sleep.c
utils/thread.h
utils/thread.c
Expand Down
1 change: 1 addition & 0 deletions src/core/poll.c
Expand Up @@ -26,6 +26,7 @@

#include "../utils/win.h"
#include "../utils/fast.h"
#include "../utils/sleep.h"
#include "../utils/err.h"

int nn_poll (struct nn_pollfd *fds, int nfds, int timeout)
Expand Down
1 change: 0 additions & 1 deletion src/nn.h
Expand Up @@ -357,7 +357,6 @@ NN_EXPORT int nn_send (int s, const void *buf, size_t len, int flags);
NN_EXPORT int nn_recv (int s, void *buf, size_t len, int flags);
NN_EXPORT int nn_sendmsg (int s, const struct nn_msghdr *msghdr, int flags);
NN_EXPORT int nn_recvmsg (int s, struct nn_msghdr *msghdr, int flags);
NN_EXPORT void nn_sleep (int milliseconds);

/******************************************************************************/
/* Socket mutliplexing support. */
Expand Down
2 changes: 1 addition & 1 deletion src/utils/sleep.c
Expand Up @@ -20,7 +20,7 @@
IN THE SOFTWARE.
*/

#include "../nn.h"
#include "sleep.h"
#include "err.h"

#ifdef NN_HAVE_WINDOWS
Expand Down
30 changes: 30 additions & 0 deletions src/utils/sleep.h
@@ -0,0 +1,30 @@
/*
Copyright (c) 2012 Martin Sustrik All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/

#ifndef NN_SLEEP_INCLUDED
#define NN_SLEEP_INCLUDED

/* Platform independent implementation of sleeping. */

void nn_sleep (int milliseconds);

#endif
1 change: 1 addition & 0 deletions tools/tcpmuxd.c
Expand Up @@ -23,6 +23,7 @@
#include "../src/nn.h"

#include "../src/utils/err.h"
#include "../src/utils/sleep.h"

#include <stdlib.h>
#include <stdio.h>
Expand Down

0 comments on commit 25de63f

Please sign in to comment.