This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: namespace c99


Benjamin Kosnik <bkoz@redhat.com> writes:

| I'll be interested to see  what you come up with.

Why this doesn't work for you?

However, I'm wondering why we don't just use the extension namespace
__gnu_cxx in place of std::c99. (Yes, I know I'm the original proposer
of c99; sorry for the flip-flop).

-- Gaby

2001-05-27  Gabriel Dos Reis  <gdr@merlin.codesourcery.com>

	* include/c_std/bits/std_cmath.h (c99): Define in std::.
	* include/c_std/bits/std_cstdlib.h (c99): Same.
	* include/c_std/bits/std_cwchar.h (c99): Same.

Index: include/c_std/bits/std_cmath.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/bits/std_cmath.h,v
retrieving revision 1.6.2.4
diff -p -r1.6.2.4 std_cmath.h
*** std_cmath.h	2001/05/26 07:00:53	1.6.2.4
--- std_cmath.h	2001/05/27 16:20:21
*************** namespace std 
*** 574,632 ****
  // These are possible macros imported from C99-land. For strict
  // conformance, remove possible C99-injected names from the
  // global namespace, and sequester them in the c99 namespace. 
! namespace c99
  {
!   template<typename _Tp>
!     int 
!     __capture_fpclassify(_Tp __f) { return fpclassify(__f); }
! 
!   template<typename _Tp>
!     int 
!     __capture_isfinite(_Tp __f) { return isfinite(__f); }
! 
!   template<typename _Tp>
!     int 
!     __capture_isinf(_Tp __f) { return isinf(__f); }
! 
!   template<typename _Tp>
!     int 
!     __capture_isnan(_Tp __f) { return isnan(__f); }
! 
!   template<typename _Tp>
!     int 
!     __capture_isnormal(_Tp __f) { return isnormal(__f); }
! 
!   template<typename _Tp>
!     int 
!     __capture_signbit(_Tp __f) { return signbit(__f); }
! 
!   template<typename _Tp>
!     int 
!     __capture_isgreater(_Tp __f1, _Tp __f2) { return isgreater(__f1, __f2); }
! 
!  template<typename _Tp>
!     int 
!     __capture_isgreaterequal(_Tp __f1, _Tp __f2) 
!     { return isgreaterequal(__f1, __f2); }
! 
!  template<typename _Tp>
!     int 
!     __capture_isless(_Tp __f1, _Tp __f2) { return isless(__f1, __f2); }
! 
!  template<typename _Tp>
!     int 
!     __capture_islessequal(_Tp __f1, _Tp __f2) 
!     { return islessequal(__f1, __f2); }
! 
!  template<typename _Tp>
!     int 
!     __capture_islessgreater(_Tp __f1, _Tp __f2) 
!     { return islessgreater(__f1, __f2); }
! 
!  template<typename _Tp>
!     int 
!     __capture_isunordered(_Tp __f1, _Tp __f2) 
!     { return isunordered(__f1, __f2); }
  } // namespace c99
  #endif
  
--- 574,636 ----
  // These are possible macros imported from C99-land. For strict
  // conformance, remove possible C99-injected names from the
  // global namespace, and sequester them in the c99 namespace. 
! namespace std
  {
!   namespace c99
!   {
!      template<typename _Tp>
!        int 
!        __capture_fpclassify(_Tp __f) { return fpclassify(__f); }
! 
!      template<typename _Tp>
!        int 
!        __capture_isfinite(_Tp __f) { return isfinite(__f); }
! 
!      template<typename _Tp>
!        int 
!        __capture_isinf(_Tp __f) { return isinf(__f); }
! 
!      template<typename _Tp>
!        int 
!        __capture_isnan(_Tp __f) { return isnan(__f); }
! 
!      template<typename _Tp>
!        int 
!        __capture_isnormal(_Tp __f) { return isnormal(__f); }
! 
!      template<typename _Tp>
!        int 
!        __capture_signbit(_Tp __f) { return signbit(__f); }
! 
!      template<typename _Tp>
!        int 
!        __capture_isgreater(_Tp __f1, _Tp __f2)
!        { return isgreater(__f1, __f2); }
! 
!     template<typename _Tp>
!        int 
!        __capture_isgreaterequal(_Tp __f1, _Tp __f2) 
!        { return isgreaterequal(__f1, __f2); }
! 
!     template<typename _Tp>
!        int 
!        __capture_isless(_Tp __f1, _Tp __f2) { return isless(__f1, __f2); }
! 
!     template<typename _Tp>
!        int 
!        __capture_islessequal(_Tp __f1, _Tp __f2) 
!        { return islessequal(__f1, __f2); }
! 
!     template<typename _Tp>
!        int 
!        __capture_islessgreater(_Tp __f1, _Tp __f2) 
!        { return islessgreater(__f1, __f2); }
! 
!     template<typename _Tp>
!        int 
!        __capture_isunordered(_Tp __f1, _Tp __f2) 
!        { return isunordered(__f1, __f2); }
!   }
  } // namespace c99
  #endif
  
Index: include/c_std/bits/std_cstdlib.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/bits/std_cstdlib.h,v
retrieving revision 1.7.2.1
diff -p -r1.7.2.1 std_cstdlib.h
*** std_cstdlib.h	2001/05/14 19:49:07	1.7.2.1
--- std_cstdlib.h	2001/05/27 16:20:21
*************** namespace std 
*** 126,157 ****
  } // namespace std
  
  #if _GLIBCPP_USE_C99
! namespace c99
  {
!   using ::lldiv_t;
! 
!   inline long long 
!   abs(long long __x) { return __x >= 0 ? __x : -__x; }
! 
!   inline long long 
!   llabs(long long __x) { return __x >= 0 ? __x : -__x; }
! 
!   inline lldiv_t 
!   div(long long __n, long long __d)
!   { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
! 
!   inline lldiv_t 
!   lldiv(long long __n, long long __d)
!   { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
! 
!   extern "C" long long int atoll(const char*); 
!   extern "C" long long int strtoll(const char*, char**, int); 
!   extern "C" unsigned long long int strtoull(const char*, char**, int); 
! 
! #ifdef _GLIBCPP_HAVE_STRTOLD
!   extern "C" long double strtold(const char*, char**); 
! #endif
! } // namespace c99
  
  namespace std
  {
--- 126,160 ----
  } // namespace std
  
  #if _GLIBCPP_USE_C99
! namespace std
  {
!   namespace c99
!   {
!     using ::lldiv_t;
! 
!     inline long long 
!     abs(long long __x) { return __x >= 0 ? __x : -__x; }
! 
!     inline long long 
!     llabs(long long __x) { return __x >= 0 ? __x : -__x; }
! 
!     inline lldiv_t 
!     div(long long __n, long long __d)
!     { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
! 
!     inline lldiv_t 
!     lldiv(long long __n, long long __d)
!     { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
! 
!     extern "C" long long int atoll(const char*); 
!     extern "C" long long int strtoll(const char*, char**, int); 
!     extern "C" unsigned long long int strtoull(const char*, char**, int); 
! 
!   #ifdef _GLIBCPP_HAVE_STRTOLD
!     extern "C" long double strtold(const char*, char**); 
!   #endif
!   } // namespace c99
! } // namespace std
  
  namespace std
  {
Index: include/c_std/bits/std_cwchar.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/bits/std_cwchar.h,v
retrieving revision 1.5.2.2
diff -p -r1.5.2.2 std_cwchar.h
*** std_cwchar.h	2001/05/22 05:02:58	1.5.2.2
--- std_cwchar.h	2001/05/27 16:20:22
*************** namespace std
*** 205,215 ****
  }
  
  #if _GLIBCPP_USE_C99
! namespace c99
  {
!   extern "C" long double wcstold(const wchar_t*, wchar_t**); 
!   extern "C" long long int wcstoll(const wchar_t*, wchar_t**, int); 
!   extern "C" unsigned long long int wcstoull(const wchar_t*, wchar_t**, int); 
  }
  
  namespace std
--- 205,218 ----
  }
  
  #if _GLIBCPP_USE_C99
! namespace std
  {
!   namespace c99
!   {
!     extern "C" long double wcstold(const wchar_t*, wchar_t**); 
!     extern "C" long long int wcstoll(const wchar_t*, wchar_t**, int); 
!     extern "C" unsigned long long int wcstoull(const wchar_t*, wchar_t**, int); 
!   }
  }
  
  namespace std


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]