epoc32/include/stdapis/stlport/cstd/cstdlib
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/stlport/cstd/cstdlib	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/stlport/cstd/cstdlib	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,126 @@
     1.4 -cstdlib
     1.5 +/*
     1.6 + * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
     1.7 + *
     1.8 + * Copyright (c) 1999 
     1.9 + * Boris Fomitchev
    1.10 + *
    1.11 + * This material is provided "as is", with absolutely no warranty expressed
    1.12 + * or implied. Any use is at your own risk.
    1.13 + *
    1.14 + * Permission to use or copy this software for any purpose is hereby granted 
    1.15 + * without fee, provided the above notices are retained on all copies.
    1.16 + * Permission to modify the code and to distribute modified code is granted,
    1.17 + * provided the above notices are retained, and a notice that the code was
    1.18 + * modified is included with the above copyright notice.
    1.19 + *
    1.20 + */
    1.21 +
    1.22 +#ifndef _STLP_CSTDLIB
    1.23 +# define _STLP_CSTDLIB
    1.24 +
    1.25 +# ifndef _STLP_OUTERMOST_HEADER_ID
    1.26 +#  define _STLP_OUTERMOST_HEADER_ID 0x116
    1.27 +#  include <stl/_prolog.h>
    1.28 +# endif
    1.29 +
    1.30 +# if defined (_STLP_USE_NEW_C_HEADERS)
    1.31 +#  include _STLP_NATIVE_CPP_C_HEADER(cstdlib)
    1.32 +# else
    1.33 +#ifdef __SYMBIAN32__
    1.34 +#  include <stdlib.h>
    1.35 +#else
    1.36 +# include _STLP_NATIVE_C_HEADER(stdlib.h)
    1.37 +#endif
    1.38 +# endif
    1.39 +
    1.40 +# if defined( __MSL__ ) && __MSL__ <= 0x5003
    1.41 +namespace std {
    1.42 +	typedef ::div_t div_t;
    1.43 +	typedef ::ldiv_t ldiv_t;
    1.44 +#  ifdef __MSL_LONGLONG_SUPPORT__
    1.45 +	typedef ::lldiv_t lldiv_t;
    1.46 +#  endif
    1.47 +}
    1.48 +# endif
    1.49 +
    1.50 +# ifdef _STLP_IMPORT_VENDOR_CSTD 
    1.51 +_STLP_BEGIN_NAMESPACE
    1.52 +using _STLP_VENDOR_CSTD::div_t;
    1.53 +using _STLP_VENDOR_CSTD::ldiv_t;
    1.54 +using _STLP_VENDOR_CSTD::size_t;
    1.55 +
    1.56 +#  ifndef _STLP_NO_CSTD_FUNCTION_IMPORTS
    1.57 +using _STLP_VENDOR_CSTD::abort;
    1.58 +using _STLP_VENDOR_CSTD::atexit;
    1.59 +using _STLP_VENDOR_CSTD::exit;
    1.60 +using _STLP_VENDOR_CSTD::getenv;
    1.61 +using _STLP_VENDOR_CSTD::calloc;
    1.62 +using _STLP_VENDOR_CSTD::free;
    1.63 +using _STLP_VENDOR_CSTD::malloc;
    1.64 +using _STLP_VENDOR_CSTD::realloc;
    1.65 +using _STLP_VENDOR_CSTD::atof;
    1.66 +using _STLP_VENDOR_CSTD::atoi;
    1.67 +using _STLP_VENDOR_CSTD::atol;
    1.68 +using _STLP_VENDOR_CSTD::mblen;
    1.69 +using _STLP_VENDOR_CSTD::mbstowcs;
    1.70 +using _STLP_VENDOR_CSTD::mbtowc;
    1.71 +using _STLP_VENDOR_CSTD::strtod;
    1.72 +using _STLP_VENDOR_CSTD::strtol;
    1.73 +using _STLP_VENDOR_CSTD::strtoul;
    1.74 +using _STLP_VENDOR_CSTD::system;
    1.75 +
    1.76 +#if ! (defined (_STLP_NO_NATIVE_WIDE_STREAMS) || defined (_STLP_NO_MBSTATE_T) )
    1.77 +using _STLP_VENDOR_CSTD::wcstombs;
    1.78 +using _STLP_VENDOR_CSTD::wctomb;
    1.79 +#endif
    1.80 +using _STLP_VENDOR_CSTD::bsearch;
    1.81 +using _STLP_VENDOR_CSTD::qsort;
    1.82 +// boris : if we do not have native float abs, we define ours; then we cannot do "using" for "other" abs 
    1.83 +# ifdef _STLP_HAS_NATIVE_FLOAT_ABS 
    1.84 +using _STLP_VENDOR_CSTD::abs;
    1.85 +# endif
    1.86 +using _STLP_VENDOR_CSTD::div;
    1.87 +using _STLP_VENDOR_CSTD::labs;
    1.88 +using _STLP_VENDOR_CSTD::ldiv;
    1.89 +using _STLP_VENDOR_CSTD::rand;
    1.90 +using _STLP_VENDOR_CSTD::srand;
    1.91 +#  endif /* _STLP_NO_CSTD_FUNCTION_IMPORTS */
    1.92 +_STLP_END_NAMESPACE
    1.93 +#endif /* _STLP_IMPORT_VENDOR_CSTD */
    1.94 +
    1.95 +_STLP_BEGIN_NAMESPACE
    1.96 +
    1.97 +# if defined(_STLP_HAS_NO_NEW_C_HEADERS) && defined(__cplusplus)
    1.98 +
    1.99 +#if defined (__SYMBIAN32__)
   1.100 +inline long   abs(long __x) { return ::abs((int)__x); }
   1.101 +inline ldiv_t div(long __x, long __y) { return ::ldiv(__x, __y); }
   1.102 +#else
   1.103 +# if !defined ( _STLP_LABS )
   1.104 +inline long   abs(long __x) { return _STLP_VENDOR_CSTD::labs(__x); }
   1.105 +# endif
   1.106 +#endif
   1.107 +# if !defined ( _STLP_LDIV )
   1.108 +inline ldiv_t div(long __x, long __y) { return _STLP_VENDOR_CSTD::ldiv(__x, __y); } 
   1.109 +# endif
   1.110 +# endif
   1.111 +
   1.112 +#  if defined ( _STLP_LLABS )
   1.113 +_STLP_LONG_LONG   abs(_STLP_LONG_LONG __x) { return _STLP_VENDOR_CSTD::_STLP_LLABS(__x); }
   1.114 +#  endif
   1.115 +#  if defined ( _STLP_LLDIV )
   1.116 +_STLP_LLDIV_T div(_STLP_LONG_LONG __x, _STLP_LONG_LONG __y) { return _STLP_VENDOR_CSTD::_STLP_LLDIV(__x, __y); } 
   1.117 +#  endif
   1.118 +
   1.119 +_STLP_END_NAMESPACE
   1.120 +
   1.121 +# if (_STLP_OUTERMOST_HEADER_ID == 0x116)
   1.122 +#  include <stl/_epilog.h>
   1.123 +#  undef _STLP_OUTERMOST_HEADER_ID
   1.124 +# endif
   1.125 +
   1.126 +#endif /* _STLP_CSTDLIB */
   1.127 +
   1.128 +// Local Variables:
   1.129 +// mode:C++
   1.130 +// End: