📄 stdlib.h
字号:
}
#endif
#if !defined(__STDC__)
#if defined(__cplusplus)
inline int _RTLENTRY random(int __num)
{ return __num ? (int)(_lrand()%(__num)) : 0; }
#else /* __cplusplus */
#define random(__num) (__num ? (int)(_lrand()%(__num)) : 0)
#endif /* __cplusplus */
#endif /* __STDC__ */
#if defined(__cplusplus)
extern "C" {
#endif
long _RTLENTRY _EXPFUNC time(long *);
#if defined(__cplusplus)
}
#endif
#if !defined(__STDC__)
#if defined(__cplusplus)
/* Need prototype of time() for C++ randomize() */
inline void _RTLENTRY randomize(void) { srand((unsigned) time(NULL)); }
#if defined(__MFC_COMPAT__)
#if !defined( __MINMAX_DEFINED)
#define __MINMAX_DEFINED
#define NOMINMAX /* for WINDEF.H */
#undef min // make sure these aren't macros
#undef max
/*
MFC code sometimes contains usages of min() and max() of dis-similar types
which prevents using a normal template implementation. We cannot
implement min and max as macros (like Microsoft does), since parts of the
Rogue Wave Standard Library need to #undef them.
So we start by providing the normal template implementation and then also
provide a global, non-template version, of min and max that take and
return unsigned longs. The theory is that the compiler will first look at
the non-template version and promote both params to unsigned long before
looking at the template version and failing because of the two different
types involved.
*/
template <class _T> inline const _T _FAR &min( const _T _FAR &__t1, const _T _FAR &__t2 )
{
if (__t1 < __t2)
return __t1;
else
return __t2;
}
template <class _T> inline const _T _FAR &max( const _T _FAR &__t1, const _T _FAR &__t2 )
{
if (__t1 > __t2)
return __t1;
else
return __t2;
}
inline unsigned long min (unsigned long __a, unsigned long __b)
{
return min<unsigned long> (__a, __b);
}
inline unsigned long max (unsigned long __a, unsigned long __b)
{
return max<unsigned long> (__a, __b);
}
#define __max max
#define __min min
#endif /*__MINMAX_DEFINED */
inline char * _RTLENTRY _ecvt(double __value, int __ndig, int * __dec,
int * __sign)
{ return ecvt (__value, __ndig, __dec, __sign); }
inline char * _RTLENTRY _fcvt(double __value, int __ndig, int * __dec,
int * __sign)
{ return fcvt (__value, __ndig, __dec, __sign); }
inline char * _RTLENTRY _gcvt(double __value, int __ndec,
char * __buf)
{ return gcvt(__value, __ndec, __buf); }
inline char * _RTLENTRY _itoa(int __value, char * __string,
int __radix)
{ return itoa(__value, __string, __radix); }
inline char * _RTLENTRY _ltoa(long __value, char * __string,
int __radix)
{ return ltoa(__value, __string, __radix); }
inline char * _RTLENTRY _ultoa(unsigned long __value, char * __string,
int __radix)
{ return ultoa(__value, __string, __radix); }
inline int _RTLENTRY _putenv(const char * __name) {return putenv(__name);}
inline void _RTLENTRY _swab(char * __from, char * __to, int __nbytes)
{ swab (__from, __to, __nbytes); }
#else /* __MFC_COMPAT__ */
#if !defined( __MINMAX_DEFINED) && defined(__cplusplus)
#define __MINMAX_DEFINED
#undef min // make sure these aren't macros
#undef max
template <class _T> inline const _T _FAR &min( const _T _FAR &__t1, const _T _FAR &__t2 )
{
if (__t1 < __t2)
return __t1;
else
return __t2;
}
template <class _T> inline const _T _FAR &max( const _T _FAR &__t1, const _T _FAR &__t2 )
{
if (__t1 > __t2)
return __t1;
else
return __t2;
}
#endif
#endif /* __MFC_COMPAT__ */
#else /* __cplusplus */
#define randomize() srand((unsigned)time(NULL))
#ifndef max
#define max(__a,__b) (((__a) > (__b)) ? (__a) : (__b))
#endif
#ifndef min
#define min(__a,__b) (((__a) < (__b)) ? (__a) : (__b))
#endif
#endif /* __cplusplus */
#endif /* __STDC__ */
#if defined(__MSC) && !defined(__MFC_COMPAT__)
#define _itoa(__value, __string, __radix) itoa(__value, __string, __radix)
#endif
/* argv & argc definitions */
#ifdef __cplusplus
extern "C"{
#endif
#if !defined(__ARGV_DEFINED)
#define __ARGV_DEFINED
extern int _RTLENTRY _EXPDATA _argc;
extern char ** _RTLENTRY _EXPDATA _argv;
# define __argc _argc /* MSC Version */
# define __argv _argv /* MSC Version */
#endif /* __ARGV_DEFINED */
#ifdef __cplusplus
} /* __cplusplus */
#endif
#if !defined(RC_INVOKED)
/* restore default packing */
#pragma pack(pop)
#if defined(__STDC__)
#pragma warn .nak
#endif
#endif /* !RC_INVOKED */
#ifdef __cplusplus
} // std
#endif /* __cplusplus */
#endif /* __STDLIB_H */
#if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__STDLIB_H_USING_LIST)
#define __STDLIB_H_USING_LIST
using std::_argc;
using std::_argv;
#ifdef _MT
using std::__doserrno;
using std::__errno;
#else
using std::_doserrno;
using std::errno;
#endif
using std::__mb_cur_max;
using std::_ecvt;
using std::_atold;
using std::_cmdline_escapes;
using std::_environ;
using std::_exit;
using std::_fileinfo;
using std::_fmode;
using std::_fullpath;
using std::_fcvt;
using std::_gcvt;
#if defined(__MFC_COMPAT__)
using std::_itoa;
using std::_ultoa;
using std::_putenv;
using std::_swab;
#endif
using std::_ultow;
using std::_itow;
using std::_lrand;
using std::_ltoa;
using std::_ltow;
#if !defined(__STDC__) && defined (_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS >= 64)
using std::_atoi64;
using std::_i64toa;
using std::_i64tow;
using std::_ui64toa;
using std::_ui64tow;
using std::_wtoi64;
#endif
using std::_makepath;
using std::_osmajor;
using std::_osminor;
using std::_osmode;
using std::_osversion;
using std::_searchenv;
using std::_searchstr;
using std::_splitpath;
using std::_strtold;
using std::_sys_errlist;
using std::_sys_nerr;
using std::_wcstold;
using std::_wenviron;
using std::_wfullpath;
using std::_wgetenv;
using std::_wmakepath;
using std::_wperror;
using std::_wputenv;
using std::_wsearchenv;
using std::_wsearchstr;
using std::_wsplitpath;
using std::_wsystem;
using std::_wtof;
using std::_wtoi;
using std::_wtol;
using std::_wtold;
using std::abort;
using std::atexit;
using std::atexit_t;
using std::atof;
using std::atoi;
using std::atol;
using std::calloc;
using std::div;
using std::div_t;
using std::exit;
using std::free;
using std::getenv;
using std::itoa;
using std::labs;
using std::ldiv;
using std::ldiv_t;
using std::malloc;
#if !defined(__STDC__)
using std::ecvt;
using std::fcvt;
using std::gcvt;
using std::ltoa;
using std::random;
using std::randomize;
#endif
#if !defined(__STDC__) // The standard says that min() and max() should only
using std::min; // come in from algorith.h, but we'll allow it here
using std::max; // unless -A is specified
using std::_seterrormode;
#endif
using std::mblen;
using std::mbstowcs;
using std::mbtowc;
using std::perror;
using std::putenv;
using std::rand;
using std::realloc;
using std::srand;
using std::strtod;
using std::strtol;
using std::strtoul;
using std::swab;
using std::system;
using std::time;
using std::ultoa;
using std::wcstod;
using std::wcstol;
using std::wcstombs;
using std::wcstoul;
using std::wctomb;
/*
Handle intrinsics specially. If intrinsics are on, the compiler creates
a macro of the normal function mapping to the __ intrinsic version, ie:
#define strcpy __strcpy__
Thus, we can test the normal name as a macro to see if it's defined, and
only preform a using statement if it's not an intrinsic
*/
# ifndef abs
using std::abs;
# endif // ifndef abs
# ifndef _crotl
using std::_crotl;
# endif // ifndef _crotl
# ifndef _lrotl
using std::_lrotl;
# endif // ifndef _lrotl
# ifndef _lrotr
using std::_lrotr;
# endif // ifndef _lrotr
# ifndef _crotr
using std::_crotr;
# endif // ifndef _crotr
# ifndef _rotl
using std::_rotl;
# endif // ifndef _rotl
# ifndef _rotr
using std::_rotr;
# endif // ifndef _rotr
#endif /* __USING_CNAME__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -