2 * Copyright 2011 JANET(UK)
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file shibresolver/base.h
20 * Base header file definitions
21 * Must be included prior to including any other header
24 #ifndef __shibresolver_base_h__
25 #define __shibresolver_base_h__
27 #include <shibsp/base.h>
30 #if defined (_MSC_VER) || defined(__BORLANDC__)
31 #include <shibresolver/config_pub_win32.h>
33 #include <shibresolver/config_pub.h>
36 // Windows and GCC4 Symbol Visibility Macros
38 #define SHIBRESOLVER_IMPORT __declspec(dllimport)
39 #define SHIBRESOLVER_EXPORT __declspec(dllexport)
40 #define SHIBRESOLVER_DLLLOCAL
41 #define SHIBRESOLVER_DLLPUBLIC
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")))
49 #define SHIBRESOLVER_EXPORT
50 #define SHIBRESOLVER_DLLLOCAL
51 #define SHIBRESOLVER_DLLPUBLIC
55 // Define SHIBRESOLVER_API for DLL builds
56 #ifdef SHIBRESOLVER_EXPORTS
57 #define SHIBRESOLVER_API SHIBRESOLVER_EXPORT
59 #define SHIBRESOLVER_API SHIBRESOLVER_IMPORT
62 // Throwable classes must always be visible on GCC in all binaries
64 #define SHIBRESOLVER_EXCEPTIONAPI(api) api
65 #elif defined(GCC_HASCLASSVISIBILITY)
66 #define SHIBRESOLVER_EXCEPTIONAPI(api) SHIBRESOLVER_EXPORT
68 #define SHIBRESOLVER_EXCEPTIONAPI(api)
71 /** Logging category for Service Provider functions. */
72 #define SHIBRESOLVER_LOGCAT "ShibbolethResolver"
74 #endif /* __shibresolver_base_h__ */