Merge Trond
[m6w6/libmemcached] / libmemcached / visibility.h
1 /* LibMemcached
2 * Copyright (C) 2006-2009 Brian Aker
3 * All rights reserved.
4 *
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
7 *
8 * Summary: Interface for memcached server.
9 *
10 * Author: Trond Norbye
11 *
12 */
13
14 /**
15 * @file
16 * @brief Visibility control macros
17 */
18
19 #ifndef __LIBMEMCACHED_VISIBILITY_H
20 #define __LIBMEMCACHED_VISIBILITY_H
21
22 /**
23 *
24 * LIBMEMCACHED_API is used for the public API symbols. It either DLL imports or
25 * DLL exports (or does nothing for static build).
26 *
27 * LIBMEMCACHED_LOCAL is used for non-api symbols.
28 */
29
30 #if defined(BUILDING_LIBMEMCACHED)
31 # if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
32 # define LIBMEMCACHED_API __attribute__ ((visibility("default")))
33 # define LIBMEMCACHED_LOCAL __attribute__ ((visibility("hidden")))
34 # elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
35 # define LIBMEMCACHED_API __global
36 # define LIBMEMCACHED_LOCAL __hidden
37 # elif defined(_MSC_VER)
38 # define LIBMEMCACHED_API extern __declspec(dllexport)
39 # define LIBMEMCACHED_LOCAL
40 # else
41 # define LIBMEMCACHED_API
42 # define LIBMEMCACHED_LOCAL
43 # endif /* defined(HAVE_VISIBILITY) */
44 #else /* defined(BUILDING_LIBMEMCACHED) */
45 # if defined(_MSC_VER)
46 # define LIBMEMCACHED_API extern __declspec(dllimport)
47 # define LIBMEMCACHED_LOCAL
48 # else
49 # define LIBMEMCACHED_API
50 # define LIBMEMCACHED_LOCAL
51 # endif /* defined(_MSC_VER) */
52 #endif /* defined(BUILDING_LIBMEMCACHED) */
53
54 #endif /* __LIBMEMCACHED_VISIBILITY_H */