OSDN Git Service

* testsuite/testsuite_hooks.cc (__set_testsuite_memlimit): Use
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Oct 2002 23:27:27 +0000 (23:27 +0000)
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Oct 2002 23:27:27 +0000 (23:27 +0000)
__typeof__ (r.rlim_cur), not rlim_t in declaration of limit.

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

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/testsuite_hooks.cc

index c98a2db..13ffd4e 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-24  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       * testsuite/testsuite_hooks.cc (__set_testsuite_memlimit): Use
+       __typeof__ (r.rlim_cur), not rlim_t in declaration of limit.
+
 2002-10-23  Jakub Jelinek  <jakub@redhat.com>
 
        * testsuite/22_locale/num_put_members_char.cc (test01): Swap size
index 4e6c831..0af2bd1 100644 (file)
@@ -38,7 +38,9 @@ void
 __set_testsuite_memlimit(float __size)
 {
     struct rlimit r;
-    rlim_t limit = (rlim_t)(__size * 1048576);
+    // Cater to the absence of rlim_t.
+    __typeof__ (r.rlim_cur) limit
+      = (__typeof__ (r.rlim_cur))(__size * 1048576);
 
     // Heap size, seems to be common.
 #if _GLIBCPP_HAVE_MEMLIMIT_DATA