OnixS C++ B3 BOE Binary Order Entry  1.2.0
API Documentation
ABI.h
Go to the documentation of this file.
1 #pragma once
2 /*
3 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
4 *
5 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
6 * and international copyright treaties.
7 *
8 * Access to and use of the software is governed by the terms of the applicable OnixS Software
9 * Services Agreement (the Agreement) and Customer end user license agreements granting
10 * a non-assignable, non-transferable and non-exclusive license to use the software
11 * for it's own data processing purposes under the terms defined in the Agreement.
12 *
13 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
14 * of this source code or associated reference material to any other location for further reproduction
15 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
16 *
17 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
18 * the terms of the Agreement is a violation of copyright law.
19 */
20 
21 #include <OnixS/B3/BOE/Export.h>
22 #include <OnixS/B3/BOE/Compiler.h>
23 
24 #if defined (_MSC_VER)
25 
26 #define ONIXS_B3_BOE_API_DECL(typeKind, typeName) \
27  typeKind ONIXS_B3_BOE_EXPORTED typeName
28 #else
29 #define ONIXS_B3_BOE_API_DECL(typeKind, typeName) \
30  typeKind typeName
31 #endif
32 
33 // Common part of export-related decorations.
34 
35 #define \
36  ONIXS_B3_BOE_EXPORTED_CLASS_DECL(typeName) \
37  ONIXS_B3_BOE_EXPORTED_DECL(class, typeName)
38 
39 #define \
40  ONIXS_B3_BOE_EXPORTED_STRUCT_DECL(typeName) \
41  ONIXS_B3_BOE_EXPORTED_DECL(struct, typeName)
42 
43 #define \
44  ONIXS_B3_BOE_EXPORTED_CLASS \
45  class ONIXS_B3_BOE_EXPORTED
46 
47 #define \
48  ONIXS_B3_BOE_EXPORTED_STRUCT \
49  struct ONIXS_B3_BOE_EXPORTED
50 
51 #define \
52  ONIXS_B3_BOE_INTERNAL_CLASS_DECL(typeName) \
53  class typeName
54 
55 #define \
56  ONIXS_B3_BOE_INTERNAL_STRUCT_DECL(typeName) \
57  struct typeName
58 
59 #if defined (ONIXS_B3_BOE_LTWT_AS_EXPORTED)
60 
61 #define \
62  ONIXS_B3_BOE_LTWT_CLASS \
63  ONIXS_B3_BOE_EXPORTED_CLASS
64 
65 #define \
66  ONIXS_B3_BOE_LTWT_STRUCT \
67  ONIXS_B3_BOE_EXPORTED_STRUCT
68 
69 #define \
70  ONIXS_B3_BOE_LTWT_EXPORTED \
71  /* Nothing */
72 
73 #define \
74  ONIXS_B3_BOE_LTWT_CLASS_DECL(name) \
75  ONIXS_B3_BOE_EXPORTED_CLASS_DECL(name)
76 
77 #define \
78  ONIXS_B3_BOE_LTWT_STRUCT_DECL(name) \
79  ONIXS_B3_BOE_EXPORTED_STRUCT_DECL(name)
80 
81 #else
82 
83 #define \
84  ONIXS_B3_BOE_LTWT_CLASS \
85  class ONIXS_B3_BOE_GCC44_SPURIOUS_WARNING_TURNAROUND
86 
87 #define \
88  ONIXS_B3_BOE_LTWT_STRUCT \
89  struct ONIXS_B3_BOE_GCC44_SPURIOUS_WARNING_TURNAROUND
90 
91 #define \
92  ONIXS_B3_BOE_LTWT_EXPORTED \
93  ONIXS_B3_BOE_EXPORTED
94 
95 #define \
96  ONIXS_B3_BOE_LTWT_CLASS_DECL(name) \
97  class name
98 
99 #define \
100  ONIXS_B3_BOE_LTWT_STRUCT_DECL(name) \
101  struct name
102 
103 #endif // ONIXS_B3_BOE_LTWT_AS_EXPORTED
104 
105 // Structure packing.
106 
107 #define \
108  ONIXS_B3_BOE_TO_STR(entity) \
109  #entity
110 
111 #if defined (_MSC_VER)
112 
113 #define \
114  ONIXS_B3_BOE_DATA_PACKING_BEGIN(alignment) \
115  __pragma(pack(push, alignment))
116 
117 #define \
118  ONIXS_B3_BOE_DATA_PACKING_END \
119  __pragma(pack(pop))
120 
121 #elif defined (__GNUC__) && (__GNUC__ >= 3)
122 
123 #define \
124  ONIXS_B3_BOE_DATA_PACKING_BEGIN(alignment) \
125  _Pragma(ONIXS_B3_BOE_TO_STR(pack(push, alignment)))
126 
127 #define \
128  ONIXS_B3_BOE_DATA_PACKING_END \
129  _Pragma("pack(pop)")
130 
131 #else
132 
133 #error \
134  Compiler toolset is not (yet) supported. \
135  Please contact support@onixs.biz for further assistance.
136 
137 #endif
138 
139 #define \
140  ONIXS_B3_BOE_MESSAGING_NAMESPACE_BEGIN \
141  namespace OnixS { namespace B3 { namespace BOE { namespace Messaging {
142 
143 #define \
144  ONIXS_B3_BOE_MESSAGING_NAMESPACE_END \
145  }}}}