OpenCores
URL https://opencores.org/ocsvn/altor32/altor32/trunk

Subversion Repositories altor32

[/] [altor32/] [trunk/] [gcc-x64/] [or1knd-elf/] [or1knd-elf/] [include/] [c++/] [4.8.0/] [cstdlib] - Blame information for rev 35

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 35 ultra_embe
// -*- C++ -*- forwarding header.
2
 
3
// Copyright (C) 1997-2012 Free Software Foundation, Inc.
4
//
5
// This file is part of the GNU ISO C++ Library.  This library is free
6
// software; you can redistribute it and/or modify it under the
7
// terms of the GNU General Public License as published by the
8
// Free Software Foundation; either version 3, or (at your option)
9
// any later version.
10
 
11
// This library is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
// GNU General Public License for more details.
15
 
16
// Under Section 7 of GPL version 3, you are granted additional
17
// permissions described in the GCC Runtime Library Exception, version
18
// 3.1, as published by the Free Software Foundation.
19
 
20
// You should have received a copy of the GNU General Public License and
21
// a copy of the GCC Runtime Library Exception along with this program;
22
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23
// .
24
 
25
/** @file include/cstdlib
26
 *  This is a Standard C++ Library file.  You should @c \#include this file
27
 *  in your programs, rather than any of the @a *.h implementation files.
28
 *
29
 *  This is the C++ version of the Standard C Library header @c stdlib.h,
30
 *  and its contents are (mostly) the same as that header, but are all
31
 *  contained in the namespace @c std (except for names which are defined
32
 *  as macros in C).
33
 */
34
 
35
//
36
// ISO C++ 14882: 20.4.6  C library
37
//
38
 
39
#pragma GCC system_header
40
 
41
#include 
42
 
43
#ifndef _GLIBCXX_CSTDLIB
44
#define _GLIBCXX_CSTDLIB 1
45
 
46
#if !_GLIBCXX_HOSTED
47
// The C standard does not require a freestanding implementation to
48
// provide .  However, the C++ standard does still require
49
//  -- but only the functionality mentioned in
50
// [lib.support.start.term].
51
 
52
#define EXIT_SUCCESS 0
53
#define EXIT_FAILURE 1
54
 
55
namespace std
56
{
57
  extern "C" void abort(void) throw () _GLIBCXX_NORETURN;
58
  extern "C" int atexit(void (*)()) throw ();
59
  extern "C" void exit(int) throw () _GLIBCXX_NORETURN;
60
} // namespace std
61
 
62
#else
63
 
64
#include 
65
 
66
// Get rid of those macros defined in  in lieu of real functions.
67
#undef abort
68
#undef abs
69
#undef atexit
70
#undef atof
71
#undef atoi
72
#undef atol
73
#undef bsearch
74
#undef calloc
75
#undef div
76
#undef exit
77
#undef free
78
#undef getenv
79
#undef labs
80
#undef ldiv
81
#undef malloc
82
#undef mblen
83
#undef mbstowcs
84
#undef mbtowc
85
#undef qsort
86
#undef rand
87
#undef realloc
88
#undef srand
89
#undef strtod
90
#undef strtol
91
#undef strtoul
92
#undef system
93
#undef wcstombs
94
#undef wctomb
95
 
96
namespace std _GLIBCXX_VISIBILITY(default)
97
{
98
_GLIBCXX_BEGIN_NAMESPACE_VERSION
99
 
100
  using ::div_t;
101
  using ::ldiv_t;
102
 
103
  using ::abort;
104
  using ::abs;
105
  using ::atexit;
106
  using ::atof;
107
  using ::atoi;
108
  using ::atol;
109
  using ::bsearch;
110
  using ::calloc;
111
  using ::div;
112
  using ::exit;
113
  using ::free;
114
  using ::getenv;
115
  using ::labs;
116
  using ::ldiv;
117
  using ::malloc;
118
#ifdef _GLIBCXX_HAVE_MBSTATE_T
119
  using ::mblen;
120
  using ::mbstowcs;
121
  using ::mbtowc;
122
#endif // _GLIBCXX_HAVE_MBSTATE_T
123
  using ::qsort;
124
  using ::rand;
125
  using ::realloc;
126
  using ::srand;
127
  using ::strtod;
128
  using ::strtol;
129
  using ::strtoul;
130
  using ::system;
131
#ifdef _GLIBCXX_USE_WCHAR_T
132
  using ::wcstombs;
133
  using ::wctomb;
134
#endif // _GLIBCXX_USE_WCHAR_T
135
 
136
#ifndef __CORRECT_ISO_CPP_STDLIB_H_PROTO
137
  inline long
138
  abs(long __i) { return __builtin_labs(__i); }
139
 
140
  inline ldiv_t
141
  div(long __i, long __j) { return ldiv(__i, __j); }
142
#endif
143
 
144
#ifdef _GLIBCXX_USE_LONG_LONG
145
  inline long long
146
  abs(long long __x) { return __builtin_llabs (__x); }
147
#endif
148
 
149
#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
150
  inline __int128
151
  abs(__int128 __x) { return __x >= 0 ? __x : -__x; }
152
#endif
153
 
154
_GLIBCXX_END_NAMESPACE_VERSION
155
} // namespace
156
 
157
#if _GLIBCXX_USE_C99
158
 
159
#undef _Exit
160
#undef llabs
161
#undef lldiv
162
#undef atoll
163
#undef strtoll
164
#undef strtoull
165
#undef strtof
166
#undef strtold
167
 
168
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
169
{
170
_GLIBCXX_BEGIN_NAMESPACE_VERSION
171
 
172
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
173
  using ::lldiv_t;
174
#endif
175
#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
176
  extern "C" void (_Exit)(int) throw () _GLIBCXX_NORETURN;
177
#endif
178
#if !_GLIBCXX_USE_C99_DYNAMIC
179
  using ::_Exit;
180
#endif
181
 
182
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
183
  using ::llabs;
184
 
185
  inline lldiv_t
186
  div(long long __n, long long __d)
187
  { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
188
 
189
  using ::lldiv;
190
#endif
191
 
192
#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
193
  extern "C" long long int (atoll)(const char *) throw ();
194
  extern "C" long long int
195
    (strtoll)(const char * __restrict, char ** __restrict, int) throw ();
196
  extern "C" unsigned long long int
197
    (strtoull)(const char * __restrict, char ** __restrict, int) throw ();
198
#endif
199
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
200
  using ::atoll;
201
  using ::strtoll;
202
  using ::strtoull;
203
#endif
204
  using ::strtof;
205
  using ::strtold;
206
 
207
_GLIBCXX_END_NAMESPACE_VERSION
208
} // namespace __gnu_cxx
209
 
210
namespace std
211
{
212
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
213
  using ::__gnu_cxx::lldiv_t;
214
#endif
215
  using ::__gnu_cxx::_Exit;
216
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
217
  using ::__gnu_cxx::llabs;
218
  using ::__gnu_cxx::div;
219
  using ::__gnu_cxx::lldiv;
220
#endif
221
  using ::__gnu_cxx::atoll;
222
  using ::__gnu_cxx::strtof;
223
  using ::__gnu_cxx::strtoll;
224
  using ::__gnu_cxx::strtoull;
225
  using ::__gnu_cxx::strtold;
226
} // namespace std
227
 
228
#endif // _GLIBCXX_USE_C99
229
 
230
#endif // !_GLIBCXX_HOSTED
231
 
232
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.