Remove Activ libs and includes
This commit is contained in:
1 parent
28ed30c944
commit
4b718994be
10967 files changed
-2306716
No files matched your search
@@ -1,64 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Boost.h
|
||||
*
|
||||
* @brief Boost configuration header.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_MIDDLEWARE_BOOST_H)
|
||||
#define ACTIV_MIDDLEWARE_BOOST_H
|
||||
|
||||
// ACTIV's boost top-level include directory.
|
||||
#define ACTIV_BOOST_INCLUDE_DIR() ActivBoost
|
||||
|
||||
//! Use ACTIV_BOOST_INCLUDE to include a boost header.
|
||||
#define ACTIV_BOOST_INCLUDE(a) ACTIV_STRINGIZE(ACTIV_BOOST_INCLUDE_DIR()/a)
|
||||
|
||||
#include ACTIV_BOOST_INCLUDE(version.hpp)
|
||||
#include ACTIV_BOOST_INCLUDE(config.hpp)
|
||||
|
||||
#if (ACTIV_BOOST_VERSION_VALUE < ACTIV_MAKE_VERSION_VALUE(1, 78, 0, 0))
|
||||
#error Boost version not supported
|
||||
#endif
|
||||
|
||||
#define ACTIV_BOOST_NAMESPACE Boost
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Bind placeholders. Boost now put them in Boost::placeholders, but (for now) make available in Boost as that's what we used to do.
|
||||
#include ACTIV_BOOST_INCLUDE(bind/placeholders.hpp)
|
||||
|
||||
namespace ACTIV_BOOST_NAMESPACE
|
||||
{
|
||||
|
||||
using namespace placeholders;
|
||||
|
||||
} // namespace ACTIV_BOOST_NAMESPACE
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// NB: this include must be after the boost config.hpp include above.
|
||||
// Tripped over C4503 warnings in vc140 when memory was included before config.hpp.
|
||||
#include <memory>
|
||||
|
||||
//! Activ namespace.
|
||||
namespace Activ
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief Boost ptr_container only supports std::auto_ptr and std::unique_ptr (i.e. not emulated unique_ptr).
|
||||
* Since C++17 has no std::auto_ptr, we need a helper type that will work across standard versions.
|
||||
*/
|
||||
template<typename T>
|
||||
class BoostPtrContainerSmartPtr
|
||||
{
|
||||
public:
|
||||
#if (defined ACTIV_BOOST_NO_CXX11_SMART_PTR)
|
||||
typedef std::auto_ptr<T> type;
|
||||
#else
|
||||
typedef std::unique_ptr<T> type;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace Activ
|
||||
|
||||
#endif // (!defined ACTIV_MIDDLEWARE_BOOST_H)
|
||||
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Compilers/Clang.h
|
||||
*
|
||||
* @brief Clang configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_COMPILERS_CLANG_H)
|
||||
#define ACTIV_CONFIG_COMPILERS_CLANG_H
|
||||
|
||||
#if (defined ACTIV_PLATFORM_OSX)
|
||||
|
||||
#if ((ACTIV_CLANG_COMPILER_VERSION < ACTIV_MAKE_CLANG_COMPILER_VERSION(5, 0)) || \
|
||||
(ACTIV_CLANG_COMPILER_VERSION > ACTIV_MAKE_CLANG_COMPILER_VERSION(9, 0)))
|
||||
#error Clang version not supported
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#if ((ACTIV_CLANG_COMPILER_VERSION < ACTIV_MAKE_CLANG_COMPILER_VERSION(2, 0)) || \
|
||||
(ACTIV_CLANG_COMPILER_VERSION > ACTIV_MAKE_CLANG_COMPILER_VERSION(17, 0)))
|
||||
#error Clang version not supported
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if (!defined ACTIV_COMPILER_NAME)
|
||||
#if (defined __VERSION__)
|
||||
#define ACTIV_COMPILER_NAME "Clang " __clang_version__ " (g++ " __VERSION__ ")"
|
||||
#else
|
||||
#define ACTIV_COMPILER_NAME "Clang " __clang_version__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (!defined ACTIV_DECLARE_TEMPLATE_PARAMETER_FRIEND)
|
||||
// Clang will warn in pre-C++11, but allow it. GCC solution doesn't work at all.
|
||||
#define ACTIV_DECLARE_TEMPLATE_PARAMETER_FRIEND(T) friend T
|
||||
#endif
|
||||
|
||||
#if (defined __GNUC__)
|
||||
|
||||
// GCC-like frontend.
|
||||
#define ACTIV_COMPILER_GCC ACTIV_COMPILER_GCC_TAG
|
||||
|
||||
#include "GCC.h"
|
||||
|
||||
#else
|
||||
#error Configure Clang support.
|
||||
#endif
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_COMPILERS_CLANG_H)
|
||||
@@ -1,34 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Compilers/Emcc.h
|
||||
*
|
||||
* @brief Emscripten configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_COMPILERS_EMCC_H)
|
||||
#define ACTIV_CONFIG_COMPILERS_EMCC_H
|
||||
|
||||
#if (!defined ACTIV_COMPILER_NAME)
|
||||
#if (defined __VERSION__)
|
||||
#define ACTIV_COMPILER_NAME "emcc " ACTIV_STRINGIZE(__EMSCRIPTEN_major__) "." ACTIV_STRINGIZE(__EMSCRIPTEN_minor__) \
|
||||
" (" __VERSION__ ")"
|
||||
#else
|
||||
#define ACTIV_COMPILER_NAME "emcc " ACTIV_STRINGIZE(__EMSCRIPTEN_major__) "." ACTIV_STRINGIZE(__EMSCRIPTEN_minor__)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (defined __clang__)
|
||||
|
||||
// clang-like.
|
||||
#define ACTIV_COMLILER_CLANG ACTIV_COMPILER_CLANG_TAG
|
||||
|
||||
#define ACTIV_EXPLICIT_INSTANTIATE_SIZE_T
|
||||
|
||||
#include "Clang.h"
|
||||
|
||||
#else
|
||||
|
||||
#error Configure emcc support
|
||||
|
||||
#endif
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_COMPILERS_EMCC_H)
|
||||
@@ -1,161 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Compilers/GCC.h
|
||||
*
|
||||
* @brief GNU C++ configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_COMPILERS_GCC_H)
|
||||
#define ACTIV_CONFIG_COMPILERS_GCC_H
|
||||
|
||||
#if (!defined ACTIV_COMPILER_CLANG && !defined ACTIV_COMPILER_EMCC && (ACTIV_GCC_COMPILER_VERSION < ACTIV_MAKE_GCC_COMPILER_VERSION(4, 3)))
|
||||
#error GCC version not supported
|
||||
#endif
|
||||
|
||||
#if (!defined ACTIV_COMPILER_NAME)
|
||||
#define ACTIV_COMPILER_NAME "GNU C++ " __VERSION__
|
||||
#endif
|
||||
|
||||
#if (!defined ACTIV_PLATFORM_WINDOWS)
|
||||
#define ACTIV_BUILDING_DLL_EXPORTED_API __attribute__ ((visibility("default")))
|
||||
#define ACTIV_BUILDING_DLL_INLINE_API __attribute__ ((visibility("hidden")))
|
||||
#define ACTIV_BUILDING_DLL_LOCAL_API __attribute__ ((visibility("hidden")))
|
||||
#define ACTIV_USING_DLL_EXPORTED_API
|
||||
#define ACTIV_USING_DLL_INLINE_API
|
||||
#define ACTIV_USING_DLL_LOCAL_API
|
||||
#else
|
||||
#define ACTIV_BUILDING_DLL_EXPORTED_API
|
||||
#define ACTIV_BUILDING_DLL_INLINE_API
|
||||
#define ACTIV_BUILDING_DLL_LOCAL_API
|
||||
#define ACTIV_USING_DLL_EXPORTED_API
|
||||
#define ACTIV_USING_DLL_INLINE_API
|
||||
#define ACTIV_USING_DLL_LOCAL_API
|
||||
#endif
|
||||
|
||||
#define ACTIV_BUILDING_LIB_EXPORTED_API
|
||||
#define ACTIV_BUILDING_LIB_INLINE_API
|
||||
#define ACTIV_BUILDING_LIB_LOCAL_API
|
||||
#define ACTIV_USING_LIB_EXPORTED_API
|
||||
#define ACTIV_USING_LIB_INLINE_API
|
||||
#define ACTIV_USING_LIB_LOCAL_API
|
||||
|
||||
/**
|
||||
* @brief Define rules for exporting template member functions.
|
||||
*
|
||||
* The Intel & Visual C++ compilers have different rules for __declspec exporting template
|
||||
* instantiations from dlls. Use ACTIV_TEMPLATE_API as a workaround, e.g.
|
||||
*
|
||||
* class Example
|
||||
* {
|
||||
* template \<typename T\>
|
||||
* ACTIV_TEMPLATE_API(MY_LIB_API) void Fn(T &);
|
||||
* };
|
||||
*
|
||||
* @param a __declspec macro, e.g. ACTIV_BASE_API.
|
||||
*/
|
||||
#define ACTIV_TEMPLATE_API(a) a
|
||||
|
||||
#if (!defined ACTIV_DECLARE_TEMPLATE_PARAMETER_FRIEND)
|
||||
#if (ACTIV_GCC_COMPILER_VERSION >= ACTIV_MAKE_GCC_COMPILER_VERSION(4, 7))
|
||||
#define ACTIV_DECLARE_TEMPLATE_PARAMETER_FRIEND(T) friend T
|
||||
#else
|
||||
namespace Activ
|
||||
{
|
||||
|
||||
template<typename T>
|
||||
class GccFriendWorkaround
|
||||
{
|
||||
public:
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
} // namespace Activ
|
||||
#define ACTIV_DECLARE_TEMPLATE_PARAMETER_FRIEND(T) friend class ::Activ::GccFriendWorkaround<T>::type
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//! Ensure a function is always inlined.
|
||||
#if (defined _DEBUG)
|
||||
#define ACTIV_FORCE_INLINE inline
|
||||
#else
|
||||
#define ACTIV_FORCE_INLINE inline __attribute__((__always_inline__))
|
||||
#endif
|
||||
|
||||
//! Ensure a function is never inlined.
|
||||
#define ACTIV_NEVER_INLINE __attribute__((__noinline__))
|
||||
|
||||
/**
|
||||
* @brief Specify that a function is a printf style function.
|
||||
*
|
||||
* @param type printf, scanf, strftime.
|
||||
* @param formatIndex for static or global functions, the 1-based index of the parameter containing the format specifier string.
|
||||
* For member functions, the 2-based index.
|
||||
* @param firstParameterIndex for static or global functions, the 1-based index of the parameter containing the first value to be
|
||||
* used by the format string. For member functions, the 2-based index.
|
||||
* Use 0 if the function takes a va_list of parameters.
|
||||
*/
|
||||
#define ACTIV_PRINTF_FUNCTION(type, formatIndex, firstParameterIndex) \
|
||||
__attribute__ ((format (type, formatIndex, firstParameterIndex)))
|
||||
|
||||
#define stricmp strcasecmp
|
||||
#define strnicmp strncasecmp
|
||||
|
||||
/**
|
||||
* @brief Give a hint that a switch case statement is likely.
|
||||
*
|
||||
* Usage:
|
||||
* switch (ACTIV_LIKELY_SWITCH_CASE(variable, 0))
|
||||
* {
|
||||
* case 0: <-- the expected case.
|
||||
* case 1:
|
||||
* ...
|
||||
* default:
|
||||
* }
|
||||
*
|
||||
* If the expected case statement is not present then default is the likely case.
|
||||
*
|
||||
* @param expr the expression under test.
|
||||
* @param expected the expected value of expr.
|
||||
*
|
||||
* @return expr
|
||||
*/
|
||||
#define ACTIV_LIKELY_SWITCH_CASE(expr, expected) __builtin_expect(expr, expected)
|
||||
|
||||
/**
|
||||
* @brief Give a hint that an expression is @a likely to be true.
|
||||
*
|
||||
* @param expr
|
||||
*/
|
||||
#define ACTIV_LIKELY(expr) __builtin_expect(!!(expr), 1)
|
||||
|
||||
/**
|
||||
* @brief Give a hint that an expression is @a unlikely to be true.
|
||||
*
|
||||
* @param expr
|
||||
*/
|
||||
#define ACTIV_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
|
||||
|
||||
// TODO: add _DEBUG case counting mispredicted cases.
|
||||
|
||||
//! Mark a function with the hot attribute.
|
||||
#define ACTIV_HOT __attribute__ ((hot))
|
||||
|
||||
//! Mark a function with the cold attribute.
|
||||
#define ACTIV_COLD __attribute__ ((cold))
|
||||
|
||||
// Pragma push/pop were added in gcc 4.6 but gcc < 5.0 has a bug where the "padded" warning is left enabled after the pop, see
|
||||
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59304.
|
||||
// Only apply padding warnings on 64 bit.
|
||||
#if (ACTIV_GCC_COMPILER_VERSION >= ACTIV_MAKE_GCC_COMPILER_VERSION(5, 0)) && (ACTIV_PROCESSOR_WORD_SIZE == 64)
|
||||
|
||||
//! Start enablement of compiler error on struct padding.
|
||||
#define ACTIV_ENABLE_ERROR_ON_PADDING_START \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic error \"-Wpadded\"")
|
||||
|
||||
//! End enablement of compiler error on struct padding.
|
||||
#define ACTIV_ENABLE_ERROR_ON_PADDING_END \
|
||||
_Pragma("GCC diagnostic pop")
|
||||
|
||||
#endif // (ACTIV_GCC_COMPILER_VERSION >= ACTIV_MAKE_GCC_COMPILER_VERSION(5, 0))
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_COMPILERS_GCC_H)
|
||||
@@ -1,76 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Compilers/Intel.h
|
||||
*
|
||||
* @brief Intel C++ Compiler configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_COMPILERS_INTEL_H)
|
||||
#define ACTIV_CONFIG_COMPILERS_INTEL_H
|
||||
|
||||
#if (__INTEL_COMPILER < 1310) || (__INTEL_COMPILER > 1400)
|
||||
#error Intel compiler version not supported
|
||||
#endif
|
||||
|
||||
#if (defined __GNUC__)
|
||||
|
||||
#if (!defined ACTIV_COMPILER_NAME)
|
||||
#define ACTIV_COMPILER_NAME "Intel C++ Compiler " ACTIV_STRINGIZE(__INTEL_COMPILER) " (g++ " ACTIV_STRINGIZE(__GNUC__) "." \
|
||||
ACTIV_STRINGIZE(__GNUC_MINOR__) ")"
|
||||
#endif
|
||||
|
||||
// GCC-like frontend.
|
||||
#define ACTIV_COMPILER_GCC ACTIV_COMPILER_GCC_TAG
|
||||
|
||||
// "warning #858: type qualifier on return type is meaningless".
|
||||
#pragma warning(disable:858)
|
||||
|
||||
// "warning #1170: invalid redeclaration of nested class".
|
||||
#pragma warning(disable:1170)
|
||||
|
||||
#include "GCC.h"
|
||||
|
||||
#else
|
||||
|
||||
#define ACTIV_BUILDING_DLL_EXPORTED_API __declspec (dllexport)
|
||||
#define ACTIV_BUILDING_DLL_INLINE_API
|
||||
#define ACTIV_BUILDING_DLL_LOCAL_API
|
||||
#define ACTIV_USING_DLL_EXPORTED_API __declspec (dllimport)
|
||||
#define ACTIV_USING_DLL_INLINE_API
|
||||
#define ACTIV_USING_DLL_LOCAL_API
|
||||
|
||||
#define ACTIV_BUILDING_LIB_EXPORTED_API
|
||||
#define ACTIV_BUILDING_LIB_INLINE_API
|
||||
#define ACTIV_BUILDING_LIB_LOCAL_API
|
||||
#define ACTIV_USING_LIB_EXPORTED_API
|
||||
#define ACTIV_USING_LIB_INLINE_API
|
||||
#define ACTIV_USING_LIB_LOCAL_API
|
||||
|
||||
/**
|
||||
* @brief Define rules for exporting template member functions.
|
||||
*
|
||||
* The Intel & Visual C++ compilers have different rules for __declspec exporting template
|
||||
* instantiations from dlls. Use ACTIV_TEMPLATE_API as a workaround, e.g.
|
||||
*
|
||||
* class Example
|
||||
* {
|
||||
* template \<typename T\>
|
||||
* ACTIV_TEMPLATE_API(MY_LIB_API) void Fn(T &);
|
||||
* };
|
||||
*
|
||||
* @param a __declspec macro, e.g. ACTIV_BASE_API.
|
||||
*/
|
||||
#define ACTIV_TEMPLATE_API(a)
|
||||
|
||||
#if (!defined ACTIV_DECLARE_TEMPLATE_PARAMETER_FRIEND)
|
||||
#define ACTIV_DECLARE_TEMPLATE_PARAMETER_FRIEND(T) friend T
|
||||
#endif
|
||||
|
||||
#define snprintf _snprintf
|
||||
#define vsnprintf _vsnprintf
|
||||
|
||||
// "C4355: 'this' : used in base member initializer list"
|
||||
#pragma warning(disable:4355)
|
||||
|
||||
#endif // (defined __GNUC__)
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_COMPILERS_INTEL_H)
|
||||
@@ -1,70 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Compilers/SunPro.h
|
||||
*
|
||||
* @brief SunPro C++ configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_COMPILERS_SUN_PRO_H)
|
||||
#define ACTIV_CONFIG_COMPILERS_SUN_PRO_H
|
||||
|
||||
#if (__SUNPRO_CC < 0x512)
|
||||
#error SunPro version not supported
|
||||
#endif
|
||||
|
||||
#define ACTIV_COMPILER_NAME "SunPro C++ " ACTIV_STRINGIZE(__SUNPRO_CC)
|
||||
|
||||
#define ACTIV_BUILDING_DLL_EXPORTED_API
|
||||
#define ACTIV_BUILDING_DLL_INLINE_API
|
||||
#define ACTIV_BUILDING_DLL_LOCAL_API
|
||||
#define ACTIV_USING_DLL_EXPORTED_API
|
||||
#define ACTIV_USING_DLL_INLINE_API
|
||||
#define ACTIV_USING_DLL_LOCAL_API
|
||||
|
||||
#define ACTIV_BUILDING_LIB_EXPORTED_API
|
||||
#define ACTIV_BUILDING_LIB_INLINE_API
|
||||
#define ACTIV_BUILDING_LIB_LOCAL_API
|
||||
#define ACTIV_USING_LIB_EXPORTED_API
|
||||
#define ACTIV_USING_LIB_INLINE_API
|
||||
#define ACTIV_USING_LIB_LOCAL_API
|
||||
|
||||
#if (defined ACTIV_PROCESSOR_X86_64)
|
||||
#define ACTIV_EXPLICIT_INSTANTIATE_SIZE_T
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Define rules for exporting template member functions.
|
||||
*
|
||||
* The Intel & Visual C++ compilers have different rules for __declspec exporting template
|
||||
* instantiations from dlls. Use ACTIV_TEMPLATE_API as a workaround, e.g.
|
||||
*
|
||||
* class Example
|
||||
* {
|
||||
* template \<typename T\>
|
||||
* ACTIV_TEMPLATE_API(MY_LIB_API) void Fn(T &);
|
||||
* };
|
||||
*
|
||||
* @param a __declspec macro, e.g. ACTIV_BASE_API.
|
||||
*/
|
||||
#define ACTIV_TEMPLATE_API(a)
|
||||
|
||||
/**
|
||||
* @brief Ensure a function is always inlined.
|
||||
*/
|
||||
#define ACTIV_FORCE_INLINE inline
|
||||
|
||||
/**
|
||||
* @brief Ensure a function is never inlined.
|
||||
*/
|
||||
#define ACTIV_NEVER_INLINE
|
||||
|
||||
#define _XOPEN_SOURCE
|
||||
#define _XOPEN_SOURCE_EXTENDED 1
|
||||
#define __EXTENSIONS__
|
||||
#define _POSIX_PTHREAD_SEMANTICS
|
||||
|
||||
#define __FUNCTION__ __func__
|
||||
|
||||
#define stricmp strcasecmp
|
||||
#define strnicmp strncasecmp
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_COMPILERS_SUN_PRO_H)
|
||||
@@ -1,118 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Compilers/VisualC.h
|
||||
*
|
||||
* @brief Microsoft Visual C++ configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_COMPILERS_VISUAL_C_H)
|
||||
#define ACTIV_CONFIG_COMPILERS_VISUAL_C_H
|
||||
|
||||
static_assert(ACTIV_MAKE_VISUAL_C_COMPILER_VERSION(11, 0) == 1700, "ACTIV_MAKE_VISUAL_C_COMPILER_VERSION incorrect for vc110");
|
||||
static_assert(ACTIV_MAKE_VISUAL_C_COMPILER_VERSION(12, 0) == 1800, "ACTIV_MAKE_VISUAL_C_COMPILER_VERSION incorrect for vc120");
|
||||
static_assert(ACTIV_MAKE_VISUAL_C_COMPILER_VERSION(14, 0) == 1900, "ACTIV_MAKE_VISUAL_C_COMPILER_VERSION incorrect for vc140");
|
||||
static_assert(ACTIV_MAKE_VISUAL_C_COMPILER_VERSION(14, 1) == 1910, "ACTIV_MAKE_VISUAL_C_COMPILER_VERSION incorrect for vc141");
|
||||
static_assert(ACTIV_MAKE_VISUAL_C_COMPILER_VERSION(14, 2) == 1920, "ACTIV_MAKE_VISUAL_C_COMPILER_VERSION incorrect for vc142");
|
||||
static_assert(ACTIV_MAKE_VISUAL_C_COMPILER_VERSION(14, 3) == 1930, "ACTIV_MAKE_VISUAL_C_COMPILER_VERSION incorrect for vc143");
|
||||
|
||||
#if (ACTIV_VISUAL_C_COMPILER_VERSION < 1910) || (ACTIV_VISUAL_C_COMPILER_VERSION >= 1940)
|
||||
#error VC++ version not supported. Check the behavior of ACTIV_MAKE_VISUAL_C_COMPILER_VERSION when adding a new compiler version.
|
||||
#endif
|
||||
|
||||
#define ACTIV_COMPILER_NAME "Microsoft C++ " ACTIV_STRINGIZE(ACTIV_VISUAL_C_COMPILER_VERSION)
|
||||
|
||||
#define ACTIV_BUILDING_DLL_EXPORTED_API __declspec (dllexport)
|
||||
#define ACTIV_BUILDING_DLL_INLINE_API
|
||||
#define ACTIV_BUILDING_DLL_LOCAL_API
|
||||
#define ACTIV_USING_DLL_EXPORTED_API __declspec (dllimport)
|
||||
#define ACTIV_USING_DLL_INLINE_API
|
||||
#define ACTIV_USING_DLL_LOCAL_API
|
||||
|
||||
#define ACTIV_BUILDING_LIB_EXPORTED_API
|
||||
#define ACTIV_BUILDING_LIB_INLINE_API
|
||||
#define ACTIV_BUILDING_LIB_LOCAL_API
|
||||
#define ACTIV_USING_LIB_EXPORTED_API
|
||||
#define ACTIV_USING_LIB_INLINE_API
|
||||
#define ACTIV_USING_LIB_LOCAL_API
|
||||
|
||||
/**
|
||||
* @brief Define rules for exporting template member functions.
|
||||
*
|
||||
* The Intel & Visual C++ compilers have different rules for __declspec exporting template
|
||||
* instantiations from dlls. Use ACTIV_TEMPLATE_API as a workaround, e.g.
|
||||
*
|
||||
* class Example
|
||||
* {
|
||||
* template \<typename T\>
|
||||
* ACTIV_TEMPLATE_API(MY_LIB_API) void Fn(T &);
|
||||
* };
|
||||
*
|
||||
* @param a __declspec macro, e.g. ACTIV_BASE_API.
|
||||
*/
|
||||
#define ACTIV_TEMPLATE_API(a) a
|
||||
|
||||
#if (!defined ACTIV_DECLARE_TEMPLATE_PARAMETER_FRIEND)
|
||||
#define ACTIV_DECLARE_TEMPLATE_PARAMETER_FRIEND(T) friend T
|
||||
#endif
|
||||
|
||||
//! Ensure a function is always inlined.
|
||||
#define ACTIV_FORCE_INLINE __forceinline
|
||||
|
||||
//! Ensure a function is never inlined.
|
||||
#define ACTIV_NEVER_INLINE __declspec(noinline)
|
||||
|
||||
#define ACTIV_HAS_INTTYPES_H
|
||||
|
||||
// Turn off annoying "C4355: 'this' : used in base member initializer list" warning.
|
||||
#pragma warning(disable:4355)
|
||||
|
||||
// Turn off annoying "C4163: not available as an intrinsic function" warning.
|
||||
#pragma warning(disable:4163)
|
||||
|
||||
// Turn off annoying "C4996: : 'blah' was declared deprecated" warning.
|
||||
#pragma warning(disable:4996)
|
||||
|
||||
// Turn off annoying "warning C4258: 'iter' : definition from the for loop is ignored..." warning.
|
||||
#pragma warning(disable:4258)
|
||||
|
||||
// Turn off annoying "warning C4309: 'static_cast' : truncation of constant value" warning.
|
||||
#pragma warning(disable:4309)
|
||||
|
||||
#if (ACTIV_VISUAL_C_COMPILER_VERSION < ACTIV_MAKE_VISUAL_C_COMPILER_VERSION(14, 2))
|
||||
// VS2015, VS2017: Bug in dbghelp.h. "warning C4091: 'typedef ': ignored on left of '' when no variable is declared".
|
||||
#pragma warning(disable:4091)
|
||||
#endif
|
||||
|
||||
#if (!defined _CRT_SECURE_NO_DEPRECATE)
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#if (defined _M_CEE)
|
||||
// nullptr has issues with /CLR.
|
||||
#define ACTIV_NULLPTR __nullptr
|
||||
#endif
|
||||
|
||||
#if (defined _MSVC_LANG)
|
||||
// __cplusplus is always 199711L unless the /Zc:__cplusplus compiler option is enabled.
|
||||
// Use ACTIV_CPLUSPLUS instead.
|
||||
#define ACTIV_CPLUSPLUS _MSVC_LANG
|
||||
#else
|
||||
// Assume version is large enough for C++11.
|
||||
#define ACTIV_CPLUSPLUS ACTIV_CPLUSPLUS_11
|
||||
#endif
|
||||
|
||||
// It seems that _Pragma is not available in vc141.
|
||||
// Only apply padding warnings on 64 bit.
|
||||
#if (ACTIV_VISUAL_C_COMPILER_VERSION >= ACTIV_MAKE_VISUAL_C_COMPILER_VERSION(14, 2)) && (ACTIV_PROCESSOR_WORD_SIZE == 64)
|
||||
|
||||
//! Start enablement of compiler error on struct padding.
|
||||
#define ACTIV_ENABLE_ERROR_ON_PADDING_START \
|
||||
_Pragma("warning(push)") \
|
||||
_Pragma("warning(error:4820)")
|
||||
|
||||
//! End enablement of compiler error on struct padding.
|
||||
#define ACTIV_ENABLE_ERROR_ON_PADDING_END \
|
||||
_Pragma("warning(pop)")
|
||||
|
||||
#endif // (ACTIV_VISUAL_C_COMPILER_VERSION >= ACTIV_MAKE_VISUAL_C_COMPILER_VERSION(14, 2)) && (ACTIV_PROCESSOR_WORD_SIZE == 64)
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_COMPILERS_VISUAL_C_H)
|
||||
@@ -1,246 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Config.h
|
||||
*
|
||||
* @brief Processor, compiler and platform selection header file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_CONFIG_H)
|
||||
#define ACTIV_CONFIG_CONFIG_H
|
||||
|
||||
// ACTIV_CPLUSPLUS values.
|
||||
#define ACTIV_CPLUSPLUS_03 199711L
|
||||
#define ACTIV_CPLUSPLUS_11 201103L
|
||||
#define ACTIV_CPLUSPLUS_14 201402L
|
||||
#define ACTIV_CPLUSPLUS_17 201703L
|
||||
#define ACTIV_CPLUSPLUS_20 202002L
|
||||
|
||||
#if (defined __has_include)
|
||||
#define ACTIV_HAS_INCLUDE(file) __has_include(file)
|
||||
#else
|
||||
#define ACTIV_HAS_INCLUDE(file) 0
|
||||
#endif
|
||||
|
||||
// Select processor.
|
||||
#if (defined __amd64__) || (defined __x86_64__) || (defined _M_AMD64)
|
||||
#define ACTIV_PROCESSOR_X86_64
|
||||
#define ACTIV_PROCESSOR_NAME "x86-64"
|
||||
#define ACTIV_PROCESSOR_WORD_SIZE 64
|
||||
#elif (defined __i386__) || (defined __i386) || (defined _M_IX86)
|
||||
#define ACTIV_PROCESSOR_X86
|
||||
#define ACTIV_PROCESSOR_NAME "x86"
|
||||
#define ACTIV_PROCESSOR_WORD_SIZE 32
|
||||
#elif (defined __powerpc__) || (defined __ppc__)
|
||||
#define ACTIV_PROCESSOR_PPC
|
||||
#define ACTIV_PROCESSOR_NAME "PowerPC"
|
||||
#define ACTIV_PROCESSOR_WORD_SIZE 32
|
||||
#elif (defined __sparcv9) || ((defined __sparc__) && (defined __arch64__))
|
||||
#define ACTIV_PROCESSOR_SPARC64
|
||||
#define ACTIV_PROCESSOR_NAME "Sparc64"
|
||||
#define ACTIV_PROCESSOR_WORD_SIZE 64
|
||||
// ACTIV uses -xmemalign=8s, so we must align to 8 byte boundaries.
|
||||
#define ACTIV_REQUIRE_ALIGNED_MEMORY_ACCESS 8
|
||||
#elif (defined __sparc) || ((defined __sparc__) && (!defined __arch64__))
|
||||
#define ACTIV_PROCESSOR_SPARC
|
||||
#define ACTIV_PROCESSOR_NAME "Sparc"
|
||||
#define ACTIV_PROCESSOR_WORD_SIZE 32
|
||||
// ACTIV uses -xmemalign=8s, so we must align to 8 byte boundaries.
|
||||
#define ACTIV_REQUIRE_ALIGNED_MEMORY_ACCESS 8
|
||||
#elif (defined __ia64__) || (defined _M_IA64)
|
||||
#define ACTIV_PROCESSOR_IA64
|
||||
#define ACTIV_PROCESSOR_NAME "Itanium"
|
||||
#define ACTIV_PROCESSOR_WORD_SIZE 64
|
||||
#define ACTIV_REQUIRE_ALIGNED_MEMORY_ACCESS 8
|
||||
#elif (defined __arm__)
|
||||
#define ACTIV_PROCESSOR_ARM
|
||||
#define ACTIV_PROCESSOR_NAME "ARM"
|
||||
#define ACTIV_PROCESSOR_WORD_SIZE 32
|
||||
#define ACTIV_REQUIRE_ALIGNED_MEMORY_ACCESS 4
|
||||
#elif (defined __aarch64__)
|
||||
#define ACTIV_PROCESSOR_ARM64
|
||||
#define ACTIV_PROCESSOR_NAME "ARM64"
|
||||
#define ACTIV_PROCESSOR_WORD_SIZE 64
|
||||
#define ACTIV_REQUIRE_ALIGNED_MEMORY_ACCESS 8
|
||||
#elif (defined __asmjs__) || (defined __wasm__)
|
||||
#define ACTIV_PROCESSOR_WASM
|
||||
#define ACTIV_PROCESSOR_NAME "WebAssembly"
|
||||
#define ACTIV_PROCESSOR_WORD_SIZE __INTPTR_WIDTH__
|
||||
#else
|
||||
#error Need to configure for this processor
|
||||
#endif
|
||||
|
||||
// Supported compilers.
|
||||
|
||||
// Define the various compiler version making macros for all supported compilers,
|
||||
// to support compilers supporting compatible frontends.
|
||||
#define ACTIV_MAKE_CLANG_COMPILER_VERSION(major, minor) ((major * 100) + minor)
|
||||
#define ACTIV_CLANG_COMPILER_VERSION ACTIV_MAKE_CLANG_COMPILER_VERSION(__clang_major__, __clang_minor__)
|
||||
|
||||
#define ACTIV_MAKE_INTEL_COMPILER_VERSION(major, minor) ((major * 100) + minor)
|
||||
#define ACTIV_INTEL_COMPILER_VERSION __INTEL_COMPILER
|
||||
|
||||
#define ACTIV_MAKE_GCC_COMPILER_VERSION(major, minor) ((major * 100) + minor)
|
||||
#define ACTIV_GCC_COMPILER_VERSION ACTIV_MAKE_GCC_COMPILER_VERSION(__GNUC__, __GNUC_MINOR__)
|
||||
|
||||
#define ACTIV_MAKE_VISUAL_C_COMPILER_VERSION(major, minor) (((major * 100) + 500 + ((major >= 14) ? 0 : 100)) + (minor * 10))
|
||||
#define ACTIV_VISUAL_C_COMPILER_VERSION _MSC_VER
|
||||
|
||||
#define ACTIV_MAKE_SUNPRO_COMPILER_VERSION(major, minor) ((major * 0x100) + 0x##minor)
|
||||
#define ACTIV_SUNPRO_COMPILER_VERSION __SUNPRO_CC
|
||||
|
||||
#define ACTIV_MAKE_EMCC_COMPILER_VERSION(major, minor) ((major * 100) + minor)
|
||||
#define ACTIV_EMCC_COMPILER_VERSION ACTIV_MAKE_EMCC_COMPILER_VERSION(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__)
|
||||
|
||||
// Select compiler.
|
||||
#define ACTIV_COMPILER_CLANG_TAG 1
|
||||
#define ACTIV_COMPILER_INTEL_TAG 2
|
||||
#define ACTIV_COMPILER_GCC_TAG 3
|
||||
#define ACTIV_COMPILER_VISUAL_C_TAG 4
|
||||
#define ACTIV_COMPILER_SUNPRO_TAG 5
|
||||
#define ACTIV_COMPILER_EMCC_TAG 6
|
||||
|
||||
#if (defined __EMSCRIPTEN__)
|
||||
#define ACTIV_COMPILER_TAG ACTIV_COMPILER_EMCC_TAG
|
||||
#define ACTIV_COMPILER_EMCC ACTIV_COMPILER_TAG
|
||||
#define ACTIV_MAKE_COMPILER_VERSION(major, minor) ACTIV_MAKE_EMCC_COMPILER_VERSION(major, minor)
|
||||
#define ACTIV_COMPILER_VERSION ACTIV_EMCC_COMPILER_VERSION
|
||||
#elif (defined __clang__)
|
||||
#define ACTIV_COMPILER_TAG ACTIV_COMPILER_CLANG_TAG
|
||||
#define ACTIV_COMPILER_CLANG ACTIV_COMPILER_TAG
|
||||
#define ACTIV_MAKE_COMPILER_VERSION(major, minor) ACTIV_MAKE_CLANG_COMPILER_VERSION(major, minor)
|
||||
#define ACTIV_COMPILER_VERSION ACTIV_CLANG_COMPILER_VERSION
|
||||
#elif (defined __INTEL_COMPILER)
|
||||
#define ACTIV_COMPILER_TAG ACTIV_COMPILER_INTEL_TAG
|
||||
#define ACTIV_COMPILER_INTEL ACTIV_COMPILER_TAG
|
||||
#define ACTIV_MAKE_COMPILER_VERSION(major, minor) ACTIV_MAKE_INTEL_COMPILER_VERSION(major, minor)
|
||||
#define ACTIV_COMPILER_VERSION ACTIV_INTEL_COMPILER_VERSION
|
||||
#elif (defined __GNUC__)
|
||||
#define ACTIV_COMPILER_TAG ACTIV_COMPILER_GCC_TAG
|
||||
#define ACTIV_COMPILER_GCC ACTIV_COMPILER_TAG
|
||||
#define ACTIV_MAKE_COMPILER_VERSION(major, minor) ACTIV_MAKE_GCC_COMPILER_VERSION(major, minor)
|
||||
#define ACTIV_COMPILER_VERSION ACTIV_GCC_COMPILER_VERSION
|
||||
#elif (defined _MSC_VER)
|
||||
#define ACTIV_COMPILER_TAG ACTIV_COMPILER_VISUAL_C_TAG
|
||||
#define ACTIV_COMPILER_VISUAL_C ACTIV_COMPILER_TAG
|
||||
#define ACTIV_MAKE_COMPILER_VERSION(major, minor) ACTIV_MAKE_VISUAL_C_COMPILER_VERSION(major, minor)
|
||||
#define ACTIV_COMPILER_VERSION ACTIV_VISUAL_C_COMPILER_VERSION
|
||||
#elif (defined __SUNPRO_CC)
|
||||
#define ACTIV_COMPILER_TAG ACTIV_COMPILER_SUNPRO_TAG
|
||||
#define ACTIV_COMPILER_SUNPRO ACTIV_COMPILER_TAG
|
||||
#define ACTIV_MAKE_COMPILER_VERSION(major, minor) ACTIV_MAKE_SUNPRO_COMPILER_VERSION(major, minor)
|
||||
#define ACTIV_COMPILER_VERSION ACTIV_SUNPRO_COMPILER_VERSION
|
||||
#else
|
||||
#error Need to configure for this compiler
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Is the compiler a particular compiler and compare versions.
|
||||
*
|
||||
* @param compilerTag ACTIV_COMPILER_VISUAL_C, ACTIV_COMPILER_CLANG, etc.
|
||||
* @param op comparison operator.
|
||||
* @param compilerVersion the version to check against.
|
||||
*/
|
||||
#define ACTIV_IS_COMPILER_VERSION(compilerTag, op, compilerVersion) \
|
||||
((compilerTag == ACTIV_COMPILER_TAG) && (ACTIV_COMPILER_VERSION op compilerVersion))
|
||||
|
||||
// Select platform.
|
||||
|
||||
//! Activ namespace.
|
||||
namespace Activ
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief Enumeration of platforms.
|
||||
*
|
||||
* Network constant values, do not reorder or remove entries!
|
||||
*/
|
||||
enum PlatformType
|
||||
{
|
||||
PLATFORM_TYPE_UNKNOWN,
|
||||
PLATFORM_TYPE_LINUX,
|
||||
PLATFORM_TYPE_WINDOWS,
|
||||
PLATFORM_TYPE_BSD,
|
||||
PLATFORM_TYPE_OSX,
|
||||
PLATFORM_TYPE_SOLARIS,
|
||||
PLATFORM_TYPE_WASM
|
||||
};
|
||||
|
||||
} // namespace Activ
|
||||
|
||||
#if (defined linux) || (defined __linux) || (defined __linux__)
|
||||
#define ACTIV_PLATFORM_LINUX
|
||||
#elif (defined _WIN64)
|
||||
#define ACTIV_PLATFORM_WINDOWS 64
|
||||
#elif (defined _WIN32)
|
||||
#define ACTIV_PLATFORM_WINDOWS 32
|
||||
#elif (defined __FreeBSD__)
|
||||
#define ACTIV_PLATFORM_BSD
|
||||
#elif (defined __APPLE__)
|
||||
#define ACTIV_PLATFORM_OSX
|
||||
#elif (defined sun) || (defined __sun)
|
||||
#define ACTIV_PLATFORM_SOLARIS
|
||||
#elif (defined __asmjs__) || (defined __wasm__)
|
||||
#define ACTIV_PLATFORM_WASM
|
||||
#else
|
||||
#error Need to configure for this platform
|
||||
#endif
|
||||
|
||||
// Enable c99 options.
|
||||
#if (!defined __STDC_LIMIT_MACROS)
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#endif
|
||||
|
||||
#if (!defined __STDC_FORMAT_MACROS)
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#endif
|
||||
|
||||
#if (!defined ACTIV_COMPILER_SUNPRO) && (!defined __STDC_CONSTANT_MACROS)
|
||||
#define __STDC_CONSTANT_MACROS
|
||||
#endif
|
||||
|
||||
// Compiler specific includes.
|
||||
#if (defined ACTIV_COMPILER_GCC)
|
||||
#include "Compilers/GCC.h"
|
||||
#elif (defined ACTIV_COMPILER_INTEL)
|
||||
#include "Compilers/Intel.h"
|
||||
#elif (defined ACTIV_COMPILER_VISUAL_C)
|
||||
#include "Compilers/VisualC.h"
|
||||
#elif (defined ACTIV_COMPILER_SUNPRO)
|
||||
#include "Compilers/SunPro.h"
|
||||
#elif (defined ACTIV_COMPILER_CLANG)
|
||||
#include "Compilers/Clang.h"
|
||||
#elif (defined ACTIV_COMPILER_EMCC)
|
||||
#include "Compilers/Emcc.h"
|
||||
#endif
|
||||
|
||||
// Old compatibility macros until all moved over to new scheme.
|
||||
#define ACTIV_EXPORT_DLL ACTIV_BUILDING_DLL_EXPORTED_API
|
||||
#define ACTIV_IMPORT_DLL ACTIV_USING_DLL_EXPORTED_API
|
||||
|
||||
#define ACTIV_EXPORT_LIB ACTIV_BUILDING_LIB_EXPORTED_API
|
||||
#define ACTIV_IMPORT_LIB ACTIV_USING_LIB_EXPORTED_API
|
||||
|
||||
// Platform specific includes.
|
||||
#if (defined ACTIV_PLATFORM_LINUX)
|
||||
#include "Platforms/Linux.h"
|
||||
#elif (defined ACTIV_PLATFORM_WINDOWS)
|
||||
#include "Platforms/Windows.h"
|
||||
#elif (defined ACTIV_PLATFORM_BSD)
|
||||
#include "Platforms/Bsd.h"
|
||||
#elif (defined ACTIV_PLATFORM_OSX)
|
||||
#include "Platforms/OSX.h"
|
||||
#elif (defined ACTIV_PLATFORM_SOLARIS)
|
||||
#include "Platforms/Solaris.h"
|
||||
#elif (defined ACTIV_PLATFORM_WASM)
|
||||
#include "Platforms/WebAssembly.h"
|
||||
#endif
|
||||
|
||||
#if (!defined ACTIV_CPLUSPLUS)
|
||||
#define ACTIV_CPLUSPLUS __cplusplus
|
||||
#endif
|
||||
|
||||
#if (!defined ACTIV_ENABLE_ERROR_ON_PADDING_START)
|
||||
#define ACTIV_ENABLE_ERROR_ON_PADDING_START
|
||||
#define ACTIV_ENABLE_ERROR_ON_PADDING_END
|
||||
#endif
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_CONFIG_H)
|
||||
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Platforms/Bsd.h
|
||||
*
|
||||
* @brief BSD configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_PLATFORMS_BSD_H)
|
||||
#define ACTIV_CONFIG_PLATFORMS_BSD_H
|
||||
|
||||
#define ACTIV_PLATFORM_NAME "BSD"
|
||||
#define ACTIV_PLATFORM_TYPE Activ::PLATFORM_TYPE_BSD
|
||||
|
||||
#define ACTIV_POSIX_HAS_CONTEXT_API
|
||||
#define ACTIV_HAS_INTTYPES_H
|
||||
|
||||
#include "Posix.h"
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_PLATFORMS_BSD_H)
|
||||
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Platforms/Linux.h
|
||||
*
|
||||
* @brief Linux configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_PLATFORMS_LINUX_H)
|
||||
#define ACTIV_CONFIG_PLATFORMS_LINUX_H
|
||||
|
||||
#define ACTIV_PLATFORM_NAME "Linux"
|
||||
#define ACTIV_PLATFORM_TYPE Activ::PLATFORM_TYPE_LINUX
|
||||
|
||||
#define ACTIV_POSIX_HAS_CONTEXT_API
|
||||
|
||||
#define ACTIV_HAS_INTTYPES_H
|
||||
|
||||
#define ACTIV_PLATFORM_LINUX_HAS_MIN_GLIBC(maj, min) __GLIBC_PREREQ(maj, min)
|
||||
|
||||
#include "Posix.h"
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_PLATFORMS_LINUX_H)
|
||||
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Platforms/OSX.h
|
||||
*
|
||||
* @brief OSX configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_PLATFORMS_OSX_H)
|
||||
#define ACTIV_CONFIG_PLATFORMS_OSX_H
|
||||
|
||||
#define ACTIV_PLATFORM_NAME "OSX"
|
||||
#define ACTIV_PLATFORM_TYPE Activ::PLATFORM_TYPE_OSX
|
||||
|
||||
#define __STDC_LIBRARY_SUPPORTED__
|
||||
#define _XOPEN_SOURCE
|
||||
|
||||
#define ACTIV_POSIX_HAS_CONTEXT_API
|
||||
#define ACTIV_HAS_INTTYPES_H
|
||||
#define ACTIV_EXPLICIT_INSTANTIATE_SIZE_T
|
||||
|
||||
#include "Posix.h"
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_PLATFORMS_OSX_H)
|
||||
@@ -1,52 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Platforms/Posix.h
|
||||
*
|
||||
* @brief Posix configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_PLATFORMS_POSIX_H)
|
||||
#define ACTIV_CONFIG_PLATFORMS_POSIX_H
|
||||
|
||||
#define ACTIV_PLATFORM_POSIX
|
||||
|
||||
#include <unistd.h>
|
||||
#include <cerrno>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#define ACTIV_WAIT_INFINITE 0xffffffff
|
||||
|
||||
#if (defined _POSIX_THREAD_PROCESS_SHARED) && (_POSIX_THREAD_PROCESS_SHARED > 0)
|
||||
// FreeBSD defines _POSIX_THREAD_PROCESS_SHARED as -1 (as of version 10).
|
||||
#define ACTIV_POSIX_HAS_PSHARED
|
||||
#endif
|
||||
|
||||
//! Activ namespace.
|
||||
namespace Activ
|
||||
{
|
||||
|
||||
typedef int SOCKET;
|
||||
const SOCKET INVALID_SOCKET = -1;
|
||||
const int SOCKET_ERROR = -1;
|
||||
|
||||
typedef int HANDLE;
|
||||
const HANDLE INVALID_HANDLE_VALUE = -1;
|
||||
|
||||
typedef size_t SocketBufferLength;
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Close a socket handle.
|
||||
*
|
||||
* @param socket the socket to close.
|
||||
*
|
||||
* @return 0 on success or SOCKET_ERROR on error.
|
||||
*/
|
||||
inline int closesocket(const SOCKET socket)
|
||||
{
|
||||
return ::close(socket);
|
||||
}
|
||||
|
||||
} // namespace Activ
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_PLATFORMS_POSIX_H)
|
||||
@@ -1,43 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Platforms/Solaris.h
|
||||
*
|
||||
* @brief Solaris configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_PLATFORMS_SOLARIS_H)
|
||||
#define ACTIV_CONFIG_PLATFORMS_SOLARIS_H
|
||||
|
||||
// Include this now to get definitions of SUN_LEN, CMSG_LEN etc if available (e.g. solaris 10)
|
||||
// and if not we'll define our own later.
|
||||
#include <sys/socket.h>
|
||||
|
||||
#define ACTIV_PLATFORM_NAME "Solaris"
|
||||
#define ACTIV_PLATFORM_TYPE Activ::PLATFORM_TYPE_SOLARIS
|
||||
|
||||
#define ACTIV_POSIX_HAS_CONTEXT_API
|
||||
|
||||
#define ACTIV_HAS_INTTYPES_H
|
||||
|
||||
#define ACTIV_FRAMEWORK_MESSAGE_TYPES_NO_REGISTRY
|
||||
|
||||
#if (!defined SUN_LEN)
|
||||
// Using ACTIV_FIELD_OFFSET fails with 64-bit gcc builds, so use old c-style field length.
|
||||
#define SUN_LEN(p) (reinterpret_cast<size_t>(&((sockaddr_un *)0)->sun_path) + strlen((p)->sun_path))
|
||||
#endif
|
||||
|
||||
#if (!defined CMSG_SPACE)
|
||||
#define CMSG_SPACE(len) (_CMSG_HDR_ALIGN(sizeof(struct cmsghdr)) + (len))
|
||||
#endif
|
||||
|
||||
#if (!defined CMSG_LEN)
|
||||
#define CMSG_LEN(len) (_CMSG_DATA_ALIGN(sizeof(struct cmsghdr)) + (len))
|
||||
#endif
|
||||
|
||||
#if (!defined NAME_MAX)
|
||||
#define NAME_MAX MAXNAMELEN
|
||||
#endif
|
||||
|
||||
#include "Posix.h"
|
||||
#include <strings.h>
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_PLATFORMS_SOLARIS_H)
|
||||
@@ -1,17 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Platforms/WebAssembly.h
|
||||
*
|
||||
* @brief WebAssembly configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_PLATFORMS_WEB_ASSEMBLY_H)
|
||||
#define ACTIV_CONFIG_PLATFORMS_WEB_ASSEMBLY_H
|
||||
|
||||
#define ACTIV_PLATFORM_NAME "WebAssembly"
|
||||
#define ACTIV_PLATFORM_TYPE Activ::PLATFORM_TYPE_WASM
|
||||
|
||||
#define ACTIV_HAS_INTTYPES_H
|
||||
|
||||
#include "Posix.h"
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_PLATFORMS_WEB_ASSEMBLY_H)
|
||||
@@ -1,41 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Platforms/Windows.h
|
||||
*
|
||||
* @brief Microsoft Windows configuration file.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_PLATFORMS_WINDOWS_H)
|
||||
#define ACTIV_CONFIG_PLATFORMS_WINDOWS_H
|
||||
|
||||
#if (ACTIV_PLATFORM_WINDOWS == 64)
|
||||
#define ACTIV_PLATFORM_NAME "Win64"
|
||||
#else
|
||||
#define ACTIV_PLATFORM_NAME "Win32"
|
||||
#endif
|
||||
|
||||
#define ACTIV_PLATFORM_TYPE Activ::PLATFORM_TYPE_WINDOWS
|
||||
|
||||
#if (!defined _WIN32_WINNT)
|
||||
#define _WIN32_WINNT 0x600
|
||||
#endif
|
||||
|
||||
// Prevent definition of max and min macros in windef.h. Must be defined before windows.h is included.
|
||||
#if (!defined NOMINMAX)
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <windows.h>
|
||||
|
||||
#define ACTIV_WAIT_INFINITE INFINITE
|
||||
|
||||
namespace Activ
|
||||
{
|
||||
|
||||
typedef unsigned short sa_family_t;
|
||||
typedef int SocketBufferLength;
|
||||
|
||||
} // namespace Activ
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_PLATFORMS_WINDOWS_H)
|
||||
@@ -1,71 +0,0 @@
|
||||
/**
|
||||
* @file include/ActivMiddleware/Config/Suffix.h
|
||||
*
|
||||
* @brief Configuration suffix.
|
||||
*/
|
||||
|
||||
#if (!defined ACTIV_CONFIG_SUFFIX_H)
|
||||
#define ACTIV_CONFIG_SUFFIX_H
|
||||
|
||||
#if (!defined ACTIV_PRINTF_FUNCTION)
|
||||
/**
|
||||
* @brief Specify that a function is a printf style function.
|
||||
*
|
||||
* @param type printf, scanf, strftime.
|
||||
* @param formatIndex for static or global functions, the 1-based index of the parameter containing the format specifier string.
|
||||
* For member functions, the 2-based index.
|
||||
* @param firstParameterIndex for static or global functions, the 1-based index of the parameter containing the first value to be
|
||||
* used by the format string. For member functions, the 2-based index.
|
||||
* Use 0 if the function takes a va_list of parameters.
|
||||
*/
|
||||
#define ACTIV_PRINTF_FUNCTION(type, formatIndex, firstParameterIndex)
|
||||
#endif // (!defined ACTIV_PRINTF_FUNCTION)
|
||||
|
||||
#if (!defined ACTIV_NULLPTR)
|
||||
#if (!defined ACTIV_BOOST_NO_CXX11_NULLPTR)
|
||||
#define ACTIV_NULLPTR nullptr
|
||||
#else
|
||||
#define ACTIV_NULLPTR 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (!defined ACTIV_BOOST_NO_CXX11_FINAL)
|
||||
#define ACTIV_FINAL final
|
||||
#define ACTIV_OVERRIDE override
|
||||
#else
|
||||
#define ACTIV_OVERRIDE
|
||||
#define ACTIV_FINAL
|
||||
#endif
|
||||
|
||||
#if (!defined ACTIV_BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
||||
#define ACTIV_DELETE = delete
|
||||
#else
|
||||
#define ACTIV_DELETE
|
||||
#endif
|
||||
|
||||
#if (!defined ACTIV_BOOST_NO_CXX11_RANGE_BASED_FOR)
|
||||
#define ACTIV_FOREACH(var, container) for (var : container)
|
||||
#define ACTIV_FOREACH_NONCOPYABLE(t)
|
||||
#else
|
||||
#include ACTIV_BOOST_INCLUDE(foreach.hpp)
|
||||
#define ACTIV_FOREACH(var, container) ACTIV_BOOST_FOREACH(var, container)
|
||||
#define ACTIV_FOREACH_NONCOPYABLE(t) \
|
||||
namespace Boost { namespace foreach \
|
||||
{ \
|
||||
template<> \
|
||||
struct is_noncopyable<t> : Boost::mpl::true_ {}; \
|
||||
}}
|
||||
#endif
|
||||
|
||||
#if (!defined ACTIV_BOOST_NO_CXX11_DECLTYPE)
|
||||
#define ACTIV_DECLTYPE(t) decltype(t)
|
||||
#else
|
||||
#include ACTIV_BOOST_INCLUDE(typeof/typeof.hpp)
|
||||
#define ACTIV_DECLTYPE(t) ACTIV_BOOST_TYPEOF(t)
|
||||
#endif
|
||||
|
||||
#if (!defined ACTIV_PLATFORM_LINUX_HAS_MIN_GLIBC)
|
||||
#define ACTIV_PLATFORM_LINUX_HAS_MIN_GLIBC(maj, min) 0
|
||||
#endif
|
||||
|
||||
#endif // (!defined ACTIV_CONFIG_SUFFIX_H)
|
||||
Reference in new issue
Block a user