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