diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-13 00:00:47 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-13 00:00:47 -0800 |
| commit | b639e4d3643b8245b77bc8707a3a864221fad195 (patch) | |
| tree | aa21c05f7ce8a1fd388b1eb1189e38e66f79e068 /src/nng.h | |
| parent | 2bb6a23037656474a90d869c5147b32bae1a2e40 (diff) | |
| download | nng-b639e4d3643b8245b77bc8707a3a864221fad195.tar.gz nng-b639e4d3643b8245b77bc8707a3a864221fad195.tar.bz2 nng-b639e4d3643b8245b77bc8707a3a864221fad195.zip | |
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.
Diffstat (limited to 'src/nng.h')
| -rw-r--r-- | src/nng.h | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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); |
