fixes #439 exposing nn_sleep() was a mistake
Revert "fixes #437 inconsistent DLL linkage for nn_sleep"
This reverts commit 3d978156c04bd75052deaa1726f2b4b5bccc989c.
Revert "Allowed nn_sleep to be exported on Windows."
This reverts commit e3588bc987f60fa841c153df89a70c7a3f1eb02c.
diff --git a/Makefile.am b/Makefile.am
index 3971922..41cf5b3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -141,6 +141,7 @@
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 \
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index db1d995..ad23565 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -126,6 +126,7 @@
utils/random.c
utils/sem.h
utils/sem.c
+ utils/sleep.h
utils/sleep.c
utils/thread.h
utils/thread.c
diff --git a/src/core/poll.c b/src/core/poll.c
index b2342a8..cb61ddf 100644
--- a/src/core/poll.c
+++ b/src/core/poll.c
@@ -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)
diff --git a/src/nn.h b/src/nn.h
index ec5d12a..0271c03 100644
--- a/src/nn.h
+++ b/src/nn.h
@@ -357,7 +357,6 @@
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. */
diff --git a/src/utils/sleep.c b/src/utils/sleep.c
index eee3ec2..6ae30bc 100644
--- a/src/utils/sleep.c
+++ b/src/utils/sleep.c
@@ -20,7 +20,7 @@
IN THE SOFTWARE.
*/
-#include "../nn.h"
+#include "sleep.h"
#include "err.h"
#ifdef NN_HAVE_WINDOWS
diff --git a/src/utils/sleep.h b/src/utils/sleep.h
new file mode 100644
index 0000000..de943c4
--- /dev/null
+++ b/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
diff --git a/tools/tcpmuxd.c b/tools/tcpmuxd.c
index 00209f8..eb1401a 100644
--- a/tools/tcpmuxd.c
+++ b/tools/tcpmuxd.c
@@ -23,6 +23,7 @@
#include "../src/nn.h"
#include "../src/utils/err.h"
+#include "../src/utils/sleep.h"
#include <stdlib.h>
#include <stdio.h>