My Project 1.7.4
C++ Distributed Hash Table
def.h
1#pragma once
2
3// Generic helper definitions for shared library support
4#if defined _WIN32 || defined __CYGWIN__
5 #define OPENDHT_IMPORT __declspec(dllimport)
6 #define OPENDHT_EXPORT __declspec(dllexport)
7 #define OPENDHT_HIDDEN
8#else
9 #define OPENDHT_IMPORT __attribute__ ((visibility ("default")))
10 #define OPENDHT_EXPORT __attribute__ ((visibility ("default")))
11 #define OPENDHT_HIDDEN __attribute__ ((visibility ("hidden")))
12#endif
13
14// Now we use the generic helper definitions above to define OPENDHT_PUBLIC and OPENDHT_LOCAL.
15// OPENDHT_PUBLIC is used for the public API symbols. It either DLL imports or DLL exports (or does nothing for static build)
16// OPENDHT_LOCAL is used for non-api symbols.
17
18#ifdef opendht_EXPORTS // defined if OpenDHT is compiled as a shared library
19 #ifdef OPENDHT_BUILD // defined if we are building the OpenDHT shared library (instead of using it)
20 #define OPENDHT_PUBLIC OPENDHT_EXPORT
21 #else
22 #define OPENDHT_PUBLIC OPENDHT_IMPORT
23 #endif // OPENDHT_BUILD
24 #define OPENDHT_LOCAL OPENDHT_HIDDEN
25#else // opendht_EXPORTS is not defined: this means OpenDHT is a static lib.
26 #define OPENDHT_PUBLIC
27 #define OPENDHT_LOCAL
28#endif // opendht_EXPORTS