fixed warning on windows
authorilya-lavrenov <ilya.lavrenov@itseez.com>
Wed, 4 Sep 2013 14:32:05 +0000 (18:32 +0400)
committerAlexander Alekhin <alexander.alekhin@itseez.com>
Wed, 9 Oct 2013 13:49:10 +0000 (17:49 +0400)
samples/c/adaptiveskindetector.cpp
samples/c/blobtrack_sample.cpp
samples/cpp/OpenEXRimages_HDR_Retina_toneMapping_video.cpp
samples/cpp/hybridtrackingsample.cpp
samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp

index a21f13e..37856bd 100644 (file)
@@ -34,7 +34,6 @@
 //
 //M*/
 
-
 #include <iostream>
 #include <cstdio>
 #include <cstring>
 #include "opencv2/contrib/contrib.hpp"
 #include "opencv2/highgui/highgui.hpp"
 
+#ifndef _CRT_SECURE_NO_WARNINGS
+# define _CRT_SECURE_NO_WARNINGS
+#endif
+
 static void help(char **argv)
 {
     std::cout << "\nThis program demonstrates the contributed flesh detector CvAdaptiveSkinDetector which can be found in contrib.cpp\n"
index e4f766c..a2f3727 100644 (file)
@@ -8,11 +8,13 @@
 
 /* Select appropriate case insensitive string comparison function: */
 #if defined WIN32 || defined _MSC_VER
-  #define MY_STRNICMP strnicmp
-  #define MY_STRICMP stricmp
+# define MY_STRNICMP _strnicmp
+# define MY_STRICMP _stricmp
+# define MY_STRDUP _strdup
 #else
-  #define MY_STRNICMP strncasecmp
-  #define MY_STRICMP strcasecmp
+# define MY_STRNICMP strncasecmp
+# define MY_STRICMP strcasecmp
+# define MY_STRDUP strdup
 #endif
 
 /* List of foreground (FG) DETECTION modules: */
@@ -239,7 +241,7 @@ static int RunBlobTrackingAuto( CvCapture* pCap, CvBlobTrackerAuto* pTracker,cha
 
                     if(pS)
                     {
-                        char* pStr = strdup(pS);
+                        char* pStr = MY_STRDUP(pS);
                         char* pStrFree = pStr;
 
                         while (pStr && strlen(pStr) > 0)
index a3a607f..fc3ac83 100644 (file)
 
 #include "opencv2/opencv.hpp"
 
+#ifndef _CRT_SECURE_NO_WARNINGS
+# define _CRT_SECURE_NO_WARNINGS
+#endif
+
 static void help(std::string errorMessage)
 {
     std::cout<<"Program init error : "<<errorMessage<<std::endl;
index 8c925ac..826ae29 100644 (file)
  *
  */
 
-//#include <cv.h>
-//#include <ml.h>
-//#include <cvaux.h>
-//#include <highgui.h>
 #include <stdio.h>
 #include <time.h>
 #include <iostream>
 #include "opencv2/highgui/highgui.hpp"
 #include "opencv2/contrib/hybridtracker.hpp"
 
+#ifndef _CRT_SECURE_NO_WARNINGS
+# define _CRT_SECURE_NO_WARNINGS
+#endif
+
 using namespace cv;
 using namespace std;
 
index aa4a036..5cc15b3 100644 (file)
@@ -8,6 +8,10 @@
 #include <opencv2/calib3d/calib3d.hpp>
 #include <opencv2/highgui/highgui.hpp>
 
+#ifndef _CRT_SECURE_NO_WARNINGS
+# define _CRT_SECURE_NO_WARNINGS
+#endif
+
 using namespace cv;
 using namespace std;