/*
 * © Portions copyright (c) 2006-2007 Nokia Corporation.  All rights reserved.
 *
 * Copyright (c) 1999 
 * Boris Fomitchev
 *
 * This material is provided "as is", with absolutely no warranty expressed
 * or implied. Any use is at your own risk.
 *
 * Permission to use or copy this software for any purpose is hereby granted 
 * without fee, provided the above notices are retained on all copies.
 * Permission to modify the code and to distribute modified code is granted,
 * provided the above notices are retained, and a notice that the code was
 * modified is included with the above copyright notice.
 *
 */

#ifndef _STLP_CSTDLIB
# define _STLP_CSTDLIB

# ifndef _STLP_OUTERMOST_HEADER_ID
#  define _STLP_OUTERMOST_HEADER_ID 0x116
#  include <stl/_prolog.h>
# endif

# if defined (_STLP_USE_NEW_C_HEADERS)
#  include _STLP_NATIVE_CPP_C_HEADER(cstdlib)
# else
#ifdef __SYMBIAN32__
#  include <stdlib.h>
#else
# include _STLP_NATIVE_C_HEADER(stdlib.h)
#endif
# endif

# if defined( __MSL__ ) && __MSL__ <= 0x5003
namespace std {
	typedef ::div_t div_t;
	typedef ::ldiv_t ldiv_t;
#  ifdef __MSL_LONGLONG_SUPPORT__
	typedef ::lldiv_t lldiv_t;
#  endif
}
# endif

# ifdef _STLP_IMPORT_VENDOR_CSTD 
_STLP_BEGIN_NAMESPACE
using _STLP_VENDOR_CSTD::div_t;
using _STLP_VENDOR_CSTD::ldiv_t;
using _STLP_VENDOR_CSTD::size_t;

#  ifndef _STLP_NO_CSTD_FUNCTION_IMPORTS
using _STLP_VENDOR_CSTD::abort;
using _STLP_VENDOR_CSTD::atexit;
using _STLP_VENDOR_CSTD::exit;
using _STLP_VENDOR_CSTD::getenv;
using _STLP_VENDOR_CSTD::calloc;
using _STLP_VENDOR_CSTD::free;
using _STLP_VENDOR_CSTD::malloc;
using _STLP_VENDOR_CSTD::realloc;
using _STLP_VENDOR_CSTD::atof;
using _STLP_VENDOR_CSTD::atoi;
using _STLP_VENDOR_CSTD::atol;
using _STLP_VENDOR_CSTD::mblen;
using _STLP_VENDOR_CSTD::mbstowcs;
using _STLP_VENDOR_CSTD::mbtowc;
using _STLP_VENDOR_CSTD::strtod;
using _STLP_VENDOR_CSTD::strtol;
using _STLP_VENDOR_CSTD::strtoul;
using _STLP_VENDOR_CSTD::system;

#if ! (defined (_STLP_NO_NATIVE_WIDE_STREAMS) || defined (_STLP_NO_MBSTATE_T) )
using _STLP_VENDOR_CSTD::wcstombs;
using _STLP_VENDOR_CSTD::wctomb;
#endif
using _STLP_VENDOR_CSTD::bsearch;
using _STLP_VENDOR_CSTD::qsort;
// boris : if we do not have native float abs, we define ours; then we cannot do "using" for "other" abs 
# ifdef _STLP_HAS_NATIVE_FLOAT_ABS 
using _STLP_VENDOR_CSTD::abs;
# endif
using _STLP_VENDOR_CSTD::div;
using _STLP_VENDOR_CSTD::labs;
using _STLP_VENDOR_CSTD::ldiv;
using _STLP_VENDOR_CSTD::rand;
using _STLP_VENDOR_CSTD::srand;
#  endif /* _STLP_NO_CSTD_FUNCTION_IMPORTS */
_STLP_END_NAMESPACE
#endif /* _STLP_IMPORT_VENDOR_CSTD */

_STLP_BEGIN_NAMESPACE

# if defined(_STLP_HAS_NO_NEW_C_HEADERS) && defined(__cplusplus)

#if defined (__SYMBIAN32__)
inline long   abs(long __x) { return ::abs((int)__x); }
inline ldiv_t div(long __x, long __y) { return ::ldiv(__x, __y); }
#else
# if !defined ( _STLP_LABS )
inline long   abs(long __x) { return _STLP_VENDOR_CSTD::labs(__x); }
# endif
#endif
# if !defined ( _STLP_LDIV )
inline ldiv_t div(long __x, long __y) { return _STLP_VENDOR_CSTD::ldiv(__x, __y); } 
# endif
# endif

#  if defined ( _STLP_LLABS )
_STLP_LONG_LONG   abs(_STLP_LONG_LONG __x) { return _STLP_VENDOR_CSTD::_STLP_LLABS(__x); }
#  endif
#  if defined ( _STLP_LLDIV )
_STLP_LLDIV_T div(_STLP_LONG_LONG __x, _STLP_LONG_LONG __y) { return _STLP_VENDOR_CSTD::_STLP_LLDIV(__x, __y); } 
#  endif

_STLP_END_NAMESPACE

# if (_STLP_OUTERMOST_HEADER_ID == 0x116)
#  include <stl/_epilog.h>
#  undef _STLP_OUTERMOST_HEADER_ID
# endif

#endif /* _STLP_CSTDLIB */

// Local Variables:
// mode:C++
// End:
