Updating for 1.0.2 release
[awesomized/libmemcached] / libmemcached-1.0 / 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 #pragma once
20
21 /**
22 *
23 * LIBMEMCACHED_API is used for the public API symbols. It either DLL imports or
24 * DLL exports (or does nothing for static build).
25 *
26 * LIBMEMCACHED_LOCAL is used for non-api symbols.
27 */
28
29 #if defined(BUILDING_LIBMEMCACHEDINTERNAL)
30 # if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
31 # define LIBMEMCACHED_API __attribute__ ((visibility("default")))
32 # define LIBMEMCACHED_LOCAL __attribute__ ((visibility("default")))
33 # elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
34 # define LIBMEMCACHED_API __global
35 # define LIBMEMCACHED_LOCAL __global
36 # elif defined(_MSC_VER)
37 # define LIBMEMCACHED_API extern __declspec(dllexport)
38 # define LIBMEMCACHED_LOCAL extern __declspec(dllexport)
39 # else
40 # define LIBMEMCACHED_API
41 # define LIBMEMCACHED_LOCAL
42 # endif
43 #else
44 # if defined(BUILDING_LIBMEMCACHED)
45 # if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
46 # define LIBMEMCACHED_API __attribute__ ((visibility("default")))
47 # define LIBMEMCACHED_LOCAL __attribute__ ((visibility("hidden")))
48 # elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
49 # define LIBMEMCACHED_API __global
50 # define LIBMEMCACHED_LOCAL __hidden
51 # elif defined(_MSC_VER)
52 # define LIBMEMCACHED_API extern __declspec(dllexport)
53 # define LIBMEMCACHED_LOCAL
54 # else
55 # define LIBMEMCACHED_API
56 # define LIBMEMCACHED_LOCAL
57 # endif /* defined(HAVE_VISIBILITY) */
58 # else /* defined(BUILDING_LIBMEMCACHED) */
59 # if defined(_MSC_VER)
60 # define LIBMEMCACHED_API extern __declspec(dllimport)
61 # define LIBMEMCACHED_LOCAL
62 # else
63 # define LIBMEMCACHED_API
64 # define LIBMEMCACHED_LOCAL
65 # endif /* defined(_MSC_VER) */
66 # endif /* defined(BUILDING_LIBMEMCACHED) */
67 #endif /* defined(BUILDING_LIBMEMCACHEDINTERNAL) */