From 1b933e335b4e65550e7df211d7f2e9fe5cc13c96 Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@orfeo-toolbox.org>
Date: Thu, 6 Dec 2012 17:12:19 +0100
Subject: [PATCH] DEV: Adding a new macro for warnings outside of itk::Object

---
 Code/Common/otbMacro.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Code/Common/otbMacro.h b/Code/Common/otbMacro.h
index cd45f33f75..83a56b1b95 100644
--- a/Code/Common/otbMacro.h
+++ b/Code/Common/otbMacro.h
@@ -108,6 +108,16 @@ namespace otb
       } \
     }
 
+#define otbGenericWarningMacro(x) \
+    { \
+    if (itk::Object::GetGlobalWarningDisplay()) \
+      { \
+      std::ostringstream itkmsg; \
+      itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << ": " x <<"\n";\
+      itk::OutputWindowDisplayWarningText(itkmsg.str().c_str()); \
+      } \
+    }
+
 /** This macro is used to control condition. It use ONLY by the OTB developers
   *
   */
-- 
GitLab