]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Quest for platform independence: [2] fixup thread_management.cc
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 7 Oct 2012 20:18:31 +0000 (20:18 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 7 Oct 2012 20:18:31 +0000 (20:18 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@26983 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/thread_management.cc

index 09d1c11292f801bed58b23423138220251273691..6cb604912ce5d9822f347ae0fe5d7d930172e1e4 100644 (file)
 
 
 #include <deal.II/base/thread_management.h>
-#include <iostream>
-#include <cstdlib>
-
-#ifdef DEAL_II_USE_MT_POSIX
-#  include <list>
-#endif
-
-#ifndef DEAL_II_USE_DIRECT_ERRNO_H
-#  include <errno.h>
-#else
-#  include </usr/include/errno.h>
-#endif
-#ifndef DEAL_II_MSVC
-#  include <sys/errno.h>
-#endif
 
-#ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-#endif
-
-#ifdef HAVE_SYS_SYSCALL_H
-#  include <sys/syscall.h>
-#endif
+#include <cerrno>
+#include <cstdlib>
+#include <iostream>
+#include <list>
 
 
 DEAL_II_NAMESPACE_OPEN
@@ -150,15 +132,10 @@ namespace Threads
   {
 #ifdef HAVE_GETPID
     const pid_t this_id = getpid();
-#elif defined(SYS_gettid)
-    const int this_id = syscall(SYS_gettid);
 #else
-#  ifdef DEAL_II_MSVC
     const unsigned int this_id = 0;
-#  else
-    const pid_t this_id = 0;
-#  endif
 #endif
+
     return static_cast<unsigned int>(this_id);
   }
 

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.