Files

182 lines
4.0 KiB
C++

// Copyright Onix Solutions Limited [OnixS]. All rights reserved.
//
// This software owned by Onix Solutions Limited [OnixS] and is
// protected by copyright law and international copyright treaties.
//
// Access to and use of the software is governed by the terms of the applicable
// OnixS Software Services Agreement (the Agreement) and Customer end user license
// agreements granting a non-assignable, non-transferable and non-exclusive license
// to use the software for it's own data processing purposes under the terms defined
// in the Agreement.
//
// Except as otherwise granted within the terms of the Agreement, copying or
// reproduction of any part of this source code or associated reference material
// to any other location for further reproduction or redistribution, and any
// amendments to this copyright notice, are expressly prohibited.
//
// Any reproduction or redistribution for sale or hiring of the Software not in
// accordance with the terms of the Agreement is a violation of copyright law.
//
#pragma once
#include <OnixS/CME/MDH/Export.h>
// Exporting services.
#if defined (_MSC_VER)
// Qualifiers for public/exported entities.
#define \
ONIXS_CMEMDH_EXPORTED_DECL(entity, typeName) \
entity ONIXS_CMEMDH_EXPORTED typeName
#define \
ONIXS_CMEMDH_INTERNAL_DECL(entity, typeName) \
entity ONIXS_CMEMDH_INTERNAL typeName
#else
#define \
ONIXS_CMEMDH_EXPORTED_DECL(entity, typeName) \
entity typeName
#define \
ONIXS_CMEMDH_INTERNAL_DECL(entity, typeName) \
entity typeName
#endif // Toolset selector.
// Common part of export-related decorations.
#define \
ONIXS_CMEMDH_EXPORTED_CLASS_DECL(typeName) \
ONIXS_CMEMDH_EXPORTED_DECL(class, typeName)
#define \
ONIXS_CMEMDH_EXPORTED_STRUCT_DECL(typeName) \
ONIXS_CMEMDH_EXPORTED_DECL(struct, typeName)
#define \
ONIXS_CMEMDH_EXPORTED_CLASS \
class ONIXS_CMEMDH_EXPORTED
#define \
ONIXS_CMEMDH_EXPORTED_STRUCT \
struct ONIXS_CMEMDH_EXPORTED
#define \
ONIXS_CMEMDH_INTERNAL_CLASS_DECL(typeName) \
ONIXS_CMEMDH_INTERNAL_DECL(class, typeName)
#define \
ONIXS_CMEMDH_INTERNAL_STRUCT_DECL(typeName) \
ONIXS_CMEMDH_INTERNAL_DECL(struct, typeName)
#define \
ONIXS_CMEMDH_INTERNAL_CLASS \
class ONIXS_CMEMDH_INTERNAL
#define \
ONIXS_CMEMDH_INTERNAL_STRUCT \
struct ONIXS_CMEMDH_INTERNAL
#if defined (ONIXS_CMEMDH_LTWT_AS_EXPORTED)
#define \
ONIXS_CMEMDH_LTWT_CLASS \
ONIXS_CMEMDH_EXPORTED_CLASS
#define \
ONIXS_CMEMDH_LTWT_STRUCT \
ONIXS_CMEMDH_EXPORTED_STRUCT
#define \
ONIXS_CMEMDH_LTWT_EXPORTED \
/* Nothing */
#define \
ONIXS_CMEMDH_LTWT_CLASS_DECL(name) \
ONIXS_CMEMDH_EXPORTED_CLASS_DECL(name)
#define \
ONIXS_CMEMDH_LTWT_STRUCT_DECL(name) \
ONIXS_CMEMDH_EXPORTED_STRUCT_DECL(name)
#else
#define \
ONIXS_CMEMDH_LTWT_CLASS \
class
#define \
ONIXS_CMEMDH_LTWT_STRUCT \
struct
#define \
ONIXS_CMEMDH_LTWT_EXPORTED \
ONIXS_CMEMDH_EXPORTED
#define \
ONIXS_CMEMDH_LTWT_CLASS_DECL(name) \
class name
#define \
ONIXS_CMEMDH_LTWT_STRUCT_DECL(name) \
struct name
#endif // ONIXS_CMEMDH_LTWT_AS_EXPORTED
// Structure packing.
#define \
ONIXS_CMEMDH_TO_STR(entity) \
#entity
#if defined (_MSC_VER)
#define \
ONIXS_CMEMDH_DATA_PACKING_BEGIN(alignment) \
__pragma(pack(push, alignment))
#define \
ONIXS_CMEMDH_DATA_PACKING_END \
__pragma(pack(pop))
#elif defined (__GNUC__) && (__GNUC__ >= 3)
#define \
ONIXS_CMEMDH_DATA_PACKING_BEGIN(alignment) \
_Pragma(ONIXS_CMEMDH_TO_STR(pack(push, alignment)))
#define \
ONIXS_CMEMDH_DATA_PACKING_END \
_Pragma("pack(pop)")
#else
#error \
Compiler toolset is not (yet) supported. \
Please contact support@onixs.biz for further assistance.
#endif
// A few decorations for better source-code crafting.
#define \
ONIXS_CMEMDH_NAMESPACE_BEGIN \
namespace OnixS { namespace CME { namespace MDH {
#define \
ONIXS_CMEMDH_NAMESPACE_END \
}}}
#define \
STD_NAMESPACE_BEGIN \
namespace std {
#define \
STD_NAMESPACE_END \
}