2  * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
 
     7  * This material is provided "as is", with absolutely no warranty expressed
 
     8  * or implied. Any use is at your own risk.
 
    10  * Permission to use or copy this software for any purpose is hereby granted 
 
    11  * without fee, provided the above notices are retained on all copies.
 
    12  * Permission to modify the code and to distribute modified code is granted,
 
    13  * provided the above notices are retained, and a notice that the code was
 
    14  * modified is included with the above copyright notice.
 
    19 # define _STLP_CSTDLIB
 
    21 # ifndef _STLP_OUTERMOST_HEADER_ID
 
    22 #  define _STLP_OUTERMOST_HEADER_ID 0x116
 
    23 #  include <stl/_prolog.h>
 
    26 # if defined (_STLP_USE_NEW_C_HEADERS)
 
    27 #  include _STLP_NATIVE_CPP_C_HEADER(cstdlib)
 
    32 # include _STLP_NATIVE_C_HEADER(stdlib.h)
 
    36 # if defined( __MSL__ ) && __MSL__ <= 0x5003
 
    38 	typedef ::div_t div_t;
 
    39 	typedef ::ldiv_t ldiv_t;
 
    40 #  ifdef __MSL_LONGLONG_SUPPORT__
 
    41 	typedef ::lldiv_t lldiv_t;
 
    46 # ifdef _STLP_IMPORT_VENDOR_CSTD 
 
    48 using _STLP_VENDOR_CSTD::div_t;
 
    49 using _STLP_VENDOR_CSTD::ldiv_t;
 
    50 using _STLP_VENDOR_CSTD::size_t;
 
    52 #  ifndef _STLP_NO_CSTD_FUNCTION_IMPORTS
 
    53 using _STLP_VENDOR_CSTD::abort;
 
    54 using _STLP_VENDOR_CSTD::atexit;
 
    55 using _STLP_VENDOR_CSTD::exit;
 
    56 using _STLP_VENDOR_CSTD::getenv;
 
    57 using _STLP_VENDOR_CSTD::calloc;
 
    58 using _STLP_VENDOR_CSTD::free;
 
    59 using _STLP_VENDOR_CSTD::malloc;
 
    60 using _STLP_VENDOR_CSTD::realloc;
 
    61 using _STLP_VENDOR_CSTD::atof;
 
    62 using _STLP_VENDOR_CSTD::atoi;
 
    63 using _STLP_VENDOR_CSTD::atol;
 
    64 using _STLP_VENDOR_CSTD::mblen;
 
    65 using _STLP_VENDOR_CSTD::mbstowcs;
 
    66 using _STLP_VENDOR_CSTD::mbtowc;
 
    67 using _STLP_VENDOR_CSTD::strtod;
 
    68 using _STLP_VENDOR_CSTD::strtol;
 
    69 using _STLP_VENDOR_CSTD::strtoul;
 
    70 using _STLP_VENDOR_CSTD::system;
 
    72 #if ! (defined (_STLP_NO_NATIVE_WIDE_STREAMS) || defined (_STLP_NO_MBSTATE_T) )
 
    73 using _STLP_VENDOR_CSTD::wcstombs;
 
    74 using _STLP_VENDOR_CSTD::wctomb;
 
    76 using _STLP_VENDOR_CSTD::bsearch;
 
    77 using _STLP_VENDOR_CSTD::qsort;
 
    78 // boris : if we do not have native float abs, we define ours; then we cannot do "using" for "other" abs 
 
    79 # ifdef _STLP_HAS_NATIVE_FLOAT_ABS 
 
    80 using _STLP_VENDOR_CSTD::abs;
 
    82 using _STLP_VENDOR_CSTD::div;
 
    83 using _STLP_VENDOR_CSTD::labs;
 
    84 using _STLP_VENDOR_CSTD::ldiv;
 
    85 using _STLP_VENDOR_CSTD::rand;
 
    86 using _STLP_VENDOR_CSTD::srand;
 
    87 #  endif /* _STLP_NO_CSTD_FUNCTION_IMPORTS */
 
    89 #endif /* _STLP_IMPORT_VENDOR_CSTD */
 
    93 # if defined(_STLP_HAS_NO_NEW_C_HEADERS) && defined(__cplusplus)
 
    95 #if defined (__SYMBIAN32__)
 
    96 inline long   abs(long __x) { return ::abs((int)__x); }
 
    97 inline ldiv_t div(long __x, long __y) { return ::ldiv(__x, __y); }
 
    99 # if !defined ( _STLP_LABS )
 
   100 inline long   abs(long __x) { return _STLP_VENDOR_CSTD::labs(__x); }
 
   103 # if !defined ( _STLP_LDIV )
 
   104 inline ldiv_t div(long __x, long __y) { return _STLP_VENDOR_CSTD::ldiv(__x, __y); } 
 
   108 #  if defined ( _STLP_LLABS )
 
   109 _STLP_LONG_LONG   abs(_STLP_LONG_LONG __x) { return _STLP_VENDOR_CSTD::_STLP_LLABS(__x); }
 
   111 #  if defined ( _STLP_LLDIV )
 
   112 _STLP_LLDIV_T div(_STLP_LONG_LONG __x, _STLP_LONG_LONG __y) { return _STLP_VENDOR_CSTD::_STLP_LLDIV(__x, __y); } 
 
   117 # if (_STLP_OUTERMOST_HEADER_ID == 0x116)
 
   118 #  include <stl/_epilog.h>
 
   119 #  undef _STLP_OUTERMOST_HEADER_ID
 
   122 #endif /* _STLP_CSTDLIB */