XED
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
xed-common-hdrs.h
Go to the documentation of this file.
1 /*BEGIN_LEGAL
2 Intel Open Source License
3 
4 Copyright (c) 2002-2014 Intel Corporation. All rights reserved.
5 
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are
8 met:
9 
10 Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer. Redistributions
12 in binary form must reproduce the above copyright notice, this list of
13 conditions and the following disclaimer in the documentation and/or
14 other materials provided with the distribution. Neither the name of
15 the Intel Corporation nor the names of its contributors may be used to
16 endorse or promote products derived from this software without
17 specific prior written permission.
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR
23 ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 END_LEGAL */
33 
34 
35 
36 #ifndef _XED_COMMON_HDRS_H_
37 # define _XED_COMMON_HDRS_H_
38 
39 
40 
41 #if defined(__FreeBSD__)
42 # define XED_BSD
43 #endif
44 #if defined(__linux__)
45 # define XED_LINUX
46 #endif
47 #if defined(_MSC_VER)
48 # define XED_WINDOWS
49 #endif
50 #if defined(__APPLE__)
51 # define XED_MAC
52 #endif
53 
54 
55 #if defined(XED_DLL)
56 // __declspec(dllexport) works with GNU GCC or MS compilers, but not ICC
57 // on linux
58 
59 # if defined(XED_WINDOWS)
60 # define XED_DLL_EXPORT __declspec(dllexport)
61 # define XED_DLL_IMPORT __declspec(dllimport)
62 # elif defined(XED_LINUX) || defined(XED_BSD) || defined(XED_MAC)
63 # define XED_DLL_EXPORT __attribute__((visibility("default")))
64 # define XED_DLL_IMPORT
65 # else
66 # define XED_DLL_EXPORT
67 # define XED_DLL_IMPORT
68 # endif
69 
70 # if defined(XED_BUILD)
71  /* when building XED, we export symbols */
72 # define XED_DLL_GLOBAL XED_DLL_EXPORT
73 # else
74  /* when building XED clients, we import symbols */
75 # define XED_DLL_GLOBAL XED_DLL_IMPORT
76 # endif
77 #else
78 # define XED_DLL_EXPORT
79 # define XED_DLL_IMPORT
80 # define XED_DLL_GLOBAL
81 #endif
82 
83 
84 #if !defined(XED_MESSAGES)
85 # define XED_MESSAGES 0
86 #endif
87 
88 #if defined(XED_OMIT_ENCODER)
89  /* do not emit an encoder */
90 #else
91 # define XED_ENCODER
92 #endif
93 
94 #if defined(XED_OMIT_DECODER)
95  /* do not emit a decoder */
96 #else
97 # define XED_DECODER
98 #endif
99 
100 #endif
101