1 /*BEGIN_LEGAL 2 3 Copyright (c) 2018 Intel Corporation 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 END_LEGAL */ 18 /// @file xed-common-hdrs.h 19 /// 20 21 22 23 #ifndef XED_COMMON_HDRS_H 24 # define XED_COMMON_HDRS_H 25 26 27 28 #if defined(__FreeBSD__) || defined(__NetBSD__) 29 # define XED_BSD 30 #endif 31 #if defined(__linux__) 32 # define XED_LINUX 33 #endif 34 #if defined(_MSC_VER) 35 # define XED_WINDOWS 36 #endif 37 #if defined(__APPLE__) 38 # define XED_MAC 39 #endif 40 41 42 #if defined(XED_DLL) 43 // __declspec(dllexport) works with GNU GCC or MS compilers, but not ICC 44 // on linux 45 46 # if defined(XED_WINDOWS) 47 # define XED_DLL_EXPORT __declspec(dllexport) 48 # define XED_DLL_IMPORT __declspec(dllimport) 49 # elif defined(XED_LINUX) || defined(XED_BSD) || defined(XED_MAC) 50 # define XED_DLL_EXPORT __attribute__((visibility("default"))) 51 # define XED_DLL_IMPORT 52 # else 53 # define XED_DLL_EXPORT 54 # define XED_DLL_IMPORT 55 # endif 56 57 # if defined(XED_BUILD) 58 /* when building XED, we export symbols */ 59 # define XED_DLL_GLOBAL XED_DLL_EXPORT 60 # else 61 /* when building XED clients, we import symbols */ 62 # define XED_DLL_GLOBAL XED_DLL_IMPORT 63 # endif 64 #else 65 # define XED_DLL_EXPORT 66 # define XED_DLL_IMPORT 67 # define XED_DLL_GLOBAL 68 #endif 69 70 #endif 71 72