- Added a Warning macro compatible with GCC & MSVC to cv.h
authorJose Luis Blanco <no@email>
Thu, 27 May 2010 09:55:46 +0000 (09:55 +0000)
committerJose Luis Blanco <no@email>
Thu, 27 May 2010 09:55:46 +0000 (09:55 +0000)
- Fixed extra text after #endif

include/opencv/cv.h

index f44129d..80f18fc 100644 (file)
 #ifndef __OPENCV_OLD_CV_H__
 #define __OPENCV_OLD_CV_H__
 
-#if defined(__GNUC__)
-#warning "This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module"
+#if defined(_MSC_VER)
+       #define CV_DO_PRAGMA(x) __pragma(x)
+       #define __CVSTR2__(x) #x
+       #define __CVSTR1__(x) __CVSTR2__(x)
+       #define __CVMSVCLOC__ __FILE__ "("__CVSTR1__(__LINE__)") : "
+       #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (__CVMSVCLOC__ _msg))
+#elif defined(__GNUC__)
+       #define CV_DO_PRAGMA(x) _Pragma (#x)
+       #define CV_MSG_PRAGMA(_msg) CV_DO_PRAGMA(message (_msg))
+#else
+       #define CV_DO_PRAGMA(x)
+       #define CV_MSG_PRAGMA(_msg) 
 #endif
+#define CV_WARNING(x) CV_MSG_PRAGMA("Warning: " #x)
+
+CV_WARNING("This is a deprecated opencv header provided for compatibility. Please include a header from a corresponding opencv module")
 
 #include "opencv2/core/core_c.h"
 #include "opencv2/core/core.hpp"
@@ -64,4 +77,5 @@
 #include "opencv2/core/internal.hpp"
 #endif //__cplusplus
 
-#endif __OPENCV_OLD_CV_H_
+#endif // __OPENCV_OLD_CV_H_
+