OSDN Git Service

* testsuite/testsuite_performance.h (__FreeBSD__): Add fake mallinfo.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / testsuite_performance.h
index b55ed91..625de57 100644 (file)
@@ -28,8 +28,8 @@
 // invalidate any other reasons why the executable file might be covered by
 // the GNU General Public License.
 
-#ifndef _GLIBCPP_PERFORMANCE_H
-#define _GLIBCPP_PERFORMANCE_H
+#ifndef _GLIBCXX_PERFORMANCE_H
+#define _GLIBCXX_PERFORMANCE_H
 
 #include <sys/times.h>
 #include <sys/resource.h>
 
 #ifdef __linux__
 #include <malloc.h>
+#elif defined (__FreeBSD__)
+extern "C"
+{
+  struct mallinfo { int uordblks; };
+  struct mallinfo mallinfo(void)
+    { struct mallinfo m = { (((size_t) sbrk (0) + 1023) / 1024) }; return m; }
+}
 #else
 extern "C"
 {
@@ -49,7 +56,7 @@ extern "C"
 }
 #endif
 
-namespace __gnu_cxx_test
+namespace __gnu_test
 {
   class time_counter
   {
@@ -190,7 +197,7 @@ namespace __gnu_cxx_test
     out << std::endl;
     out.close();
   }
-}; // namespace __gnu_cxx_test
+}; // namespace __gnu_test
 
-#endif // _GLIBCPP_PERFORMANCE_H
+#endif // _GLIBCXX_PERFORMANCE_H