+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.
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); }
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; }
#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;
+}