209 lines
8.2 KiB
C++
209 lines
8.2 KiB
C++
#pragma once
|
|
|
|
#ifndef _BLOOMBERG_DEFINITION_H_
|
|
#define _BLOOMBERG_DEFINITION_H_
|
|
|
|
#include "gear_core/gear_core.h"
|
|
|
|
// Steal Gear4 definitions
|
|
namespace Bloomberg
|
|
{
|
|
typedef G4::AdaptiveLock Mutex;
|
|
typedef G4::Event Event;
|
|
typedef G4::EalAllocator<EAL_ID_TG_BLOOMBERG> EalAllocator_Bloomberg;
|
|
// cannot typedef Vector or Pair because they are templates
|
|
}
|
|
|
|
namespace Bloomberg
|
|
{
|
|
class File;
|
|
}
|
|
|
|
#define IS_GEAR_ERROR_ID_OK(errorObj)\
|
|
(errorObj == G4_MAKE_ERROR(G4::ErrorGearCore, Ok))
|
|
|
|
// If app hasn't choosen, set to work with Windows 98, Windows Me, Windows 2000, Windows XP and beyond
|
|
#ifndef WINVER
|
|
#define WINVER 0x0500
|
|
#endif
|
|
#ifndef _WIN32_WINDOWS
|
|
#define _WIN32_WINDOWS 0x0500
|
|
#endif
|
|
#ifndef _WIN32_WINNT
|
|
#if defined _DURANGO
|
|
#define _WIN32_WINNT 0x0602
|
|
#else
|
|
#define _WIN32_WINNT 0x0600
|
|
#endif
|
|
#endif
|
|
|
|
/// Possible platforms definitions
|
|
#define BLOOMBERG_PLATFORM_WIN32 1 ///< Windows running on x86
|
|
//#define BLOOMBERG_PLATFORM_X360 2 ///< Microsoft X360
|
|
//#define BLOOMBERG_PLATFORM_PS3 3 ///< Sony PlayStation 3 PPU
|
|
//#define BLOOMBERG_PLATFORM_WII 4 ///< Nintendo Wii
|
|
#define BLOOMBERG_PLATFORM_WIN64 5 ///< Windows 64 bit running on X64/A64/I64
|
|
#define BLOOMBERG_PLATFORM_DURANGO 6 ///< Microsoft Durango
|
|
#define BLOOMBERG_PLATFORM_ORBIS 7 ///< Sony Orbis
|
|
//#define BLOOMBERG_PLATFORM_WIIU 8 ///< Nintendo WiiU
|
|
#define BLOOMBERG_PLATFORM_IOS 9 ///< IOS
|
|
|
|
/// Compiler
|
|
#define BLOOMBERG_COMPILER_UNKNOWN 0 ///< Unknown compiler
|
|
#define BLOOMBERG_COMPILER_GCC 1 ///< GCC: GNU Compiler Collection
|
|
#define BLOOMBERG_COMPILER_SNC 2 ///< SN System Compiler
|
|
//#define BLOOMBERG_COMPILER_MW 3 ///< Metrowerks Codewarrior For Wii and DS
|
|
#define BLOOMBERG_COMPILER_VC9 4 ///< Microsoft VC++ 2008 For Win32, Win64, Vista and X360
|
|
#define BLOOMBERG_COMPILER_VC10 5 ///< Microsoft VC++ 2010 For Win32, Win64, Vista and X360
|
|
#define BLOOMBERG_COMPILER_VC11 6 ///< Microsoft VC++ 11 For Durango
|
|
#define BLOOMBERG_COMPILER_LLVM 7 ///< LLVM For Orbis and Apple
|
|
//#define BLOOMBERG_COMPILER_GREENHILL 8 ///< Nintendo WiiU For WiiU
|
|
|
|
/// Platform automatically detected
|
|
#if defined(_DURANGO) || defined(UBI_DURANGO) || defined(POP_PLATFORM_DURANGO)
|
|
#define BLOOMBERG_PLATFORM BLOOMBERG_PLATFORM_DURANGO
|
|
#define BLOOMBERG_PLATFORM_STRING "durango"
|
|
#elif defined(_WIN64) || defined(WIN64) || defined(UBI_PCWIN64)
|
|
#define BLOOMBERG_PLATFORM BLOOMBERG_PLATFORM_WIN64
|
|
#define BLOOMBERG_PLATFORM_STRING "win64"
|
|
#elif defined(WIN32) || defined(UBI_PCWIN32)
|
|
#define BLOOMBERG_PLATFORM BLOOMBERG_PLATFORM_WIN32
|
|
#define BLOOMBERG_PLATFORM_STRING "win32"
|
|
#elif defined(ORBIS) || defined(_ORBIS) || defined(UBI_ORBIS) || defined(__ORBIS__)
|
|
#define BLOOMBERG_PLATFORM BLOOMBERG_PLATFORM_ORBIS
|
|
#define BLOOMBERG_PLATFORM_STRING "orbis"
|
|
#define BLOOMBERG_EXE_IS_ELF
|
|
#elif __APPLE__
|
|
#include "TargetConditionals.h"
|
|
#if TARGET_OS_IPHONE
|
|
// iOS device
|
|
#define BLOOMBERG_PLATFORM BLOOMBERG_PLATFORM_IOS
|
|
#define BLOOMBERG_PLATFORM_STRING "ios"
|
|
#define BLOOMBERG_EXE_IS_ELF
|
|
#elif defined(TARGET_OS_MAC) || defined(TARGET_IPHONE_SIMULATOR)
|
|
// Unsupported platform
|
|
#error "Unsupported APPLE platform!"
|
|
#else
|
|
#error "Can't autodetect APPLE platform!"
|
|
#endif
|
|
#else
|
|
#error "Can't autodetect platform!"
|
|
#endif
|
|
|
|
// Auto-detect compiler
|
|
#if (BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_WIN32 || BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_WIN64 || BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_DURANGO)
|
|
#if defined(__INTEL_COMPILER) // Intel C++ Compiler
|
|
#define BLOOMBERG_COMPILER BLOOMBERG_COMPILER_ICL // ICL: 1000
|
|
#elif defined(_MSC_VER) // Microsoft Visual C++
|
|
// This error will only happen when you use a new version of Visual Studio (or a SDK that force it)
|
|
// It only mean that we have not tested our product with this compiler/SDK yet.
|
|
// Feel free to test it, and add the next version in the code. If it work, or if you fixed something
|
|
// please tell us, it will save us some time.
|
|
#if _MSC_VER > 2000
|
|
#error "Unsupported compiler: Microsoft Visual C++ 12 or above"
|
|
#elif _MSC_VER >= 1700
|
|
#define BLOOMBERG_COMPILER BLOOMBERG_COMPILER_VC11
|
|
#elif _MSC_VER >= 1600
|
|
#define BLOOMBERG_COMPILER BLOOMBERG_COMPILER_VC10
|
|
#elif _MSC_VER >= 1500 // VC9: 1500
|
|
#define BLOOMBERG_COMPILER BLOOMBERG_COMPILER_VC9
|
|
#else
|
|
#error "Unsupported compiler: Microsoft Visual C++ 8 or below"
|
|
#endif
|
|
#else
|
|
#error "Unsupported compiler: Unable to autodetect compiler"
|
|
#endif
|
|
#elif (BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_ORBIS)
|
|
#define BLOOMBERG_COMPILER BLOOMBERG_COMPILER_LLVM
|
|
#elif BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_IOS
|
|
#define BLOOMBERG_COMPILER BLOOMBERG_COMPILER_LLVM
|
|
#else
|
|
#define BLOOMBERG_COMPILER BLOOMBERG_PLATFORM_UNKNOWN
|
|
#endif
|
|
|
|
#if BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_WIN32 || BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_WIN64
|
|
#include "ps/win32/definitions.h"
|
|
#elif BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_DURANGO
|
|
#include "ps/durango/definitions.h"
|
|
#elif BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_ORBIS
|
|
#include "ps/orbis/definitions.h"
|
|
#elif BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_IOS
|
|
#include "ps/ios/definitions.h"
|
|
#else
|
|
#error "Definitions files missing!"
|
|
#endif
|
|
|
|
#if (BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_WIN32 || BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_WIN64)
|
|
#define BLOOMBERG_PLATFORM_PC
|
|
#endif
|
|
|
|
/// Auto-detect debug or release mode
|
|
#if defined(_DEBUG) || defined(UBI_DEBUG)
|
|
#define BLOOMBERG_DEBUG
|
|
#if BLOOMBERG_BLOB
|
|
#define BLOOMBERG_TARGET_STRING "Blob Debug"
|
|
#else
|
|
#define BLOOMBERG_TARGET_STRING "Debug"
|
|
#endif
|
|
#else
|
|
#define BLOOMBERG_RELEASE
|
|
#if BLOOMBERG_BLOB
|
|
#define BLOOMBERG_TARGET_STRING "Blob Release"
|
|
#else
|
|
#define BLOOMBERG_TARGET_STRING "Release"
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#if defined(BLOOMBERG_PLATFORM_PC)
|
|
|
|
#define BLOOMBERG_FORCEINLINE __forceinline
|
|
|
|
#ifdef BLOOMBERG_DLL
|
|
#ifdef BLOOMBERG_DLL_EXPORT
|
|
#define BLOOMBERG_DLL_ENTRY __declspec( dllexport )
|
|
#else
|
|
#define BLOOMBERG_DLL_ENTRY __declspec( dllimport )
|
|
#endif
|
|
#define BLOOMBERG_DLL_STRING "dll"
|
|
#else
|
|
#define BLOOMBERG_DLL_ENTRY
|
|
#define BLOOMBERG_DLL_STRING ""
|
|
#endif
|
|
#elif BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_DURANGO
|
|
#define BLOOMBERG_FORCEINLINE __forceinline
|
|
#define BLOOMBERG_DLL_ENTRY
|
|
#define BLOOMBERG_DLL_STRING ""
|
|
#elif BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_ORBIS
|
|
#define BLOOMBERG_FORCEINLINE inline __attribute__((always_inline))
|
|
#define BLOOMBERG_DLL_ENTRY
|
|
#define BLOOMBERG_DLL_STRING ""
|
|
#elif BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_IOS
|
|
#define BLOOMBERG_FORCEINLINE inline __attribute__((always_inline))
|
|
#define BLOOMBERG_DLL_ENTRY
|
|
#define BLOOMBERG_DLL_STRING ""
|
|
#endif
|
|
|
|
// dump not yet supported on Orbis
|
|
#if BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_DURANGO || BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_ORBIS || defined(BLOOMBERG_PLATFORM_PC)
|
|
#define BLOOMBERG_PLATFORM_SUPPORT_MINIDUMP
|
|
#endif
|
|
|
|
#if BLOOMBERG_PLATFORM == BLOOMBERG_PLATFORM_IOS
|
|
#include <sys/syslimits.h>
|
|
#define BLOOMBERG_FILE_NAME_LENGTH PATH_MAX
|
|
#else
|
|
#define BLOOMBERG_FILE_NAME_LENGTH 256
|
|
#endif
|
|
|
|
#define BLOOMBERG_LOGGING_CONTEXT_LENGTH 128
|
|
|
|
#define BLOOMBERG_EVENT_WAIT_TIME 3000 // 3 seconds
|
|
|
|
// Version in the xml. This is used by the service and also the xsl to show the report in jira.
|
|
#define BLOOMBERG_MESSAGE_VERSION "2.3"
|
|
|
|
// Version of the client library
|
|
#define BLOOMBERG_VERSION "2.2.0.4641"
|
|
|
|
#endif // _BLOOMBERG_DEFINITION_H_
|