1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 #ifndef MEMCACHED_VISIBILITY_H
3 #define MEMCACHED_VISIBILITY_H 1
4 
5 /**
6  * VSC++ does not want extern to be specified for C++ classes exported
7  * via shared libraries. GNU does not mind.
8  * so MEMCACHED_PUBLIC_CLASS had to be added
9  */
10 
11 #if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)) || (defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x550))
12 #define MEMCACHED_PUBLIC_API __global
13 #define MEMCACHED_PUBLIC_CLASS __global
14 #elif defined __GNUC__
15 #define MEMCACHED_PUBLIC_API __attribute__ ((visibility("default")))
16 #define MEMCACHED_PUBLIC_CLASS __attribute__((visibility("default")))
17 #elif defined(_MSC_VER)
18 #define MEMCACHED_PUBLIC_API extern __declspec(dllexport)
19 #define MEMCACHED_PUBLIC_CLASS __declspec(dllexport)
20 #else
21 #define MEMCACHED_PUBLIC_API
22 #define MEMCACHED_PUBLIC_CLASS
23 #endif
24 
25 #endif /* MEMCACHED_VISIBILITY_H */
26