Add GSS context extraction.
[shibboleth/cpp-sp-resolver.git] / src / shibresolver / base.h
1 /*
2  *  Copyright 2011 JANET(UK)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /**
18  * @file shibresolver/base.h
19  *
20  * Base header file definitions
21  * Must be included prior to including any other header
22  */
23
24 #ifndef __shibresolver_base_h__
25 #define __shibresolver_base_h__
26
27 #include <shibsp/base.h>
28
29
30 #if defined (_MSC_VER) || defined(__BORLANDC__)
31   #include <shibresolver/config_pub_win32.h>
32 #else
33   #include <shibresolver/config_pub.h>
34 #endif
35
36 // Windows and GCC4 Symbol Visibility Macros
37 #ifdef WIN32
38   #define SHIBRESOLVER_IMPORT __declspec(dllimport)
39   #define SHIBRESOLVER_EXPORT __declspec(dllexport)
40   #define SHIBRESOLVER_DLLLOCAL
41   #define SHIBRESOLVER_DLLPUBLIC
42 #else
43   #define SHIBRESOLVER_IMPORT
44   #ifdef GCC_HASCLASSVISIBILITY
45     #define SHIBRESOLVER_EXPORT __attribute__ ((visibility("default")))
46     #define SHIBRESOLVER_DLLLOCAL __attribute__ ((visibility("hidden")))
47     #define SHIBRESOLVER_DLLPUBLIC __attribute__ ((visibility("default")))
48   #else
49     #define SHIBRESOLVER_EXPORT
50     #define SHIBRESOLVER_DLLLOCAL
51     #define SHIBRESOLVER_DLLPUBLIC
52   #endif
53 #endif
54
55 // Define SHIBRESOLVER_API for DLL builds
56 #ifdef SHIBRESOLVER_EXPORTS
57   #define SHIBRESOLVER_API SHIBRESOLVER_EXPORT
58 #else
59   #define SHIBRESOLVER_API SHIBRESOLVER_IMPORT
60 #endif
61
62 // Throwable classes must always be visible on GCC in all binaries
63 #ifdef WIN32
64   #define SHIBRESOLVER_EXCEPTIONAPI(api) api
65 #elif defined(GCC_HASCLASSVISIBILITY)
66   #define SHIBRESOLVER_EXCEPTIONAPI(api) SHIBRESOLVER_EXPORT
67 #else
68   #define SHIBRESOLVER_EXCEPTIONAPI(api)
69 #endif
70
71 /** Logging category for Service Provider functions. */
72 #define SHIBRESOLVER_LOGCAT "ShibbolethResolver"
73
74 #endif /* __shibresolver_base_h__ */