]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Provide the boost thread implementation only if the C++ compiler doesn't.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 14 Jan 2009 14:37:46 +0000 (14:37 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 14 Jan 2009 14:37:46 +0000 (14:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@18221 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/boost_threads.cc

index 6632f20cae6d1933601773ceeeadffb2ddba3419..f23e72061bc03defcfd5d6592a2b5f7e9e961e0e 100644 (file)
@@ -1,5 +1,5 @@
 //---------------------------------------------------------------------------
-//    $Id: thread_management.cc 18205 2009-01-13 13:53:08Z bangerth $
+//    $Id$
 //    Version: $Name$
 //
 //    Copyright (C) 2009 by the deal.II authors
 //
 //---------------------------------------------------------------------------
 
+#include <base/config.h>
 
-// include all the files that form BOOST's thread implementation so that we
-// don't have to build BOOST itself only to get at this small part of it. it
-// also ensures that we use the correct compiler and flags
+#ifndef DEAL_II_CAN_USE_CXX0X
 
-#define BOOST_THREAD_POSIX
-#define BOOST_THREAD_BUILD_LIB 1
+// of the C++ compiler doesn't completely support the C++0x standard (and
+// consequently we can't use std::thread, std::mutex, etc), then include all
+// the files that form BOOST's thread implementation so that we don't have to
+// build BOOST itself only to get at this small part of it. it also ensures
+// that we use the correct compiler and flags
+#  define BOOST_THREAD_POSIX
+#  define BOOST_THREAD_BUILD_LIB 1
 
-#include <../libs/thread/src/pthread/once.cpp>
-#include <../libs/thread/src/pthread/exceptions.cpp>
-#include <../libs/thread/src/pthread/thread.cpp>
+#  ifdef DEAL_II_USE_MT_POSIX
+#    include <../libs/thread/src/pthread/once.cpp>
+#    include <../libs/thread/src/pthread/exceptions.cpp>
+#    include <../libs/thread/src/pthread/thread.cpp>
+#  else
+#    include <../libs/thread/src/win32/once.cpp>
+#    include <../libs/thread/src/win32/exceptions.cpp>
+#    include <../libs/thread/src/win32/thread.cpp>
+#  endif
+
+#endif

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.