From b639e4d3643b8245b77bc8707a3a864221fad195 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 13 Jan 2017 00:00:47 -0800 Subject: Many fixes for Windows. It compiles, and some tests work. Windows is getting there. Needs a couple of more more hours to enable everything, especially IPC, and most of the work at this point is probably some combination of debug and tweaking things like error handling. --- src/nng.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/nng.h') diff --git a/src/nng.h b/src/nng.h index 932c9a59..bf7bfa7b 100644 --- a/src/nng.h +++ b/src/nng.h @@ -30,8 +30,16 @@ extern "C" { // as a DLL, but instead linking it statically for your projects // to minimize questions about link dependencies later.) #ifndef NNG_DECL -#define NNG_DECL extern -#endif +#if defined(_WIN32) && !defined(NNG_STATIC_LIB) +#if defined(NNG_SHARED_LIB) +#define NNG_DECL __declspec(dllexport) +#else +#define NNG_DECL __declspec(dllimport) +#endif // NNG_SHARED_LIB +#else +#define NNG_DECL extern +#endif // _WIN32 && !NNG_STATIC_LIB +#endif // NNG_DECL // Types common to nng. typedef struct nng_socket nng_socket; @@ -64,10 +72,10 @@ NNG_DECL void nng_close(nng_socket *); NNG_DECL int nng_shutdown(nng_socket *); // nng_protocol returns the protocol number of the socket. -uint16_t nng_protocol(nng_socket *); +NNG_DECL uint16_t nng_protocol(nng_socket *); // nng_peer returns the protocol number for the socket's peer. -uint16_t nng_peer(nng_socket *); +NNG_DECL uint16_t nng_peer(nng_socket *); // nng_setopt sets an option for a specific socket. NNG_DECL int nng_setopt(nng_socket *, int, const void *, size_t); -- cgit v1.2.3-70-g09d2