//// vcruntime.h//// Copyright (c) Microsoft Corporation. All rights reserved.//// Declarations used throughout the VCRuntime library.//#pragmaonce//// Note on use of "deprecate"://// Various places in this header and other headers use// __declspec(deprecate) or macros that have the term DEPRECATE in them.// We use "deprecate" here ONLY to signal the compiler to emit a warning// about these items. The use of "deprecate" should NOT be taken to imply// that any standard committee has deprecated these functions from the// relevant standards. In fact, these functions are NOT deprecated from// the standard.//// Full details can be found in our documentation by searching for// "Security Enhancements in the CRT".//#ifndef_VCRUNTIME_H#define_VCRUNTIME_H#ifndef_VCRT_COMPILER_PREPROCESSOR// Many VCRuntime headers avoid exposing their contents to non-compilers like// the Windows resource compiler and Qt's meta-object compiler (moc).#ifdefined(RC_INVOKED)||defined(Q_MOC_RUN)#define_VCRT_COMPILER_PREPROCESSOR0#else#define_VCRT_COMPILER_PREPROCESSOR1#endif#endif// _VCRT_COMPILER_PREPROCESSOR#ifndef_UCRT#define_UCRT#endif// The _CRTIMP macro is not used in the VCRuntime or the CoreCRT anymore, but// there is a lot of existing code that declares CRT functions using this macro,// and if we remove its definition, we break that existing code. It is thus// defined here only for compatibility.#ifndef_CRTIMP#define_VCRT_DEFINED_CRTIMP#ifdefined CRTDLL && defined _CRTBLD#define_CRTIMP__declspec(dllexport)#else#ifdef_DLL#define_CRTIMP__declspec(dllimport)#else#define_CRTIMP#endif#endif#endif#include<sal.h>#include<vadefs.h>#pragmawarning(push)#pragmawarning(disable: _VCRUNTIME_DISABLED_WARNINGS)// All C headers have a common prologue and epilogue, to enclose the header in// an extern "C" declaration when the header is #included in a C++ translation// unit and to push/pop the packing.#ifdefined __cplusplus#define_CRT_BEGIN_C_HEADER\__pragma(pack(push, _CRT_PACKING))\extern"C"{#define_CRT_END_C_HEADER\}\__pragma(pack(pop))#elifdefined __midl#define_CRT_BEGIN_C_HEADER\cpp_quote("__pragma(pack(push, _CRT_PACKING))")\cpp_quote("extern \"C\" {")#define_CRT_END_C_HEADER\cpp_quote("}")\cpp_quote("__pragma(pack(pop))")#else#define_CRT_BEGIN_C_HEADER\__pragma(pack(push, _CRT_PACKING))#define_CRT_END_C_HEADER\__pragma(pack(pop))#endif
_CRT_BEGIN_C_HEADER
#ifndef_HAS_EXCEPTIONS // Predefine as 0 to disable exceptions#ifdef_KERNEL_MODE#define_HAS_EXCEPTIONS0#else#define_HAS_EXCEPTIONS1#endif/* _KERNEL_MODE */#endif/* _HAS_EXCEPTIONS */#define_CRT_STRINGIZE_(x) #x#define_CRT_STRINGIZE(x)_CRT_STRINGIZE_(x)#define_CRT_WIDE_(s) L ##s#define_CRT_WIDE(s)_CRT_WIDE_(s)#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_VCRTIMP#ifdefined _CRTIMP &&!defined _VCRT_DEFINED_CRTIMP#define_VCRTIMP_CRTIMP#elifdefined _VCRT_BUILD && defined CRTDLL &&!defined _VCRT_SAT_1#define_VCRTIMP__declspec(dllexport)#else#define_VCRTIMP#endif#endif#ifndef_MRTIMP#ifdefined MRTDLL && defined _CRTBLD &&!defined _M_CEE_PURE#define_MRTIMP__declspec(dllexport)#else#define_MRTIMP#endif#endif// Definitions of calling conventions used code sometimes compiled as managed#ifdefined _M_CEE_PURE || defined MRTDLL#define__CLRCALL_OR_CDECL__clrcall#define__CLR_OR_THIS_CALL__clrcall#else#define__CLRCALL_OR_CDECL__cdecl#define__CLR_OR_THIS_CALL#endif#ifdef_M_CEE_PURE#define__CLRCALL_PURE_OR_CDECL__clrcall#else#define__CLRCALL_PURE_OR_CDECL__cdecl#endif#define__CRTDECL__CLRCALL_PURE_OR_CDECL// Definitions of common __declspecs#define_VCRT_NOALIAS__declspec(noalias)#define_VCRT_RESTRICT__declspec(restrict)#if!defined _MSC_VER || _MSC_VER >=1900#define_VCRT_ALLOCATOR__declspec(allocator)#else#define_VCRT_ALLOCATOR#endif#ifdefined _M_CEE && defined _M_X64#define_VCRT_JIT_INTRINSIC__declspec(jitintrinsic)#else#define_VCRT_JIT_INTRINSIC#endif#ifdef__midl#define_VCRT_ALIGN(x)#else#define_VCRT_ALIGN(x)__declspec(align(x))#endif#ifndef_CONST_RETURN#ifdef__cplusplus#define_CRT_CONST_CORRECT_OVERLOADS#define_CONST_RETURNconst#else#define_CONST_RETURN#endif#endif// For backwards compatibility#define_WConst_return_CONST_RETURN// Definitions of common types#ifdef_WIN64typedefunsigned __int64 size_t;typedef __int64 ptrdiff_t;typedef __int64 intptr_t;#elsetypedefunsignedintsize_t;typedefintptrdiff_t;typedefintintptr_t;#endif#ifdefined __cplusplustypedef bool __vcrt_bool;#elifdefined __midl// MIDL understands neither bool nor _Bool. Use char as a best-fit// replacement (the differences won't matter in practice).typedefchar __vcrt_bool;#elsetypedef_Bool __vcrt_bool;#endif// Indicate that these common types are defined#ifndef_SIZE_T_DEFINED#define_SIZE_T_DEFINED#endif#ifndef_PTRDIFF_T_DEFINED#define_PTRDIFF_T_DEFINED#endif#ifndef_INTPTR_T_DEFINED#define_INTPTR_T_DEFINED#endif// Provide a typedef for wchar_t for use under /Zc:wchar_t-#ifndef_WCHAR_T_DEFINED#define_WCHAR_T_DEFINEDtypedefunsignedshortwchar_t;#endif#ifndefNULL#ifdef__cplusplus#defineNULL0#else#defineNULL((void*)0)#endif#endif#ifdefined _M_X64 || defined _M_ARM || defined _M_ARM64#define_UNALIGNED__unaligned#else#define_UNALIGNED#endif#ifdefined _M_ARM64EC#define__security_check_cookie__security_check_cookie_arm64ec#endif#ifdef__cplusplusextern"C++"{
template <typename _CountofType,size_t _SizeOfArray>char(*__countof_helper(_UNALIGNED _CountofType(&_Array)[_SizeOfArray]))[_SizeOfArray];#define__crt_countof(_Array)(sizeof(*__countof_helper(_Array))+0)}#else#define__crt_countof(_Array)(sizeof(_Array)/sizeof(_Array[0]))#endif#ifdefined(_M_IX86)&&defined(_CRT_LEGACY_X86_FLT_EXCEPTIONS)&&!defined(_M_CEE_PURE)#pragmacomment(lib,"legacy_x86_flt_exceptions")#endif#if!defined(_HAS_CXX17)&&!defined(_HAS_CXX20)#ifdefined(_MSVC_LANG)#define_STL_LANG_MSVC_LANG#elifdefined(__cplusplus)// ^^^ use _MSVC_LANG / use __cplusplus vvv#define_STL_LANG__cplusplus#else// ^^^ use __cplusplus / no C++ support vvv#define_STL_LANG0L#endif// ^^^ no C++ support ^^^#if_STL_LANG >201703L#define_HAS_CXX171#define_HAS_CXX201#elif_STL_LANG >201402L#define_HAS_CXX171#define_HAS_CXX200#else// _STL_LANG <= 201402L#define_HAS_CXX170#define_HAS_CXX200#endif// Use the value of _STL_LANG to define _HAS_CXX17 and _HAS_CXX20#undef_STL_LANG#endif// !defined(_HAS_CXX17) && !defined(_HAS_CXX20)#if!defined(_HAS_CXX17)||!defined(_HAS_CXX20)|| _HAS_CXX20 &&!_HAS_CXX17#error_HAS_CXX17 and _HAS_CXX20 must both be defined, and _HAS_CXX20 must imply _HAS_CXX17#endif// Verify _HAS_CXX17 and _HAS_CXX20// [[nodiscard]] attributes on STL functions#ifndef_HAS_NODISCARD#ifndef__has_cpp_attribute#define_HAS_NODISCARD0#elif__has_cpp_attribute(nodiscard)>=201603L// TRANSITION, VSO#939899 (need toolset update)#define_HAS_NODISCARD1#else#define_HAS_NODISCARD0#endif#endif// _HAS_NODISCARD#if_HAS_NODISCARD#define_NODISCARD[[nodiscard]]#else// ^^^ CAN HAZ [[nodiscard]] / NO CAN HAZ [[nodiscard]] vvv#define_NODISCARD#endif// _HAS_NODISCARD// See note on use of "deprecate" at the top of this file#define_CRT_DEPRECATE_TEXT(_Text)__declspec(deprecated(_Text))#ifdefined _CRT_SECURE_NO_DEPRECATE &&!defined _CRT_SECURE_NO_WARNINGS#define_CRT_SECURE_NO_WARNINGS#endif#ifndef_CRT_INSECURE_DEPRECATE#ifdef_CRT_SECURE_NO_WARNINGS#define_CRT_INSECURE_DEPRECATE(_Replacement)#else#define_CRT_INSECURE_DEPRECATE(_Replacement)_CRT_DEPRECATE_TEXT(\"This function or variable may be unsafe. Consider using "\#_Replacement \" instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. "\"See online help for details.")#endif#endif#ifdefined _CRT_SECURE_DEPRECATE_MEMORY &&!defined _CRT_SECURE_WARNINGS_MEMORY#define_CRT_SECURE_WARNINGS_MEMORY#endif#ifndef_CRT_INSECURE_DEPRECATE_MEMORY#ifndef_CRT_SECURE_WARNINGS_MEMORY#define_CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)#else#define_CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)\_CRT_INSECURE_DEPRECATE(_Replacement)#endif#endif#if!defined _M_CEE &&!defined __midlvoid __cdecl __security_init_cookie(void);#ifdefined(_M_IX86)void __fastcall __security_check_cookie(_In_ uintptr_t _StackCookie);__declspec(noreturn)void __cdecl __report_gsfailure(void);#elifdefined(_M_ARM64EC)void __cdecl __security_check_cookie_arm64ec(_In_ uintptr_t _StackCookie);__declspec(noreturn)void __cdecl __report_gsfailure(_In_ uintptr_t _StackCookie);#elsevoid __cdecl __security_check_cookie(_In_ uintptr_t _StackCookie);__declspec(noreturn)void __cdecl __report_gsfailure(_In_ uintptr_t _StackCookie);#endif#endifexternuintptr_t __security_cookie;#ifndef_VCRT_BUILD#define__vcrt_malloc_normal(_Size)malloc(_Size)#define__vcrt_calloc_normal(_Count, _Size)calloc(_Count, _Size)#define__vcrt_free_normal(_Memory)free(_Memory)#endif
_CRT_END_C_HEADER
#pragmawarning(pop)// _VCRUNTIME_DISABLED_WARNINGS#endif// _VCRUNTIME_H
vcruntime.h头文件//// vcruntime.h//// Copyright (c) Microsoft Corporation. All rights reserved.//// Declarations used throughout the VCRuntime library.//#pragma once//// Note on use of "deprecate"://// Various places in this header and other