]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid #warning using MSVC
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 22 Jul 2018 13:04:08 +0000 (15:04 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 22 Jul 2018 14:30:58 +0000 (16:30 +0200)
include/deal.II/base/config.h.in
include/deal.II/base/sacado_product_type.h
include/deal.II/dofs/function_map.h
include/deal.II/grid/tria_boundary.h
include/deal.II/grid/tria_boundary_lib.h
include/deal.II/lac/constraint_matrix.h
include/deal.II/lac/parallel_block_vector.h
include/deal.II/lac/parallel_vector.h
source/base/timer.cc

index 717ca8b89769c09d77ac2e252b590163be24dd3c..55b34ca6fdca60316a36d4d3de89da8f2881496d 100644 (file)
@@ -382,6 +382,15 @@ _Pragma("GCC diagnostic pop")
 
 #endif
 
+/***********************************************************************
+ * Define a portable preprocessor macro that generates custom warnings
+ * reporting the line and the file where the warning appears. Taken from:
+ * http://goodliffe.blogspot.com/2009/07/c-how-to-say-warning-to-visual-studio-c.html
+ */
+
+#define STRINGIZE_HELPER(x) #x
+#define STRINGIZE(x) STRINGIZE_HELPER(x)
+#define WARNING(desc) message(__FILE__ "(" STRINGIZE(__LINE__) ") : Warning: " #desc)
 
 /***********************************************************************
  * Final inclusions:
index 379d02a98339a2ac710b0eadf41e440d48b897ca..37cd154cee1ea3131d143a7939c7c9f9ff07a2b3 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef dealii_sacado_product_type_h_deprecated
 #define dealii_sacado_product_type_h_deprecated
-#warning This file is deprecated. Use <deal.II/differentiation/ad/sacado_product_types.h> instead.
+
+#include <deal.II/base/config.h>
+
+#pragma WARNING( \
+  "This file is deprecated. Use <deal.II/differentiation/ad/sacado_product_types.h> instead.")
 
 #include <deal.II/differentiation/ad/sacado_product_types.h>
 
index acc9b88154993127726ff4ff2c3bb89c24a1f273..a26736aaac3fc92240093238345aeede2fbd60c5 100644 (file)
@@ -20,6 +20,6 @@
 
 #include <deal.II/dofs/deprecated_function_map.h>
 
-#warning "This file is deprecated."
+#pragma WARNING("This file is deprecated.")
 
 #endif
index 461aef2f15fb6736068732a9cef844aa3ad1140e..86da9ecd77c0b742a6d170b213f128c4e042cb97 100644 (file)
@@ -18,6 +18,6 @@
 
 #include <deal.II/base/config.h>
 
-#warning This file is deprecated. Use the Manifold classes instead.
+#pragma WARNING("This file is deprecated. Use the Manifold classes instead.")
 
 #endif
index 3a227f4c9cd4c943b321bdbd344d9f302575ff7e..60d585e694f53e9d66316f424a17279d61a71f55 100644 (file)
@@ -18,6 +18,6 @@
 
 #include <deal.II/base/config.h>
 
-#warning This file is deprecated. Use the Manifold classes instead.
+#pragma WARNING("This file is deprecated.Use the Manifold classes instead.")
 
 #endif
index 6a8460de93fb5ead202519952e13488dad807ccb..d57abd5d9069ab42d99bc54098eddc422ebb3b1b 100644 (file)
@@ -17,7 +17,8 @@
 #ifndef dealii_constraint_matrix_h
 #define dealii_constraint_matrix_h
 
-#warning This file is deprecated. Use <deal.II/lac/affine_constraints.h> instead.
+#pragma WARNING( \
+  "This file is deprecated. Use <deal.II/lac/affine_constraints.h> instead.")
 
 #include <deal.II/lac/affine_constraints.h>
 
index 93fd5fb8d59509dabe483b2d23fc1a4d78ff0032..e5dbd0236c68d3dc665c87c12658446b1cb23749 100644 (file)
@@ -20,7 +20,8 @@
 
 #include <deal.II/lac/la_parallel_block_vector.h>
 
-#warning This file is deprecated. Use <deal.II/lac/la_block_vector.h> and LinearAlgebra::distributed::BlockVector instead.
+#pragma WARNING( \
+  "This file is deprecated. Use <deal.II/lac/la_block_vector.h> and LinearAlgebra::distributed::BlockVector instead.")
 
 #include <cstring>
 #include <iomanip>
index 016778398db4f878b54d1a20bbb9ae2940cf75d3..5acba3abf558c827e5e625d0ada8afd2557a1acc 100644 (file)
@@ -20,7 +20,8 @@
 
 #include <deal.II/lac/la_parallel_vector.h>
 
-#warning This file is deprecated. Use <deal.II/lac/la_parallel_vector.h> and LinearAlgebra::distributed::Vector instead.
+#pragma WARNING( \
+  "This file is deprecated. Use <deal.II/lac/la_parallel_vector.h> and LinearAlgebra::distributed::Vector instead.")
 
 #include <cstring>
 #include <iomanip>
index 3de8a76218655a76e76406cd5b23948d7aebf05b..3bea9c94ca50f6520276a17890e95a6a58d9a2e0 100644 (file)
@@ -127,7 +127,7 @@ CPUClock::now() noexcept
   getrusage(RUSAGE_SELF, &usage);
   system_cpu_duration = usage.ru_utime.tv_sec + 1.e-6 * usage.ru_utime.tv_usec;
 #else
-#  warning "Unsupported platform. Porting not finished."
+#  pragma WARNING("Unsupported platform. Porting not finished.")
 #endif
   return time_point(
     internal::TimerImplementation::from_seconds<duration>(system_cpu_duration));

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.