39 #ifndef PSYSTEM_FRAMEWORK_PLATFORM_HPP
40 #define PSYSTEM_FRAMEWORK_PLATFORM_HPP
43 #if !defined(_MSC_VER) && !defined(__CYGWIN__)
68 #if defined(_MSC_VER) && (_MSV_VER <= 1800)
69 # define _ALLOW_KEYWORD_MACROS
70 # define constexpr const
71 # define noexcept throw()
92 #if defined(__GNUC__) || defined(__INTEL_COMPILER)
93 # define LIKELY(cond) __builtin_expect(!!(cond), 1)
95 # define LIKELY(cond) (cond)
102 #if defined(__GNUC__) || defined(__INTEL_COMPILER)
103 # define UNLIKELY(cond) __builtin_expect(!!(cond), 0)
105 # define UNLIKELY(cond) (cond)
118 # define ASSERT(cond) \
120 if (UNLIKELY( !(cond) )) \
123 << "Assertion failed (" #cond ") at " \
124 << __FILE__ << ":" << __LINE__ \
125 << " (" << __FUNCTION__ << ")" \
131 # define ASSERT(cond)
145 # define ASSERT_USING_VAR(var, cond) ASSERT(cond)
147 # define ASSERT_USING_VAR(var, cond) ((void)(var))
155 #ifdef _PRIVATE_BUILD
156 # define PRERELEASE_FLAGS VS_FF_PRERELEASE
158 # define PRERELEASE_FLAGS 0
163 # define FILE_FLAGS PRERELEASE_FLAGS | VS_FF_DEBUG
165 # define FILE_FLAGS PRERELEASE_FLAGS
179 #define STRINGIZE_SINGLE_VERSION_ID(id) #id
188 #define MAKE_PRODUCT_VERSION_ID(maj,min,patch) \
189 STRINGIZE_SINGLE_VERSION_ID(maj) "." \
190 STRINGIZE_SINGLE_VERSION_ID(min) "." \
191 STRINGIZE_SINGLE_VERSION_ID(patch)
201 #define MAKE_FILE_VERSION_ID(maj,min,patch,bld) \
202 STRINGIZE_SINGLE_VERSION_ID(maj) "." \
203 STRINGIZE_SINGLE_VERSION_ID(min) "." \
204 STRINGIZE_SINGLE_VERSION_ID(patch) " (build " \
205 STRINGIZE_SINGLE_VERSION_ID(bld) ")"
220 #ifndef NO_PTRDIFF_TYPE
222 #else // NO_PTRDIFF_TYPE
227 #ifndef NO_PTRDIFF_TYPE
229 #else // NO_PTRDIFF_TYPE
230 # if defined(_M_X64) || defined(__x86_64)
240 sizeof(address_t) ==
sizeof(integral_address_t),
241 "Pointer size does not match size for integral_address_t");
272 #endif // PSYSTEM_FRAMEWORK_PLATFORM_HPP
std::string tstring
A std::string implementation based on the UNICODE macro.
Definition: platform.hpp:266
std::uintptr_t address_t
Container type for a memory address.
Definition: platform.hpp:221
DWORD process_id_t
Data-type that stores a process ID (PID).
Definition: platform.hpp:241
Contains the process examination "system" and basic frameworks.
Definition: pstack_event_handler.hpp:28
std::ptrdiff_t integral_address_t
A memory address as an integer type (platform specific).
Definition: platform.hpp:228
DWORD error_t
Container type for system error codes.
Definition: platform.hpp:217
DWORD thread_id_t
Data-type that stores a thread ID (TID).
Definition: platform.hpp:247