Revert "fixes #717 NN_STATIC_LIB not properly handled on WIN32"
This reverts commit 722f87913395b84b193c0f39f9a2d68422a7264d.
(Not fully baked, needs work.)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb91a51..f9e642a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,14 +157,6 @@
set(NN_REQUIRED_LIBRARIES ${NN_REQUIRED_LIBRARIES} ws2_32)
set(NN_REQUIRED_LIBRARIES ${NN_REQUIRED_LIBRARIES} mswsock)
set(NN_REQUIRED_LIBRARIES ${NN_REQUIRED_LIBRARIES} advapi32)
-
- # Ensure tests/tools built as EXE choose symbol visibility appropriate for
- # linking the library, whether static or dynamic.
- if (NN_STATIC_LIB)
- add_definitions (-DNN_WIN32_LIB_LINK)
- else ()
- add_definitions (-DNN_WIN32_DLL_LINK)
- endif ()
else ()
# Unconditionally declare the following feature test macros. These are
# needed for some platforms (glibc and SunOS/illumos) and should be harmless
diff --git a/src/nn.h b/src/nn.h
index 7f0bbb8..067bea3 100644
--- a/src/nn.h
+++ b/src/nn.h
@@ -36,14 +36,10 @@
/* Handle DSO symbol visibility. */
#if !defined(NN_EXPORT)
-# if defined(_WIN32)
-# if defined(NN_STATIC_LIB)
-# define NN_EXPORT
-# elif defined(NN_WIN32_LIB_LINK)
-# define NN_EXPORT
-# elif defined(NN_SHARED_LIB)
+# if defined(_WIN32) && !defined(NN_STATIC_LIB)
+# if defined NN_SHARED_LIB
# define NN_EXPORT __declspec(dllexport)
-# else defined(NN_WIN32_DLL_LINK)
+# else
# define NN_EXPORT __declspec(dllimport)
# endif
# else