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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file shibresolver/base.h
19 * Base header file definitions
20 * Must be included prior to including any other header
23 #ifndef __shibresolver_base_h__
24 #define __shibresolver_base_h__
26 #include <shibsp/base.h>
29 #if defined (_MSC_VER) || defined(__BORLANDC__)
30 #include <shibresolver/config_pub_win32.h>
32 #include <shibresolver/config_pub.h>
35 // Windows and GCC4 Symbol Visibility Macros
37 #define SHIBRESOLVER_IMPORT __declspec(dllimport)
38 #define SHIBRESOLVER_EXPORT __declspec(dllexport)
39 #define SHIBRESOLVER_DLLLOCAL
40 #define SHIBRESOLVER_DLLPUBLIC
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")))
48 #define SHIBRESOLVER_EXPORT
49 #define SHIBRESOLVER_DLLLOCAL
50 #define SHIBRESOLVER_DLLPUBLIC
54 // Define SHIBRESOLVER_API for DLL builds
55 #ifdef SHIBRESOLVER_EXPORTS
56 #define SHIBRESOLVER_API SHIBRESOLVER_EXPORT
58 #define SHIBRESOLVER_API SHIBRESOLVER_IMPORT
61 // Throwable classes must always be visible on GCC in all binaries
63 #define SHIBRESOLVER_EXCEPTIONAPI(api) api
64 #elif defined(GCC_HASCLASSVISIBILITY)
65 #define SHIBRESOLVER_EXCEPTIONAPI(api) SHIBRESOLVER_EXPORT
67 #define SHIBRESOLVER_EXCEPTIONAPI(api)
70 /** Logging category for Service Provider functions. */
71 #define SHIBRESOLVER_LOGCAT "ShibbolethResolver"
73 #endif /* __shibresolver_base_h__ */