Couchbase C Client  2.5.6
visibility.h
1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3  * Copyright (C) 2011 Couchbase, Inc
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef LIBCOUCHBASE_VISIBILITY_H
18 #define LIBCOUCHBASE_VISIBILITY_H
19 
20 #ifdef LIBCOUCHBASE_STATIC
21 #define LIBCOUCHBASE_API
22 #define LCB_EXTERN_VAR extern
23 #else
24 
25 #ifdef LIBCOUCHBASE_INTERNAL
26  #ifdef __SUNPRO_C
27  #define LIBCOUCHBASE_API __global
28  #elif defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
29  #define LIBCOUCHBASE_API __attribute__ ((visibility("default")))
30  #elif defined(_MSC_VER)
31  #define LIBCOUCHBASE_API extern __declspec(dllexport)
32  #else
33  #define LIBCOUCHBASE_API
34  #endif /* compiler version */
35 
36 #else /* !LIBCOUCHBASE_INTERNAL */
37  #ifdef _MSC_VER
38  #define LIBCOUCHBASE_API extern __declspec(dllimport)
39  #else
40  #define LIBCOUCHBASE_API
41  #endif
42 #endif /* LIBCOUCHBASE_INTERNAL */
43 
44 /* Define LCB_EXTERN_VAR only if !LIBCOUCHBASE_STATIC */
45 #ifdef _MSC_VER
46 /* Already includes 'extern' in LIBCOUCHBASE_API def, don't use it twice! */
47  #define LCB_EXTERN_VAR
48 #else
49  #define LCB_EXTERN_VAR extern
50 #endif /* _MSC_VER */
51 #endif /* !LIBCOUCHBASE_STATIC */
52 
57 #define LCB_INTERNAL_API LIBCOUCHBASE_API
58 
59 #endif