From 73ad2a6c8fa5cba5badb5ef53252ebfd75c6a0f8 Mon Sep 17 00:00:00 2001
From: Julien Malik <julien.malik@c-s.fr>
Date: Wed, 9 Nov 2011 15:29:19 +0100
Subject: [PATCH] BUG: do not throw inside a C callback

---
 Code/IO/otbJPEG2000ImageIO.cxx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Code/IO/otbJPEG2000ImageIO.cxx b/Code/IO/otbJPEG2000ImageIO.cxx
index df102622da..e9c4a4c9a5 100644
--- a/Code/IO/otbJPEG2000ImageIO.cxx
+++ b/Code/IO/otbJPEG2000ImageIO.cxx
@@ -35,22 +35,25 @@ extern "C"
 */
 void error_callback(const char *msg, void *client_data)
 {
+  (void) msg;
   (void) client_data;
-  itkGenericExceptionMacro(<< "OpenJPEG error: " << msg);
+  otbMsgDevMacro(<< "OpenJPEG error: " << msg);
 }
 /**
    sample warning debug callback expecting no client object
 */
 void warning_callback(const char *msg, void *client_data)
 {
+  (void) msg;
   (void) client_data;
-  otbGenericMsgDebugMacro(<< "OpenJPEG warning: " << msg);
+  otbMsgDevMacro(<< "OpenJPEG warning: " << msg);
 }
 /**
    sample debug callback expecting no client object
 */
 void info_callback(const char *msg, void *client_data)
 {
+  (void) msg;
   (void) client_data;
   otbMsgDevMacro(<< "OpenJPEG info: " << msg);
 }
-- 
GitLab