Selaa lähdekoodia

Some warning and error fixes

Ivo Wolf 14 vuotta sitten
vanhempi
commit
5f75a87196

+ 7 - 0
CMakeLists.txt

@@ -274,6 +274,13 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
   SET(CTK_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wold-style-cast -Wstrict-null-sentinel -Wsign-promo ${CTK_CXX_FLAGS}")
   SET(CTK_CXX_FLAGS "${cflags} -Woverloaded-virtual -Wold-style-cast -Wstrict-null-sentinel -Wsign-promo ${CTK_CXX_FLAGS}")
 ENDIF()
 ENDIF()
 
 
+IF(MSVC)
+  SET(msvc_suppressed_warnings
+    "/wd4290" # C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
+  )
+  SET(CTK_CXX_FLAGS "${CTK_CXX_FLAGS} ${msvc_suppressed_warnings}")
+ENDIF()
+
 #-----------------------------------------------------------------------------
 #-----------------------------------------------------------------------------
 # QT
 # QT
 #
 #

+ 7 - 0
Libs/PluginFramework/ctkServiceEvent.h

@@ -32,6 +32,13 @@
 
 
 class ctkServiceEventData;
 class ctkServiceEventData;
 
 
+#ifdef REGISTERED
+#error Try to reorder include files (this one first)\
+ or write #undef REGISTERED before including this header.\
+ Cause of this problem may be dcmimage.h, which indirectly\
+ includes windows.h.
+#endif
+
 /**
 /**
  * An event from the Plugin Framework describing a service lifecycle change.
  * An event from the Plugin Framework describing a service lifecycle change.
  * <p>
  * <p>

+ 7 - 0
Plugins/org.commontk.dah.core/ctkDicomAppHostingTypes.h

@@ -25,6 +25,13 @@
 #ifndef CTKDICOMAPPHOSTINGTYPES_H
 #ifndef CTKDICOMAPPHOSTINGTYPES_H
 #define CTKDICOMAPPHOSTINGTYPES_H
 #define CTKDICOMAPPHOSTINGTYPES_H
 
 
+#ifdef ERROR
+#error Try to reorder include files (this one first)\
+ or write #undef ERROR before including this header.\
+ Cause of this problem may be dcmimage.h, which indirectly\
+ includes windows.h.
+#endif
+
 /**
 /**
   * \brief Typedefs and classes defined in the interfaces of DICOM Supplement 118.
   * \brief Typedefs and classes defined in the interfaces of DICOM Supplement 118.
   *
   *

+ 3 - 5
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic.cpp

@@ -27,16 +27,14 @@
 #include <QApplication>
 #include <QApplication>
 #include <QLabel>
 #include <QLabel>
 
 
-// ctkDICOMCore includes
+// CTK includes
 #include "ctkDICOMImage.h"
 #include "ctkDICOMImage.h"
+#include "ctkExampleDicomAppLogic_p.h"
+#include "ctkExampleDicomAppPlugin_p.h"
 
 
 // DCMTK includes
 // DCMTK includes
 #include <dcmimage.h>
 #include <dcmimage.h>
 
 
-// CTK includes
-#include "ctkExampleDicomAppLogic_p.h"
-#include "ctkExampleDicomAppPlugin_p.h"
-
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
 ctkExampleDicomAppLogic::ctkExampleDicomAppLogic()
 ctkExampleDicomAppLogic::ctkExampleDicomAppLogic()
   : HostTracker(ctkExampleDicomAppPlugin::getPluginContext()), Button(0)
   : HostTracker(ctkExampleDicomAppPlugin::getPluginContext()), Button(0)