home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / programacao / cwin / c.exe / $INSTDIR / include / c++ / cstdlib < prev    next >
Encoding:
Text File  |  2003-12-15  |  4.0 KB  |  179 lines

  1. // -*- C++ -*- forwarding header.
  2.  
  3. // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
  4. // Free Software Foundation, Inc.
  5. //
  6. // This file is part of the GNU ISO C++ Library.  This library is free
  7. // software; you can redistribute it and/or modify it under the
  8. // terms of the GNU General Public License as published by the
  9. // Free Software Foundation; either version 2, or (at your option)
  10. // any later version.
  11.  
  12. // This library is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. // GNU General Public License for more details.
  16.  
  17. // You should have received a copy of the GNU General Public License along
  18. // with this library; see the file COPYING.  If not, write to the Free
  19. // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  20. // USA.
  21.  
  22. // As a special exception, you may use this file as part of a free software
  23. // library without restriction.  Specifically, if other files instantiate
  24. // templates or use macros or inline functions from this file, or you compile
  25. // this file and link it with other files to produce an executable, this
  26. // file does not by itself cause the resulting executable to be covered by
  27. // the GNU General Public License.  This exception does not however
  28. // invalidate any other reasons why the executable file might be covered by
  29. // the GNU General Public License.
  30.  
  31. //
  32. // ISO C++ 14882: 20.4.6  C library
  33. //
  34.  
  35. /** @file cstdlib
  36.  *  This is a Standard C++ Library file.  You should @c #include this file
  37.  *  in your programs, rather than any of the "*.h" implementation files.
  38.  *
  39.  *  This is the C++ version of the Standard C Library header @c stdlib.h,
  40.  *  and its contents are (mostly) the same as that header, but are all
  41.  *  contained in the namespace @c std.
  42.  */
  43.  
  44. #ifndef _CPP_CSTDLIB
  45. #define _CPP_CSTDLIB 1
  46.  
  47. #pragma GCC system_header
  48.  
  49. #include <bits/c++config.h>
  50. #include <cstddef>
  51.  
  52. #include <stdlib.h>
  53.  
  54. // Get rid of those macros defined in <stdlib.h> in lieu of real functions.
  55. #undef abort
  56. #undef abs
  57. #undef atexit
  58. #undef atof
  59. #undef atoi
  60. #undef atol
  61. #undef bsearch
  62. #undef calloc
  63. #undef div
  64. #undef exit
  65. #undef free
  66. #undef getenv
  67. #undef labs
  68. #undef ldiv
  69. #undef malloc
  70. #undef mblen
  71. #undef mbstowcs
  72. #undef mbtowc
  73. #undef qsort
  74. #undef rand
  75. #undef realloc
  76. #undef srand
  77. #undef strtod
  78. #undef strtol
  79. #undef strtoul
  80. #undef system
  81. #undef wcstombs
  82. #undef wctomb
  83.  
  84. namespace std 
  85. {
  86.   using ::div_t;
  87.   using ::ldiv_t;
  88.  
  89.   using ::abort;
  90.   using ::abs;
  91.   using ::atexit;
  92.   using ::atof;
  93.   using ::atoi;
  94.   using ::atol;
  95.   using ::bsearch;
  96.   using ::calloc;
  97.   using ::div;
  98.   using ::exit;
  99.   using ::free;
  100.   using ::getenv;
  101.   using ::labs;
  102.   using ::ldiv;
  103.   using ::malloc;
  104.   using ::mblen;
  105.   using ::mbstowcs;
  106.   using ::mbtowc;
  107.   using ::qsort;
  108.   using ::rand;
  109.   using ::realloc;
  110.   using ::srand;
  111.   using ::strtod;
  112.   using ::strtol;
  113.   using ::strtoul;
  114.   using ::system;
  115.   using ::wcstombs;
  116.   using ::wctomb;
  117.  
  118.   inline long 
  119.   abs(long __i) { return labs(__i); }
  120.  
  121.   inline ldiv_t
  122.   div(long __i, long __j) { return ldiv(__i, __j); }
  123.  
  124. #if _GLIBCPP_USE_C99
  125.  
  126. #undef _Exit
  127. #undef llabs
  128. #undef lldiv
  129. #undef atoll
  130. #undef strtoll
  131. #undef strtoull
  132. #undef strtof
  133. #undef strtold
  134.  
  135. namespace __gnu_cxx
  136. {
  137.   using ::lldiv_t;
  138.   using ::_Exit;
  139.  
  140.   inline long long 
  141.   abs(long long __x) { return __x >= 0 ? __x : -__x; }
  142.  
  143.   inline long long 
  144.   llabs(long long __x) { return __x >= 0 ? __x : -__x; }
  145.  
  146.   inline lldiv_t 
  147.   div(long long __n, long long __d)
  148.   { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
  149.  
  150.   inline lldiv_t 
  151.   lldiv(long long __n, long long __d)
  152.   { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
  153.  
  154.   using ::atoll;
  155.   using ::strtof;
  156.   using ::strtoll;
  157.   using ::strtoull;
  158.   using ::strtold; 
  159.  
  160. namespace std
  161. {
  162.   using __gnu_cxx::lldiv_t;
  163.   using __gnu_cxx::_Exit;
  164.   using __gnu_cxx::abs;
  165.   using __gnu_cxx::llabs; 
  166.   using __gnu_cxx::div;
  167.   using __gnu_cxx::lldiv;
  168.   using __gnu_cxx::atoll;
  169.   using __gnu_cxx::strtof;
  170.   using __gnu_cxx::strtoll;
  171.   using __gnu_cxx::strtoull;
  172.   using __gnu_cxx::strtold;
  173. }
  174. #endif
  175.  
  176. #endif 
  177.