⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xstddef

📁 C语言库函数的原型,有用的拿去
💻
字号:
// xstddef standard header
#pragma once
#ifndef _XSTDDEF_
#define _XSTDDEF_
#ifndef RC_INVOKED
#include <yvals.h>

 #if !defined(_XSTD)
  #define _X_STD_BEGIN	_STD_BEGIN
  #define _X_STD_END	_STD_END
  #define _XSTD	_STD /* LEAVE SPACE */
 #endif /* !defined(_XSTD) */

#include <cstddef>

 #pragma pack(push,_CRT_PACKING)
 #pragma warning(push,3)

_STD_BEGIN
		// EXCEPTION MACROS
 #define _THROWS(x)

 #if _HAS_EXCEPTIONS
 #define _TRY_BEGIN	try {
 #define _CATCH(x)	} catch (x) {
 #define _CATCH_ALL	} catch (...) {
 #define _CATCH_END	}

 #define _RAISE(x)	throw x
 #define _RERAISE	throw

 #ifndef _THROWS
  #define _THROWS(x)	throw (x)
 #endif /* _THROWS */

  #define _THROW0()		throw ()
  #define _THROW1(x)	throw (...)

  #if defined(MRTDLL) && defined(_M_CEE) && !defined(_M_CEE_PURE)
   #define _THROW(x, y)	_should_not_throw()	/* force compile error */

   #if defined(_DEBUG)
    #define _THROW_NCEE(x, y)	\
		_invoke_watson(__STR2WSTR(#x), __FUNCTIONW__, __FILEW__, __LINE__, 0)

   #else /* defined(_DEBUG) */
    #define _THROW_NCEE(x, y)	\
		_invoke_watson(0, 0, 0, 0, 0)
   #endif /* defined(_DEBUG) */

  #else /* defined(MRTDLL) etc. */
   #define _THROW(x, y)			throw x(y)
   #define _THROW_NCEE(x, y)	throw x(y)
  #endif /* defined(MRTDLL) etc. */

 #else /* _HAS_EXCEPTIONS */
 #define _TRY_BEGIN	{{
 #define _CATCH(x)	} if (0) {
 #define _CATCH_ALL	} if (0) {
 #define _CATCH_END	}}

 #if defined(_DEBUG)
  #define _RAISE(x)	\
	_invoke_watson(__STR2WSTR(#x), __FUNCTIONW__, __FILEW__, __LINE__, 0)

 #else /* defined(_DEBUG) */
  #define _RAISE(x)	\
	_invoke_watson(0, 0, 0, 0, 0)
 #endif /* defined(_DEBUG) */

 #define _RERAISE

 #ifndef _THROWS
  #define _THROWS(x)
 #endif /* _THROWS */

 #define _THROW0()
 #define _THROW1(x)
 #define _THROW(x, y)		x(y)._Raise()
 #define _THROW_NCEE(x, y)	x(y)._Raise()
 #endif /* _HAS_EXCEPTIONS */

		// MISCELLANEOUS MACROS
#define _EMPTY_ARGUMENT		/* for empty throw argument */

		// BITMASK MACROS
 #define _BITMASK(Enum, Ty)	typedef int Ty
 #define _BITMASK_OPS(Ty)

		// TYPE DEFINITIONS

template<bool _Test,
	class _Ty1,
	class _Ty2>
	class _If
	{	// _Type is _Ty2 for assumed false
public:
	typedef _Ty2 _Type;
	};

template<class _Ty1,
	class _Ty2>
	class _If<true, _Ty1, _Ty2>
	{	// _Type is _Ty1 for assumed true
public:
	typedef _Ty1 _Type;
	};

 #ifndef _IS_YES
  #define _IS_YES(ty)	(sizeof (ty) == sizeof (_STD tr1::_Yes))

	namespace tr1 {
typedef char (&_No)[1];
typedef char (&_Yes)[2];
	}	// namespace tr1
 #endif /* _IS_YES */

 #ifndef _CONVERTIBLE_TO_TRUE

  #define _OPERATOR_BOOL	operator _STD _Bool_type

struct _Bool_struct
	{	// define member just for its address
	int _Member;
	};

  #ifdef _M_CEE
   #define _CONVERTIBLE_TO_TRUE	(&_STD _Bool_function)

inline void _Bool_function(const _Bool_struct&)
	{	// do nothing
	}

typedef void (*_Bool_type)(const _Bool_struct&);

  #else /* _M_CEE */
   #define _CONVERTIBLE_TO_TRUE	(&_STD _Bool_struct::_Member)

typedef int _Bool_struct::* _Bool_type;
  #endif /* _M_CEE */

 #endif /* _CONVERTIBLE_TO_TRUE */

		//	FUNCTIONAL STUFF (from <functional>)
		// TEMPLATE STRUCT unary_function
template<class _Arg,
	class _Result>
	struct unary_function
	{	// base class for unary functions
	typedef _Arg argument_type;
	typedef _Result result_type;
	};

		// TEMPLATE STRUCT binary_function
template<class _Arg1,
	class _Arg2,
	class _Result>
	struct binary_function
	{	// base class for binary functions
	typedef _Arg1 first_argument_type;
	typedef _Arg2 second_argument_type;
	typedef _Result result_type;
	};
_STD_END

  #ifdef MRTDLL

   #if !defined(_NATIVE_WCHAR_T_DEFINED) && defined(_M_CEE_PURE)
extern "C++"

  #else /* !defined(_NATIVE_WCHAR_T_DEFINED) etc. */
extern "C"
  #endif /* !defined(_NATIVE_WCHAR_T_DEFINED) etc. */

	_CRTIMP __declspec(noreturn) void __cdecl _invoke_watson(
		_In_opt_z_ const wchar_t *,
		_In_opt_z_ const wchar_t *,
		_In_opt_z_ const wchar_t *,
		unsigned int,
		uintptr_t);
  #endif /* MRTDLL */

 #pragma warning(pop)
 #pragma pack(pop)

#endif /* RC_INVOKED */
#endif /* _XSTDDEF_ */

/*
 * Copyright (c) 1992-2009 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
V5.20:0009 */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -