]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Bugfixes: Include <unistd.h> where this is necessary for kfreebsd
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 7 Oct 2012 22:40:12 +0000 (22:40 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 7 Oct 2012 22:40:12 +0000 (22:40 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26990 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/logstream.cc
deal.II/source/base/thread_management.cc

index 8bd01ce9e3bb6c9de8aed8c0b1a9f56d5d83ac93..d21815441a175c42e4481798987709a41e1ca06f 100644 (file)
 #include <deal.II/base/memory_consumption.h>
 #include <deal.II/base/thread_management.h>
 
-#if defined(HAVE_SYS_RESOURCE_H)
+#ifdef HAVE_SYS_RESOURCE_H
 #  include <sys/resource.h>
 #endif
 
+#ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+#endif
+
 #include <iostream>
 #include <iomanip>
 #include <fstream>
@@ -49,7 +53,7 @@ LogStream::LogStream()
 {
   prefixes.push("DEAL:");
   std_out->setf(std::ios::showpoint | std::ios::left);
-#ifdef HAVE_TIMES
+#if defined(HAVE_TIMES) && defined(HAVE_UNISTD_H)
   reference_time_val = 1./sysconf(_SC_CLK_TCK) * times(&reference_tms);
 #endif
 }
@@ -357,7 +361,7 @@ LogStream::log_thread_id (const bool flag)
 void
 LogStream::print_line_head()
 {
-#if defined(HAVE_SYS_RESOURCE_H)
+#ifdef HAVE_SYS_RESOURCE_H
   rusage usage;
   double utime = 0.;
   if (print_utime)
@@ -450,7 +454,7 @@ void
 LogStream::timestamp ()
 {
   struct tms current_tms;
-#ifdef HAVE_TIMES
+#if defined(HAVE_TIMES) && defined(HAVE_UNISTD_H)
   const clock_t tick = sysconf(_SC_CLK_TCK);
   const double time = 1./tick * times(&current_tms);
 #else
index 6cb604912ce5d9822f347ae0fe5d7d930172e1e4..fed96e0a6c6f014128f4985bbe186e46fd2da0c8 100644 (file)
 #include <iostream>
 #include <list>
 
+#ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+#endif
+
 
 DEAL_II_NAMESPACE_OPEN
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.