williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
|
williamr@2
|
3 |
*
|
williamr@2
|
4 |
* Copyright (c) 1999
|
williamr@2
|
5 |
* Boris Fomitchev
|
williamr@2
|
6 |
*
|
williamr@2
|
7 |
* This material is provided "as is", with absolutely no warranty expressed
|
williamr@2
|
8 |
* or implied. Any use is at your own risk.
|
williamr@2
|
9 |
*
|
williamr@2
|
10 |
* Permission to use or copy this software for any purpose is hereby granted
|
williamr@2
|
11 |
* without fee, provided the above notices are retained on all copies.
|
williamr@2
|
12 |
* Permission to modify the code and to distribute modified code is granted,
|
williamr@2
|
13 |
* provided the above notices are retained, and a notice that the code was
|
williamr@2
|
14 |
* modified is included with the above copyright notice.
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
#ifndef _STLP_CSTDLIB
|
williamr@2
|
19 |
# define _STLP_CSTDLIB
|
williamr@2
|
20 |
|
williamr@2
|
21 |
# ifndef _STLP_OUTERMOST_HEADER_ID
|
williamr@2
|
22 |
# define _STLP_OUTERMOST_HEADER_ID 0x116
|
williamr@2
|
23 |
# include <stl/_prolog.h>
|
williamr@2
|
24 |
# endif
|
williamr@2
|
25 |
|
williamr@2
|
26 |
# if defined (_STLP_USE_NEW_C_HEADERS)
|
williamr@2
|
27 |
# include _STLP_NATIVE_CPP_C_HEADER(cstdlib)
|
williamr@2
|
28 |
# else
|
williamr@2
|
29 |
#ifdef __SYMBIAN32__
|
williamr@2
|
30 |
# include <stdlib.h>
|
williamr@2
|
31 |
#else
|
williamr@2
|
32 |
# include _STLP_NATIVE_C_HEADER(stdlib.h)
|
williamr@2
|
33 |
#endif
|
williamr@2
|
34 |
# endif
|
williamr@2
|
35 |
|
williamr@2
|
36 |
# if defined( __MSL__ ) && __MSL__ <= 0x5003
|
williamr@2
|
37 |
namespace std {
|
williamr@2
|
38 |
typedef ::div_t div_t;
|
williamr@2
|
39 |
typedef ::ldiv_t ldiv_t;
|
williamr@2
|
40 |
# ifdef __MSL_LONGLONG_SUPPORT__
|
williamr@2
|
41 |
typedef ::lldiv_t lldiv_t;
|
williamr@2
|
42 |
# endif
|
williamr@2
|
43 |
}
|
williamr@2
|
44 |
# endif
|
williamr@2
|
45 |
|
williamr@2
|
46 |
# ifdef _STLP_IMPORT_VENDOR_CSTD
|
williamr@2
|
47 |
_STLP_BEGIN_NAMESPACE
|
williamr@2
|
48 |
using _STLP_VENDOR_CSTD::div_t;
|
williamr@2
|
49 |
using _STLP_VENDOR_CSTD::ldiv_t;
|
williamr@2
|
50 |
using _STLP_VENDOR_CSTD::size_t;
|
williamr@2
|
51 |
|
williamr@2
|
52 |
# ifndef _STLP_NO_CSTD_FUNCTION_IMPORTS
|
williamr@2
|
53 |
using _STLP_VENDOR_CSTD::abort;
|
williamr@2
|
54 |
using _STLP_VENDOR_CSTD::atexit;
|
williamr@2
|
55 |
using _STLP_VENDOR_CSTD::exit;
|
williamr@2
|
56 |
using _STLP_VENDOR_CSTD::getenv;
|
williamr@2
|
57 |
using _STLP_VENDOR_CSTD::calloc;
|
williamr@2
|
58 |
using _STLP_VENDOR_CSTD::free;
|
williamr@2
|
59 |
using _STLP_VENDOR_CSTD::malloc;
|
williamr@2
|
60 |
using _STLP_VENDOR_CSTD::realloc;
|
williamr@2
|
61 |
using _STLP_VENDOR_CSTD::atof;
|
williamr@2
|
62 |
using _STLP_VENDOR_CSTD::atoi;
|
williamr@2
|
63 |
using _STLP_VENDOR_CSTD::atol;
|
williamr@2
|
64 |
using _STLP_VENDOR_CSTD::mblen;
|
williamr@2
|
65 |
using _STLP_VENDOR_CSTD::mbstowcs;
|
williamr@2
|
66 |
using _STLP_VENDOR_CSTD::mbtowc;
|
williamr@2
|
67 |
using _STLP_VENDOR_CSTD::strtod;
|
williamr@2
|
68 |
using _STLP_VENDOR_CSTD::strtol;
|
williamr@2
|
69 |
using _STLP_VENDOR_CSTD::strtoul;
|
williamr@2
|
70 |
using _STLP_VENDOR_CSTD::system;
|
williamr@2
|
71 |
|
williamr@2
|
72 |
#if ! (defined (_STLP_NO_NATIVE_WIDE_STREAMS) || defined (_STLP_NO_MBSTATE_T) )
|
williamr@2
|
73 |
using _STLP_VENDOR_CSTD::wcstombs;
|
williamr@2
|
74 |
using _STLP_VENDOR_CSTD::wctomb;
|
williamr@2
|
75 |
#endif
|
williamr@2
|
76 |
using _STLP_VENDOR_CSTD::bsearch;
|
williamr@2
|
77 |
using _STLP_VENDOR_CSTD::qsort;
|
williamr@2
|
78 |
// boris : if we do not have native float abs, we define ours; then we cannot do "using" for "other" abs
|
williamr@2
|
79 |
# ifdef _STLP_HAS_NATIVE_FLOAT_ABS
|
williamr@2
|
80 |
using _STLP_VENDOR_CSTD::abs;
|
williamr@2
|
81 |
# endif
|
williamr@2
|
82 |
using _STLP_VENDOR_CSTD::div;
|
williamr@2
|
83 |
using _STLP_VENDOR_CSTD::labs;
|
williamr@2
|
84 |
using _STLP_VENDOR_CSTD::ldiv;
|
williamr@2
|
85 |
using _STLP_VENDOR_CSTD::rand;
|
williamr@2
|
86 |
using _STLP_VENDOR_CSTD::srand;
|
williamr@2
|
87 |
# endif /* _STLP_NO_CSTD_FUNCTION_IMPORTS */
|
williamr@2
|
88 |
_STLP_END_NAMESPACE
|
williamr@2
|
89 |
#endif /* _STLP_IMPORT_VENDOR_CSTD */
|
williamr@2
|
90 |
|
williamr@2
|
91 |
_STLP_BEGIN_NAMESPACE
|
williamr@2
|
92 |
|
williamr@2
|
93 |
# if defined(_STLP_HAS_NO_NEW_C_HEADERS) && defined(__cplusplus)
|
williamr@2
|
94 |
|
williamr@2
|
95 |
#if defined (__SYMBIAN32__)
|
williamr@2
|
96 |
inline long abs(long __x) { return ::abs((int)__x); }
|
williamr@2
|
97 |
inline ldiv_t div(long __x, long __y) { return ::ldiv(__x, __y); }
|
williamr@2
|
98 |
#else
|
williamr@2
|
99 |
# if !defined ( _STLP_LABS )
|
williamr@2
|
100 |
inline long abs(long __x) { return _STLP_VENDOR_CSTD::labs(__x); }
|
williamr@2
|
101 |
# endif
|
williamr@2
|
102 |
#endif
|
williamr@2
|
103 |
# if !defined ( _STLP_LDIV )
|
williamr@2
|
104 |
inline ldiv_t div(long __x, long __y) { return _STLP_VENDOR_CSTD::ldiv(__x, __y); }
|
williamr@2
|
105 |
# endif
|
williamr@2
|
106 |
# endif
|
williamr@2
|
107 |
|
williamr@2
|
108 |
# if defined ( _STLP_LLABS )
|
williamr@2
|
109 |
_STLP_LONG_LONG abs(_STLP_LONG_LONG __x) { return _STLP_VENDOR_CSTD::_STLP_LLABS(__x); }
|
williamr@2
|
110 |
# endif
|
williamr@2
|
111 |
# if defined ( _STLP_LLDIV )
|
williamr@2
|
112 |
_STLP_LLDIV_T div(_STLP_LONG_LONG __x, _STLP_LONG_LONG __y) { return _STLP_VENDOR_CSTD::_STLP_LLDIV(__x, __y); }
|
williamr@2
|
113 |
# endif
|
williamr@2
|
114 |
|
williamr@2
|
115 |
_STLP_END_NAMESPACE
|
williamr@2
|
116 |
|
williamr@2
|
117 |
# if (_STLP_OUTERMOST_HEADER_ID == 0x116)
|
williamr@2
|
118 |
# include <stl/_epilog.h>
|
williamr@2
|
119 |
# undef _STLP_OUTERMOST_HEADER_ID
|
williamr@2
|
120 |
# endif
|
williamr@2
|
121 |
|
williamr@2
|
122 |
#endif /* _STLP_CSTDLIB */
|
williamr@2
|
123 |
|
williamr@2
|
124 |
// Local Variables:
|
williamr@2
|
125 |
// mode:C++
|
williamr@2
|
126 |
// End:
|