OSDN Git Service

2001-03-05 scott snyder <snyder@fnal.gov>
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Mar 2001 02:51:15 +0000 (02:51 +0000)
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Mar 2001 02:51:15 +0000 (02:51 +0000)
libstdc++/2190
        * include/c_std/bits/std_cmath.h: Move abs(long), div(long,long)
        from here...
        * include/c_std/bits/std_cstdlib.h: ... to here.
* testsuite/17_intro/header_cstdlib.cc: Add test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40254 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/c_std/bits/std_cmath.h
libstdc++-v3/include/c_std/bits/std_cstdlib.h
libstdc++-v3/testsuite/17_intro/header_cstdlib.cc

index 8de5360..4007fcf 100644 (file)
@@ -1,3 +1,11 @@
+2001-03-05  scott snyder  <snyder@fnal.gov>
+
+       libstdc++/2190
+        * include/c_std/bits/std_cmath.h: Move abs(long), div(long,long)
+        from here...
+        * include/c_std/bits/std_cstdlib.h: ... to here.
+       * testsuite/17_intro/header_cstdlib.cc: Add test.
+       
 2001-03-05  Stephen M. Webb  <stephen.webb@cybersafe.com>
 
        * libsupc++/vec.cc (__cxxa_vec_new2): Qualify size_t.
index 3648b20..acddb33 100644 (file)
@@ -80,12 +80,6 @@ namespace std
       return __x < _Tp() ? -__x : __x;
     }
 
-  inline long 
-  abs(long __i) { return ::labs(__i); }
-
-  inline ldiv_t
-  div(long __i, long __j) { return ::ldiv(__i, __j); }
-
 #if _GLIBCPP_HAVE___BUILTIN_FABSF
   inline float 
   abs(float __x) { return __builtin_fabsf(__x); }
index 5ee0b7e..8b7776d 100644 (file)
@@ -130,6 +130,12 @@ namespace std
   extern "C" size_t mbstowcs(wchar_t*, const char*, size_t); 
   extern "C" size_t wcstombs(char*, const wchar_t*, size_t);
 
+  inline long 
+  abs(long __i) { return ::labs(__i); }
+
+  inline ldiv_t
+  div(long __i, long __j) { return ::ldiv(__i, __j); }
+
 #ifdef _GLIBCPP_USE_LONG_LONG
   inline long long 
   abs(long long __x) { return __x >= 0 ? __x : -__x; }
index 3a4664e..5ce60cb 100644 (file)
 
 #include <cstdlib>
 
+// libstdc++/2190
+void test01()
+{
+  long a = std::abs(1L);
+  ldiv_t b = std::div(2L, 1L);
+}
 
-int main(void)
+void test02()
 {
   // Make sure size_t is in namespace std
   std::size_t i = 5;            // { dg-do compile }
-  return 0;
 }
 
+int main()
+{
+  test01();
+  test02();
+  return 0;
+}