]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Renamed function. Added boost header.
authorLuca Heltai <luca.heltai@sissa.it>
Mon, 2 May 2022 10:30:06 +0000 (13:30 +0300)
committerLuca Heltai <luca.heltai@sissa.it>
Mon, 2 May 2022 10:33:22 +0000 (13:33 +0300)
bundled/boost-1.70.0/include/boost/thread/detail/thread_safety.hpp [new file with mode: 0644]
cmake/modules/FindCGAL.cmake
include/deal.II/cgal/surface_mesh.h
source/cgal/surface_mesh.cc
source/cgal/surface_mesh.inst.in
tests/cgal/cgal_surface_mesh_01.cc

diff --git a/bundled/boost-1.70.0/include/boost/thread/detail/thread_safety.hpp b/bundled/boost-1.70.0/include/boost/thread/detail/thread_safety.hpp
new file mode 100644 (file)
index 0000000..4aa29a8
--- /dev/null
@@ -0,0 +1,160 @@
+#ifndef BOOST_THREAD_DETAIL_THREAD_SAFETY_HPP
+#define BOOST_THREAD_DETAIL_THREAD_SAFETY_HPP
+
+#if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
+//
+// This is horrible, but it seems to be the only we can shut up the
+// "anonymous variadic macros were introduced in C99 [-Wvariadic-macros]"
+// warning that get spewed out otherwise in non-C++11 mode.
+//
+#pragma GCC system_header
+#endif
+
+// See https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
+
+// Un-comment to enable Thread Safety Analysis
+//#define BOOST_THREAD_ENABLE_THREAD_SAFETY_ANALYSIS
+
+// Enable thread safety attributes only with clang.
+// The attributes can be safely erased when compiling with other compilers.
+#if defined (BOOST_THREAD_ENABLE_THREAD_SAFETY_ANALYSIS) && defined(__clang__) && (!defined(SWIG))
+#define BOOST_THREAD_ANNOTATION_ATTRIBUTE__(x)   __attribute__((x))
+#else
+#define BOOST_THREAD_ANNOTATION_ATTRIBUTE__(x)   // no-op
+#endif
+
+#define BOOST_THREAD_CAPABILITY(x) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
+
+#define BOOST_THREAD_SCOPED_CAPABILITY \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
+
+#define BOOST_THREAD_GUARDED_BY(x) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
+
+#define BOOST_THREAD_PT_GUARDED_BY(x) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
+
+#define BOOST_THREAD_ACQUIRED_BEFORE(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__))
+
+#define BOOST_THREAD_ACQUIRED_AFTER(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__))
+
+#define BOOST_THREAD_REQUIRES(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(__VA_ARGS__))
+
+#define BOOST_THREAD_REQUIRES_SHARED(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(__VA_ARGS__))
+
+#define BOOST_THREAD_ACQUIRE(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(__VA_ARGS__))
+
+#define BOOST_THREAD_ACQUIRE_SHARED(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(__VA_ARGS__))
+
+#define BOOST_THREAD_RELEASE(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(release_capability(__VA_ARGS__))
+
+#define BOOST_THREAD_RELEASE_SHARED(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(__VA_ARGS__))
+
+#define BOOST_THREAD_TRY_ACQUIRE(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(__VA_ARGS__))
+
+#define BOOST_THREAD_TRY_ACQUIRE_SHARED(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_shared_capability(__VA_ARGS__))
+
+#define BOOST_THREAD_EXCLUDES(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__))
+
+#define BOOST_THREAD_ASSERT_CAPABILITY(x) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x))
+
+#define BOOST_THREAD_ASSERT_SHARED_CAPABILITY(x) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x))
+
+#define BOOST_THREAD_RETURN_CAPABILITY(x) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
+
+#define BOOST_THREAD_NO_THREAD_SAFETY_ANALYSIS \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
+
+#if defined(__clang__) && (!defined(SWIG)) && defined(__FreeBSD__)
+#if __has_attribute(no_thread_safety_analysis)
+#define BOOST_THREAD_DISABLE_THREAD_SAFETY_ANALYSIS __attribute__((no_thread_safety_analysis))
+#else
+#define BOOST_THREAD_DISABLE_THREAD_SAFETY_ANALYSIS
+#endif
+#else
+#define BOOST_THREAD_DISABLE_THREAD_SAFETY_ANALYSIS
+#endif
+
+#ifdef USE_LOCK_STYLE_THREAD_SAFETY_ATTRIBUTES
+// The original version of thread safety analysis the following attribute
+// definitions.  These use a lock-based terminology.  They are still in use
+// by existing thread safety code, and will continue to be supported.
+
+// Deprecated.
+#define BOOST_THREAD_PT_GUARDED_VAR \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_var)
+
+// Deprecated.
+#define BOOST_THREAD_GUARDED_VAR \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(guarded_var)
+
+// Replaced by REQUIRES
+#define BOOST_THREAD_EXCLUSIVE_LOCKS_REQUIRED(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__))
+
+// Replaced by REQUIRES_SHARED
+#define BOOST_THREAD_SHARED_LOCKS_REQUIRED(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(shared_locks_required(__VA_ARGS__))
+
+// Replaced by CAPABILITY
+#define BOOST_THREAD_LOCKABLE \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(lockable)
+
+// Replaced by SCOPED_CAPABILITY
+#define BOOST_THREAD_SCOPED_LOCKABLE \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
+
+// Replaced by ACQUIRE
+#define BOOST_THREAD_EXCLUSIVE_LOCK_FUNCTION(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_lock_function(__VA_ARGS__))
+
+// Replaced by ACQUIRE_SHARED
+#define BOOST_THREAD_SHARED_LOCK_FUNCTION(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(shared_lock_function(__VA_ARGS__))
+
+// Replaced by RELEASE and RELEASE_SHARED
+#define BOOST_THREAD_UNLOCK_FUNCTION(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(unlock_function(__VA_ARGS__))
+
+// Replaced by TRY_ACQUIRE
+#define BOOST_THREAD_EXCLUSIVE_TRYLOCK_FUNCTION(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__))
+
+// Replaced by TRY_ACQUIRE_SHARED
+#define BOOST_THREAD_SHARED_TRYLOCK_FUNCTION(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(shared_trylock_function(__VA_ARGS__))
+
+// Replaced by ASSERT_CAPABILITY
+#define BOOST_THREAD_ASSERT_EXCLUSIVE_LOCK(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(assert_exclusive_lock(__VA_ARGS__))
+
+// Replaced by ASSERT_SHARED_CAPABILITY
+#define BOOST_THREAD_ASSERT_SHARED_LOCK(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_lock(__VA_ARGS__))
+
+// Replaced by EXCLUDE_CAPABILITY.
+#define BOOST_THREAD_LOCKS_EXCLUDED(...) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__))
+
+// Replaced by RETURN_CAPABILITY
+#define BOOST_THREAD_LOCK_RETURNED(x) \
+  BOOST_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
+
+#endif  // USE_LOCK_STYLE_THREAD_SAFETY_ATTRIBUTES
+
+#endif  // BOOST_THREAD_DETAIL_THREAD_SAFETY_HPP
index 06c380d74ffac4911ea23469a198da6661184167..abc1dc244af205b703703fc7ce80c2a09312c07e 100644 (file)
@@ -36,7 +36,7 @@ IF(DEAL_II_HAVE_CXX17)
 ELSE(DEAL_II_HAVE_CXX17)
   SET(CGAL_FOUND FALSE)
   SET(CGAL_INCLUDE_DIRS "-NOTFOUND")
-  MESSAGE(WARNING "CGAL wrappers require C++17. Disabling CGAL Support.")
+  MESSAGE(STATUS "CGAL wrappers require C++17. Disabling CGAL Support.")
 ENDIF(DEAL_II_HAVE_CXX17)
 
 DEAL_II_PACKAGE_HANDLE(CGAL
index 9e2b9e88ddaef21900ec74cf859c606a1b4198ff..e10fc76df76f7b69da7404081dba0c1b1ef390dc 100644 (file)
@@ -62,7 +62,7 @@ namespace CGALWrappers
    */
   template <typename CGALPointType, int dim, int spacedim>
   void
-  convert_to_cgal_surface_mesh(
+  dealii_cell_to_cgal_surface_mesh(
     const typename dealii::Triangulation<dim, spacedim>::cell_iterator &cell,
     const dealii::Mapping<dim, spacedim> &                              mapping,
     CGAL::Surface_mesh<CGALPointType> &                                 mesh);
index 2df5775b6b699ee9500d8bb42d2c0e2a92ef704f..8d4fcf49f7261bcdaeb08c91fa404062029b02d3 100644 (file)
@@ -74,7 +74,7 @@ namespace CGALWrappers
 {
   template <typename CGALPointType, int dim, int spacedim>
   void
-  convert_to_cgal_surface_mesh(
+  dealii_cell_to_cgal_surface_mesh(
     const typename Triangulation<dim, spacedim>::cell_iterator &cell,
     const Mapping<dim, spacedim> &                              mapping,
     CGAL::Surface_mesh<CGALPointType> &                         mesh)
index 3fe79dc6d4c95e889f2307ce378762d358a967ac..985bd35eb95e7d9a4218bdd77157f70f848ecb84 100644 (file)
@@ -19,7 +19,9 @@ for (dim : DIMENSIONS; spacedim : SPACE_DIMENSIONS; cgal_kernel : CGAL_KERNELS)
   {
 #if dim <= spacedim
     template void
-    convert_to_cgal_surface_mesh<typename cgal_kernel::Point_3, dim, spacedim>(
+    dealii_cell_to_cgal_surface_mesh<typename cgal_kernel::Point_3,
+                                     dim,
+                                     spacedim>(
       const typename Triangulation<dim, spacedim>::cell_iterator &cell,
       const Mapping<dim, spacedim> &                              mapping,
       CGAL::Surface_mesh<typename cgal_kernel::Point_3> &         mesh);
index 7254d7346e2903663cb806df491a24808f13f3f7..009f704ebe1890ab4ee766492bc4465684b120de 100644 (file)
@@ -54,7 +54,7 @@ test()
       GridGenerator::reference_cell(tria, r_cell);
 
       const auto cell = tria.begin_active();
-      convert_to_cgal_surface_mesh(cell, *mapping, mesh);
+      dealii_cell_to_cgal_surface_mesh(cell, *mapping, mesh);
 
       Assert(mesh.is_valid(), dealii::ExcMessage("The CGAL mesh is not valid"));
       deallog << "deal vertices: " << cell->n_vertices() << ", cgal vertices "

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.