mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:02:56 +00:00
[VCRUNTIME] Add some missing definitions to vcruntime*.h
This commit is contained in:
parent
90e95d15a2
commit
2955b1f0e9
3 changed files with 210 additions and 0 deletions
|
@ -11,6 +11,32 @@
|
|||
#define _CRT_WIDE_(_String) L ## _String
|
||||
#define _CRT_WIDE(_String) _CRT_WIDE_(_String)
|
||||
|
||||
#define _CRT_CONCATENATE_(a, b) a ## b
|
||||
#define _CRT_CONCATENATE(a, b) _CRT_CONCATENATE_(a, b)
|
||||
|
||||
#define _CRT_UNPARENTHESIZE_(...) __VA_ARGS__
|
||||
#define _CRT_UNPARENTHESIZE(...) _CRT_UNPARENTHESIZE_ __VA_ARGS__
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#define __pragma(x) _Pragma(_CRT_STRINGIZE(x))
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define _CRT_BEGIN_C_HEADER \
|
||||
__pragma(pack(push, _CRT_PACKING_IDENTIFIER, _CRT_PACKING)) \
|
||||
extern "C" {
|
||||
#define _CRT_END_C_HEADER \
|
||||
} \
|
||||
__pragma(pack(pop, _CRT_PACKING_IDENTIFIER))
|
||||
#else
|
||||
#define _CRT_BEGIN_C_HEADER \
|
||||
__pragma(pack(push, _CRT_PACKING_IDENTIFIER, _CRT_PACKING))
|
||||
#define _CRT_END_C_HEADER \
|
||||
__pragma(pack(pop, _CRT_PACKING_IDENTIFIER))
|
||||
#endif
|
||||
|
||||
_CRT_BEGIN_C_HEADER
|
||||
|
||||
#ifndef _CRTIMP
|
||||
#ifdef CRTDLL /* Defined for ntdll, crtdll, msvcrt, etc */
|
||||
#define _CRTIMP
|
||||
|
@ -21,6 +47,16 @@
|
|||
#endif /* CRTDLL || _DLL */
|
||||
#endif /* !_CRTIMP */
|
||||
|
||||
#ifndef _VCRTIMP
|
||||
#ifndef _VCRT_DEFINED_CRTIMP
|
||||
#define _VCRTIMP _CRTIMP
|
||||
#elif defined(_VCRT_BUILD) && defined(CRTDLL) && !defined(_VCRT_SAT_1)
|
||||
#define _VCRTIMP __declspec(dllexport)
|
||||
#else
|
||||
#define _VCRTIMP
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __CRTDECL
|
||||
#define __CRTDECL __cdecl
|
||||
#endif
|
||||
|
@ -118,3 +154,55 @@
|
|||
#define _CRT_ALIGN(x) __attribute__ ((aligned(x)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__midl) || defined(__WIDL__)
|
||||
#define _VCRT_ALIGN(x)
|
||||
#elif defined(_MSC_VER)
|
||||
#define _CRT_ALIGN(x) __declspec(align(x))
|
||||
#else
|
||||
#define _VCRT_ALIGN(x) __attribute__ ((aligned(x)))
|
||||
#endif
|
||||
|
||||
#if defined __cplusplus
|
||||
typedef bool __vcrt_bool;
|
||||
#elif defined __midl
|
||||
typedef char __vcrt_bool;
|
||||
#else
|
||||
typedef _Bool __vcrt_bool;
|
||||
#endif
|
||||
|
||||
#ifndef _HAS_NODISCARD
|
||||
#ifndef __has_cpp_attribute
|
||||
#define _HAS_NODISCARD 0
|
||||
#elif __has_cpp_attribute(nodiscard) >= 201603L
|
||||
#define _HAS_NODISCARD 1
|
||||
#else
|
||||
#define _HAS_NODISCARD 0
|
||||
#endif
|
||||
#endif // _HAS_NODISCARD
|
||||
|
||||
#if _HAS_NODISCARD
|
||||
#define _NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define _NODISCARD
|
||||
#endif // _HAS_NODISCARD
|
||||
|
||||
#if defined _M_X64 || defined _M_ARM || defined _M_ARM64
|
||||
#define _UNALIGNED __unaligned
|
||||
#else
|
||||
#define _UNALIGNED
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
// Safer than the C definition, as it ensures that the argument is not a pointer
|
||||
extern "C++" template<typename _T, size_t _Size>
|
||||
char (*__crt_countof_helper(_UNALIGNED _T(&_Array)[_Size]))[_Size];
|
||||
#define __crt_countof(_Array) sizeof(*__crt_countof_helper(_Array))
|
||||
#else
|
||||
#define __crt_countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
|
||||
#endif
|
||||
|
||||
void __cdecl __security_init_cookie(void);
|
||||
extern uintptr_t __security_cookie;
|
||||
|
||||
_CRT_END_C_HEADER
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue