2019-01-15 12:26:11 +00:00
|
|
|
//
|
|
|
|
// Created by koncord on 23.01.16.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef PLATFORM_HPP
|
|
|
|
#define PLATFORM_HPP
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#ifdef _M_X86
|
|
|
|
#define ARCH_X86
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#ifdef __i386__
|
|
|
|
#define ARCH_X86
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2019-01-23 07:27:31 +00:00
|
|
|
#if defined _WIN32 && !defined __genffi__
|
2019-01-15 12:26:11 +00:00
|
|
|
#ifndef CDECL
|
|
|
|
#define CDECL __cdecl
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#define CDECL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined __cplusplus
|
|
|
|
#define EXTERN extern "C"
|
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined _WIN32
|
|
|
|
#define IMPORT_FUNCTION EXTERN __declspec(dllimport)
|
|
|
|
#define EXPORT_FUNCTION EXTERN __declspec(dllexport)
|
|
|
|
#else
|
|
|
|
#define EXPORT_FUNCTION EXTERN __attribute__ ((visibility ("default")))
|
|
|
|
#define IMPORT_FUNCTION EXTERN
|
|
|
|
#endif
|
|
|
|
|
2019-01-23 07:27:31 +00:00
|
|
|
#if defined __genffi__
|
2019-01-15 12:26:11 +00:00
|
|
|
#define API_FUNCTION
|
|
|
|
#elif !defined _HOST
|
|
|
|
#define API_FUNCTION IMPORT_FUNCTION
|
|
|
|
#else
|
|
|
|
#define API_FUNCTION EXPORT_FUNCTION
|
2019-01-23 07:27:31 +00:00
|
|
|
#endif // __genffi__
|
2019-01-15 12:26:11 +00:00
|
|
|
|
|
|
|
#if defined __cplusplus
|
|
|
|
#define NAMESPACE_BEGIN(name) namespace name {
|
|
|
|
#define NAMESPACE_END() }
|
2019-01-16 15:52:22 +00:00
|
|
|
#define NOEXCEPT noexcept
|
2019-01-15 12:26:11 +00:00
|
|
|
#else
|
|
|
|
#define NAMESPACE_BEGIN(name)
|
|
|
|
#define NAMESPACE_END()
|
2019-01-16 15:52:22 +00:00
|
|
|
#define NOEXCEPT
|
2019-01-15 12:26:11 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif //PLATFORM_HPP
|