Rearranged some things and added the visibility.m4 macros. Started to lay the
[m6w6/libmemcached] / libmemcached / visibility.h
1 /*
2 * Summary: interface for memcached server
3 * Description: visibitliy macros for libmemcached
4 *
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in this directory for full text.
7 *
8 * Author: Monty Taylor
9 */
10
11 /**
12 * @file
13 * @brief Visibility control macros
14 */
15
16 #ifndef __LIBMEMCACHED_VISIBILITY_H
17 #define __LIBMEMCACHED_VISIBILITY_H
18
19 /**
20 *
21 * LIBMEMCACHED_API is used for the public API symbols. It either DLL imports or
22 * DLL exports (or does nothing for static build).
23 *
24 * LIBMEMCACHED_LOCAL is used for non-api symbols.
25 */
26
27 #if defined(BUILDING_LIBMEMCACHED)
28 # if defined(HAVE_VISIBILITY)
29 # define LIBMEMCACHED_API __attribute__ ((visibility("default")))
30 # define LIBMEMCACHED_LOCAL __attribute__ ((visibility("hidden")))
31 # elif defined(_MSC_VER)
32 # define LIBMEMCACHED_API extern __declspec(dllexport)
33 # define LIBMEMCACHED_LOCAL
34 # endif /* defined(HAVE_VISIBILITY) */
35 #else /* defined(BUILDING_LIBMEMCACHED) */
36 # if defined(_MSC_VER)
37 # define LIBMEMCACHED_API extern __declspec(dllimport)
38 # define LIBMEMCACHED_LOCAL
39 # else
40 # define LIBMEMCACHED_API
41 # define LIBMEMCACHED_LOCAL
42 # endif /* defined(_MSC_VER) */
43 #endif /* defined(BUILDING_LIBMEMCACHED) */
44
45 #endif /* __LIBMEMCACHED_VISIBILITY_H */