opencv-2.4.10-cygwin-patch-20141008

Upload: quan-nguyen

Post on 05-Oct-2015

68 views

Category:

Documents


0 download

DESCRIPTION

patch for install opencv

TRANSCRIPT

diff -uNr opencv-2.4.10.orig/3rdparty/include/opencl/1.2/CL/cl.hpp opencv-2.4.10/3rdparty/include/opencl/1.2/CL/cl.hpp--- opencv-2.4.10.orig/3rdparty/include/opencl/1.2/CL/cl.hpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/3rdparty/include/opencl/1.2/CL/cl.hpp 2014-10-08 22:10:12.539531200 +0900@@ -144,7 +144,7 @@ #ifndef CL_HPP_ #define CL_HPP_ -#ifdef _WIN32+#if defined _WIN32 || defined __CYGWIN__ #include #include @@ -1022,7 +1022,7 @@ */ inline int compare_exchange(volatile int * dest, int exchange, int comparand) {-#ifdef _WIN32+#if defined _WIN32 || defined __CYGWIN__ return (int)(InterlockedCompareExchange( (volatile long*)dest, (long)exchange, @@ -2635,7 +2635,7 @@ } -#ifdef _WIN32+#if defined _WIN32 || defined __CYGWIN__ __declspec(selectany) volatile int Context::default_initialized_ = __DEFAULT_NOT_INITIALIZED; __declspec(selectany) Context Context::default_; __declspec(selectany) volatile cl_int Context::default_error_ = CL_SUCCESS;@@ -6093,7 +6093,7 @@ } }; -#ifdef _WIN32+#if defined _WIN32 || defined __CYGWIN__ __declspec(selectany) volatile int CommandQueue::default_initialized_ = __DEFAULT_NOT_INITIALIZED; __declspec(selectany) CommandQueue CommandQueue::default_; __declspec(selectany) volatile cl_int CommandQueue::default_error_ = CL_SUCCESS;@@ -12298,7 +12298,7 @@ } // namespace cl -#ifdef _WIN32+#if defined _WIN32 || defined __CYGWIN__ #pragma pop_macro("max") #endif // _WIN32 diff -uNr opencv-2.4.10.orig/3rdparty/include/opencl/1.2/CL/cl_dx9_media_sharing.h opencv-2.4.10/3rdparty/include/opencl/1.2/CL/cl_dx9_media_sharing.h--- opencv-2.4.10.orig/3rdparty/include/opencl/1.2/CL/cl_dx9_media_sharing.h2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/3rdparty/include/opencl/1.2/CL/cl_dx9_media_sharing.h 2014-10-08 22:10:12.546531100 +0900@@ -40,7 +40,7 @@ typedef cl_uint cl_dx9_media_adapter_type_khr; typedef cl_uint cl_dx9_media_adapter_set_khr; -#if defined(_WIN32)+#if defined _WIN32 || defined __CYGWIN__ #include typedef struct _cl_dx9_surface_info_khr {diff -uNr opencv-2.4.10.orig/3rdparty/include/opencl/1.2/CL/cl_platform.h opencv-2.4.10/3rdparty/include/opencl/1.2/CL/cl_platform.h--- opencv-2.4.10.orig/3rdparty/include/opencl/1.2/CL/cl_platform.h 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/3rdparty/include/opencl/1.2/CL/cl_platform.h 2014-10-08 22:10:12.550534200 +0900@@ -35,7 +35,7 @@ extern "C" { #endif -#if defined(_WIN32)+#if defined _WIN32 || defined __CYGWIN__ #define CL_API_ENTRY #define CL_API_CALL __stdcall #define CL_CALLBACK __stdcall@@ -76,7 +76,7 @@ #define CL_API_SUFFIX__VERSION_1_2 #define CL_EXT_SUFFIX__VERSION_1_2 - #ifdef __GNUC__+ #if defined __GNUC__ #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED @@ -115,6 +115,28 @@ #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED #endif++ #ifdef __CYGWIN__+ #undef CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED + #undef CL_EXT_PREFIX__VERSION_1_0_DEPRECATED + #undef CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED+ #undef CL_EXT_PREFIX__VERSION_1_1_DEPRECATED + #ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS+ #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED + #else+ #define CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_0_DEPRECATED __declspec(deprecated) + #endif+ + #ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS+ #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED+ #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED + #else+ #define CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED + #define CL_EXT_PREFIX__VERSION_1_1_DEPRECATED __declspec(deprecated) + #endif+ #endif #endif #if (defined (_WIN32) && defined(_MSC_VER))@@ -349,7 +371,7 @@ #endif #if defined( __SSE__ )- #if defined( __MINGW64__ )+ #if defined( __MINGW64__ ) || (defined __CYGWIN__ && defined __x86_64) #include #else #include @@ -363,7 +385,7 @@ #endif #if defined( __SSE2__ )- #if defined( __MINGW64__ )+ #if defined( __MINGW64__ ) || (defined __CYGWIN__ && defined __x86_64) #include #else #include @@ -435,7 +457,7 @@ #endif #if defined( __AVX__ )- #if defined( __MINGW64__ )+ #if defined( __MINGW64__ ) || (defined __CYGWIN__ && defined __x86_64) #include #else #include diff -uNr opencv-2.4.10.orig/3rdparty/libjasper/CMakeLists.txt opencv-2.4.10/3rdparty/libjasper/CMakeLists.txt--- opencv-2.4.10.orig/3rdparty/libjasper/CMakeLists.txt 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/3rdparty/libjasper/CMakeLists.txt 2014-10-08 22:10:12.554536100 +0900@@ -28,7 +28,7 @@ ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005 -if(UNIX)+if(UNIX AND NOT CYGWIN) if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") endif()diff -uNr opencv-2.4.10.orig/3rdparty/libjpeg/CMakeLists.txt opencv-2.4.10/3rdparty/libjpeg/CMakeLists.txt--- opencv-2.4.10.orig/3rdparty/libjpeg/CMakeLists.txt 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/3rdparty/libjpeg/CMakeLists.txt 2014-10-08 22:10:12.557537000 +0900@@ -15,7 +15,7 @@ add_library(${JPEG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs}) -if(UNIX)+if(UNIX AND NOT CYGWIN) if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") endif()diff -uNr opencv-2.4.10.orig/3rdparty/libpng/CMakeLists.txt opencv-2.4.10/3rdparty/libpng/CMakeLists.txt--- opencv-2.4.10.orig/3rdparty/libpng/CMakeLists.txt 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/3rdparty/libpng/CMakeLists.txt 2014-10-08 22:10:12.561541700 +0900@@ -36,7 +36,7 @@ add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs}) target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARY}) -if(UNIX)+if(UNIX AND NOT CYGWIN) if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") endif()diff -uNr opencv-2.4.10.orig/3rdparty/libtiff/CMakeLists.txt opencv-2.4.10/3rdparty/libtiff/CMakeLists.txt--- opencv-2.4.10.orig/3rdparty/libtiff/CMakeLists.txt 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/3rdparty/libtiff/CMakeLists.txt 2014-10-08 22:10:12.565542700 +0900@@ -96,8 +96,10 @@ ocv_warnings_disable(CMAKE_C_FLAGS /wd4267 /wd4244 /wd4018) -if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")+if(UNIX AND NOT CYGWIN)+ if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")+ endif() endif() add_library(${TIFF_LIBRARY} STATIC ${lib_srcs})diff -uNr opencv-2.4.10.orig/3rdparty/openexr/CMakeLists.txt opencv-2.4.10/3rdparty/openexr/CMakeLists.txt--- opencv-2.4.10.orig/3rdparty/openexr/CMakeLists.txt 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/3rdparty/openexr/CMakeLists.txt 2014-10-08 22:10:12.569546600 +0900@@ -43,7 +43,7 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267) # vs2008 Win64 -if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))+if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) AND NOT CYGWIN) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif() diff -uNr opencv-2.4.10.orig/3rdparty/zlib/CMakeLists.txt opencv-2.4.10/3rdparty/zlib/CMakeLists.txt--- opencv-2.4.10.orig/3rdparty/zlib/CMakeLists.txt 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/3rdparty/zlib/CMakeLists.txt 2014-10-08 22:10:12.574548900 +0900@@ -76,7 +76,7 @@ add_library(${ZLIB_LIBRARY} STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) set_target_properties(${ZLIB_LIBRARY} PROPERTIES DEFINE_SYMBOL ZLIB_DLL) -if(UNIX)+if(UNIX AND NOT CYGWIN) if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") endif()diff -uNr opencv-2.4.10.orig/CMakeLists.txt opencv-2.4.10/CMakeLists.txt--- opencv-2.4.10.orig/CMakeLists.txt 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/CMakeLists.txt 2014-10-08 22:10:12.578551600 +0900@@ -133,7 +133,7 @@ OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprograms (BLAS) library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT IOS) ) OCV_OPTION(WITH_NVCUVID "Include NVidia Video Decoding library support" OFF IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS AND NOT APPLE) ) OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)-OCV_OPTION(WITH_VFW "Include Video for Windows support" ON IF WIN32 )+OCV_OPTION(WITH_VFW "Include Video for Windows support" ON IF (WIN32 OR CYGWIN) ) OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS)) OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_GSTREAMER_0_10 "Enable Gstreamer 0.10 support (instead of 1.x)" OFF )@@ -149,7 +149,7 @@ OCV_OPTION(WITH_PVAPI "Include Prosilica GigE support" ON IF (NOT ANDROID AND NOT IOS) ) OCV_OPTION(WITH_GIGEAPI "Include Smartek GigE support" ON IF (NOT ANDROID AND NOT IOS) ) OCV_OPTION(WITH_QT "Build with Qt Backend support" OFF IF (NOT ANDROID AND NOT IOS) )-OCV_OPTION(WITH_WIN32UI "Build with Win32 UI Backend support" ON IF WIN32 )+OCV_OPTION(WITH_WIN32UI "Build with Win32 UI Backend support" ON IF (WIN32 OR CYGWIN) ) OCV_OPTION(WITH_QUICKTIME "Use QuickTime for Video I/O insted of QTKit" OFF IF APPLE ) OCV_OPTION(WITH_TBB "Include Intel TBB support" OFF IF (NOT IOS) ) OCV_OPTION(WITH_OPENMP "Include OpenMP support" OFF)@@ -158,7 +158,7 @@ OCV_OPTION(WITH_UNICAP "Include Unicap support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) ) OCV_OPTION(WITH_V4L "Include Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) ) OCV_OPTION(WITH_LIBV4L "Use libv4l for Video 4 Linux support" ON IF (UNIX AND NOT ANDROID) )-OCV_OPTION(WITH_DSHOW "Build HighGUI with DirectShow support" ON IF (WIN32 AND NOT ARM) )+OCV_OPTION(WITH_DSHOW "Build HighGUI with DirectShow support" ON IF ((WIN32 AND NOT ARM) OR CYGWIN)) OCV_OPTION(WITH_MSMF "Build HighGUI with Media Foundation support" OFF IF WIN32 ) OCV_OPTION(WITH_XIMEA "Include XIMEA cameras support" OFF IF (NOT ANDROID) ) OCV_OPTION(WITH_XINE "Include Xine support (GPL)" OFF IF (UNIX AND NOT APPLE AND NOT ANDROID) )@@ -189,7 +189,7 @@ OCV_OPTION(BUILD_JASPER "Build libjasper from source" WIN32 OR ANDROID OR APPLE ) OCV_OPTION(BUILD_JPEG "Build libjpeg from source" WIN32 OR ANDROID OR APPLE ) OCV_OPTION(BUILD_PNG "Build libpng from source" WIN32 OR ANDROID OR APPLE )-OCV_OPTION(BUILD_OPENEXR "Build openexr from source" WIN32 OR ANDROID OR APPLE )+OCV_OPTION(BUILD_OPENEXR "Build openexr from source" WIN32 OR ANDROID OR APPLE OR CYGWIN ) OCV_OPTION(BUILD_TBB "Download and build TBB from source" ANDROID ) # OpenCV installation options@@ -343,6 +343,9 @@ # Postfix of DLLs: set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}") set(OPENCV_DEBUG_POSTFIX d)+elseif(CYGWIN)+ set(OPENCV_DLLVERSION "")+ set(OPENCV_DEBUG_POSTFIX d) else() # Postfix of so's: set(OPENCV_DLLVERSION "")diff -uNr opencv-2.4.10.orig/apps/traincascade/imagestorage.h opencv-2.4.10/apps/traincascade/imagestorage.h--- opencv-2.4.10.orig/apps/traincascade/imagestorage.h 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/apps/traincascade/imagestorage.h 2014-10-08 22:10:12.591561200 +0900@@ -1,6 +1,9 @@ #ifndef _OPENCV_IMAGESTORAGE_H_ #define _OPENCV_IMAGESTORAGE_H_ +#ifdef __CYGWIN__+#include +#endif // __CYGWIN__ #include "highgui.h" diff -uNr opencv-2.4.10.orig/cmake/OpenCVCompilerOptions.cmake opencv-2.4.10/cmake/OpenCVCompilerOptions.cmake--- opencv-2.4.10.orig/cmake/OpenCVCompilerOptions.cmake 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/cmake/OpenCVCompilerOptions.cmake 2014-10-08 22:10:12.595563900 +0900@@ -100,7 +100,7 @@ endif() # We need pthread's- if(UNIX AND NOT ANDROID AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX))+ if(UNIX AND NOT ANDROID AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX) AND NOT CYGWIN) add_extra_compiler_option(-pthread) endif() @@ -257,7 +257,9 @@ if(NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX AND NOT ANDROID) # Android does not need these settings because they are already set by toolchain file set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} stdc++)- set(OPENCV_EXTRA_FLAGS "-fPIC ${OPENCV_EXTRA_FLAGS}")+ if(NOT CYGWIN)+ set(OPENCV_EXTRA_FLAGS "-fPIC ${OPENCV_EXTRA_FLAGS}")+ endif() endif() # Add user supplied extra options (optimization, etc...)diff -uNr opencv-2.4.10.orig/cmake/OpenCVFindLibsGUI.cmake opencv-2.4.10/cmake/OpenCVFindLibsGUI.cmake--- opencv-2.4.10.orig/cmake/OpenCVFindLibsGUI.cmake 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/cmake/OpenCVFindLibsGUI.cmake 2014-10-08 22:10:12.598564900 +0900@@ -52,7 +52,16 @@ ocv_clear_vars(HAVE_OPENGL HAVE_QT_OPENGL) if(WITH_OPENGL) if(WITH_WIN32UI OR (HAVE_QT AND QT_QTOPENGL_FOUND) OR HAVE_GTKGLEXT)- find_package (OpenGL QUIET)+ if(CYGWIN)+ set(OPENGL_gl_LIBRARY opengl32)+ set(OPENGL_glu_LIBRARY glu32)+ set(WIN32 TRUE)+ include(FindOpenGL)+ unset(WIN32)+ endif()+ if(NOT OPENGL_FOUND)+ find_package (OpenGL QUIET)+ endif() if(OPENGL_FOUND) set(HAVE_OPENGL TRUE) list(APPEND OPENCV_LINKER_LIBS ${OPENGL_LIBRARIES})diff -uNr opencv-2.4.10.orig/cmake/OpenCVFindLibsVideo.cmake opencv-2.4.10/cmake/OpenCVFindLibsVideo.cmake--- opencv-2.4.10.orig/cmake/OpenCVFindLibsVideo.cmake 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/cmake/OpenCVFindLibsVideo.cmake 2014-10-08 23:44:04.377376300 +0900@@ -8,6 +8,18 @@ "${OpenCV_BINARY_DIR}" "${OpenCV_SOURCE_DIR}/cmake/checks/vfwtest.cpp" CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=vfw32")+ if(NOT HAVE_VFW)+ try_compile(HAVE_VFW+ "${OpenCV_BINARY_DIR}"+ "${OpenCV_SOURCE_DIR}/cmake/checks/vfwtest.cpp"+ CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=msvfw32")+ endif()+ if(NOT HAVE_VFW)+ try_compile(HAVE_VFW+ "${OpenCV_BINARY_DIR}"+ "${OpenCV_SOURCE_DIR}/cmake/checks/vfwtest.cpp"+ CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=avifil32")+ endif() endif(WITH_VFW) # --- GStreamer ---@@ -203,9 +215,30 @@ set(HAVE_FFMPEG TRUE) endif() + if(CYGWIN AND NOT HAVE_FFMPEG AND NOT "${CYGWIN_FFMPEG_BUILT_DIR}" STREQUAL "")+ if(EXISTS "${CYGWIN_FFMPEG_BUILT_DIR}/libavcodec/avcodec.h" AND EXISTS "${CYGWIN_FFMPEG_BUILT_DIR}/libavcodec/libavcodec.a"+ AND EXISTS "${CYGWIN_FFMPEG_BUILT_DIR}/libavformat/avformat.h" AND EXISTS "${CYGWIN_FFMPEG_BUILT_DIR}/libavformat/libavformat.a"+ AND EXISTS "${CYGWIN_FFMPEG_BUILT_DIR}/libavutil/avutil.h" AND EXISTS "${CYGWIN_FFMPEG_BUILT_DIR}/libavutil/libavutil.a"+ AND EXISTS "${CYGWIN_FFMPEG_BUILT_DIR}/libswscale/swscale.h" AND EXISTS "${CYGWIN_FFMPEG_BUILT_DIR}/libswscale/libswscale.a")+ set(HAVE_FFMPEG TRUE)+ set(HAVE_FFMPEG_CODEC TRUE)+ set(HAVE_FFMPEG_FORMAT TRUE)+ set(HAVE_FFMPEG_UTIL TRUE)+ set(HAVE_FFMPEG_SWSCALE TRUE)+ set(HAVE_GENTOO_FFMPEG TRUE)+ else()+ set(CYGWIN_FFMPEG_BUILT_DIR "")+ endif()+ endif()+ if(HAVE_FFMPEG) # Find the bzip2 library because it is required on some systems- FIND_LIBRARY(BZIP2_LIBRARIES NAMES bz2 bzip2)+ if(CYGWIN)+ include(FindBZip2)+ endif()+ if(NOT BZIP2_LIBRARIES)+ FIND_LIBRARY(BZIP2_LIBRARIES NAMES bz2 bzip2)+ endif() if(NOT BZIP2_LIBRARIES) # Do an other trial FIND_FILE(BZIP2_LIBRARIES NAMES libbz2.so.1 PATHS /lib)@@ -271,6 +304,26 @@ endif() endif(WIN32) +if(CYGWIN)+ list(APPEND HIGHGUI_LIBRARIES comctl32 gdi32 ole32 setupapi ws2_32 msvfw32 avifil32)+ if(NOT "${CYGWIN_FFMPEG_BUILT_DIR}" STREQUAL "")+ list(APPEND HIGHGUI_LIBRARIES "${CYGWIN_FFMPEG_BUILT_DIR}/libavcodec/libavcodec.a")+ list(APPEND HIGHGUI_LIBRARIES "${CYGWIN_FFMPEG_BUILT_DIR}/libavformat/libavformat.a")+ list(APPEND HIGHGUI_LIBRARIES "${CYGWIN_FFMPEG_BUILT_DIR}/libavutil/libavutil.a")+ list(APPEND HIGHGUI_LIBRARIES "${CYGWIN_FFMPEG_BUILT_DIR}/libswscale/libswscale.a")+ if(EXISTS "${CYGWIN_FFMPEG_BUILT_DIR}/libswresample/libswresample.a")+ list(APPEND HIGHGUI_LIBRARIES "${CYGWIN_FFMPEG_BUILT_DIR}/libswresample/libswresample.a")+ endif()+ if(EXISTS "/usr/lib/liblzma.dll.a")+ list(APPEND HIGHGUI_LIBRARIES lzma)+ endif()+ if(EXISTS "/usr/lib/libiconv.dll.a")+ list(APPEND HIGHGUI_LIBRARIES iconv)+ endif()+ endif()+ list(APPEND HIGHGUI_LIBRARIES strmiids /usr/lib/w32api/libuuid.a advapi32 oleaut32 user32 avicap32 winmm)+endif(CYGWIN)+ # --- Apple AV Foundation --- if(WITH_AVFOUNDATION) set(HAVE_AVFOUNDATION YES)diff -uNr opencv-2.4.10.orig/cmake/OpenCVGenPkgconfig.cmake opencv-2.4.10/cmake/OpenCVGenPkgconfig.cmake--- opencv-2.4.10.orig/cmake/OpenCVGenPkgconfig.cmake 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/cmake/OpenCVGenPkgconfig.cmake 2014-10-08 22:10:12.608571900 +0900@@ -39,6 +39,10 @@ foreach(CVLib ${OpenCV_LIB_COMPONENTS}) get_target_property(libpath ${CVLib} LOCATION_${CMAKE_BUILD_TYPE}) get_filename_component(libname "${libpath}" NAME)+ if(CYGWIN AND BUILD_SHARED_LIBS)+ string(REGEX REPLACE "^cygopencv" "libopencv" libname "${libname}")+ string(REGEX REPLACE "-${OPENCV_SOVERSION}.dll$" ".dll.a" libname "${libname}")+ endif() if(INSTALL_TO_MANGLED_PATHS) set(libname "${libname}.${OPENCV_VERSION}")diff -uNr opencv-2.4.10.orig/cmake/OpenCVPCHSupport.cmake opencv-2.4.10/cmake/OpenCVPCHSupport.cmake--- opencv-2.4.10.orig/cmake/OpenCVPCHSupport.cmake 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/cmake/OpenCVPCHSupport.cmake 2014-10-08 22:10:12.611572900 +0900@@ -44,7 +44,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX) GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)- IF(${_targetType} STREQUAL SHARED_LIBRARY AND NOT WIN32)+ IF(${_targetType} STREQUAL SHARED_LIBRARY AND NOT WIN32 AND NOT CYGWIN) LIST(APPEND ${_out_compile_flags} "-fPIC") ENDIF() diff -uNr opencv-2.4.10.orig/modules/core/include/opencv2/core/types_c.h opencv-2.4.10/modules/core/include/opencv2/core/types_c.h--- opencv-2.4.10.orig/modules/core/include/opencv2/core/types_c.h 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/core/include/opencv2/core/types_c.h 2014-10-08 22:10:12.615577600 +0900@@ -108,7 +108,7 @@ #endif // SKIP_INCLUDES -#if defined WIN32 || defined _WIN32+#if defined WIN32 || defined _WIN32 || defined __CYGWIN__ # define CV_CDECL __cdecl # define CV_STDCALL __stdcall #else@@ -144,7 +144,7 @@ # endif #endif /* CV_INLINE */ -#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS+#if (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS # define CV_EXPORTS __declspec(dllexport) #else # define CV_EXPORTSdiff -uNr opencv-2.4.10.orig/modules/core/src/gl_core_3_1.cpp opencv-2.4.10/modules/core/src/gl_core_3_1.cpp--- opencv-2.4.10.orig/modules/core/src/gl_core_3_1.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/core/src/gl_core_3_1.cpp 2014-10-08 22:10:12.619578600 +0900@@ -94,7 +94,7 @@ } #endif // __sgi || __sun - #if defined(_WIN32)+ #if defined(_WIN32) || defined(__CYGWIN__) #ifdef _MSC_VER #pragma warning(disable: 4055) #pragma warning(disable: 4054)@@ -124,7 +124,7 @@ } #endif // _WIN32 - #if defined(_WIN32)+ #if defined(_WIN32) || defined(__CYGWIN__) #define CV_GL_GET_PROC_ADDRESS(name) WinGetProcAddress(name) #elif defined(__APPLE__) #define CV_GL_GET_PROC_ADDRESS(name) AppleGLGetProcAddress(name)diff -uNr opencv-2.4.10.orig/modules/core/src/gl_core_3_1.hpp opencv-2.4.10/modules/core/src/gl_core_3_1.hpp--- opencv-2.4.10.orig/modules/core/src/gl_core_3_1.hpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/core/src/gl_core_3_1.hpp 2014-10-08 22:10:12.623581300 +0900@@ -60,7 +60,7 @@ #define __gl_ATI_h_ #ifndef APIENTRY- #if defined(__MINGW32__)+ #if defined(__MINGW32__) || defined(__CYGWIN__) #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 #endif@@ -83,7 +83,7 @@ #ifndef CODEGEN_FUNCPTR #define CODEGEN_REMOVE_FUNCPTR- #if defined(_WIN32)+ #if defined(_WIN32) || defined(__CYGWIN__) #define CODEGEN_FUNCPTR APIENTRY #else #define CODEGEN_FUNCPTR@@ -175,6 +175,8 @@ typedef __int32 int32_t; typedef __int64 int64_t; typedef unsigned __int64 uint64_t;+ #elif defined(__CYGWIN__)+ #include #else // Fallback if nothing above works #include diff -uNr opencv-2.4.10.orig/modules/core/src/precomp.hpp opencv-2.4.10/modules/core/src/precomp.hpp--- opencv-2.4.10.orig/modules/core/src/precomp.hpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/core/src/precomp.hpp 2014-10-08 22:10:12.626583100 +0900@@ -82,7 +82,7 @@ #define CV_MAX_8U(a,b) ((a) + CV_FAST_CAST_8U((b) - (a))) -#if defined WIN32 || defined _WIN32+#if defined WIN32 || defined _WIN32 || defined __CYGWIN__ void deleteThreadAllocData(); void deleteThreadRNGData(); #endifdiff -uNr opencv-2.4.10.orig/modules/core/src/rand.cpp opencv-2.4.10/modules/core/src/rand.cpp--- opencv-2.4.10.orig/modules/core/src/rand.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/core/src/rand.cpp 2014-10-08 22:10:12.629585300 +0900@@ -48,7 +48,7 @@ #include "precomp.hpp" -#if defined WIN32 || defined WINCE+#if defined WIN32 || defined WINCE || defined __CYGWIN__ #include #undef small #undef min@@ -725,7 +725,7 @@ } } -#ifdef WIN32+#if defined WIN32 || defined __CYGWIN__ #ifdef HAVE_WINRTdiff -uNr opencv-2.4.10.orig/modules/core/src/system.cpp opencv-2.4.10/modules/core/src/system.cpp--- opencv-2.4.10.orig/modules/core/src/system.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/core/src/system.cpp 2014-10-08 22:10:12.633590000 +0900@@ -157,13 +157,13 @@ #include -#if defined __linux__ || defined __APPLE__ || defined __EMSCRIPTEN__+#if defined __linux__ || defined __APPLE__ || defined __EMSCRIPTEN__ || defined __CYGWIN__ #include #include #include #if defined ANDROID #include -#else+#elif !defined __CYGWIN__ #include #endif #endif@@ -335,7 +335,7 @@ LARGE_INTEGER counter; QueryPerformanceCounter( &counter ); return (int64)counter.QuadPart;-#elif defined __linux || defined __linux__+#elif defined __linux || defined __linux__ || defined __CYGWIN__ struct timespec tp; clock_gettime(CLOCK_MONOTONIC, &tp); return (int64)tp.tv_sec*1000000000 + tp.tv_nsec;@@ -355,7 +355,7 @@ LARGE_INTEGER freq; QueryPerformanceFrequency(&freq); return (double)freq.QuadPart;-#elif defined __linux || defined __linux__+#elif defined __linux || defined __linux__ || defined __CYGWIN__ return 1e9; #elif defined __MACH__ && defined __APPLE__ static double freq = 0;diff -uNr opencv-2.4.10.orig/modules/flann/include/opencv2/flann/defines.h opencv-2.4.10/modules/flann/include/opencv2/flann/defines.h--- opencv-2.4.10.orig/modules/flann/include/opencv2/flann/defines.h 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/flann/include/opencv2/flann/defines.h 2014-10-08 22:10:12.638593500 +0900@@ -35,7 +35,7 @@ #ifdef FLANN_EXPORT #undef FLANN_EXPORT #endif-#ifdef WIN32+#if defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__ /* win32 dll export/import directives */ #ifdef FLANN_EXPORTS #define FLANN_EXPORT __declspec(dllexport)diff -uNr opencv-2.4.10.orig/modules/flann/include/opencv2/flann/dummy.h opencv-2.4.10/modules/flann/include/opencv2/flann/dummy.h--- opencv-2.4.10.orig/modules/flann/include/opencv2/flann/dummy.h 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/flann/include/opencv2/flann/dummy.h 2014-10-08 22:10:12.641594500 +0900@@ -5,7 +5,7 @@ namespace cvflann { -#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS+#if (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS __declspec(dllexport) #endif void dummyfunc();diff -uNr opencv-2.4.10.orig/modules/gpu/src/nvidia/core/NCV.cu opencv-2.4.10/modules/gpu/src/nvidia/core/NCV.cu--- opencv-2.4.10.orig/modules/gpu/src/nvidia/core/NCV.cu 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/gpu/src/nvidia/core/NCV.cu 2014-10-08 22:10:12.644596200 +0900@@ -539,7 +539,7 @@ typedef struct _NcvTimeMoment NcvTimeMoment; -#if defined(_WIN32) || defined(_WIN64)+#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) #include diff -uNr opencv-2.4.10.orig/modules/gpu/src/nvidia/core/NCV.hpp opencv-2.4.10/modules/gpu/src/nvidia/core/NCV.hpp--- opencv-2.4.10.orig/modules/gpu/src/nvidia/core/NCV.hpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/gpu/src/nvidia/core/NCV.hpp 2014-10-08 22:10:12.648599700 +0900@@ -43,7 +43,7 @@ #ifndef _ncv_hpp_ #define _ncv_hpp_ -#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS+#if (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined CVAPI_EXPORTS #define NCV_EXPORTS __declspec(dllexport) #else #define NCV_EXPORTSdiff -uNr opencv-2.4.10.orig/modules/gpu/src/thread_wrappers.cpp opencv-2.4.10/modules/gpu/src/thread_wrappers.cpp--- opencv-2.4.10.orig/modules/gpu/src/thread_wrappers.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/gpu/src/thread_wrappers.cpp 2014-10-08 22:10:12.651601500 +0900@@ -52,7 +52,7 @@ #include #endif -#ifdef WIN32+#if defined WIN32 class cv::gpu::detail::CriticalSection::Impl { public:@@ -131,7 +131,7 @@ impl_->leave(); } -#ifdef WIN32+#if defined WIN32 namespace { struct UserData@@ -244,7 +244,7 @@ void cv::gpu::detail::Thread::sleep(int ms) {-#ifdef WIN32+#if defined WIN32 ::Sleep(ms); #else ::usleep(ms * 1000);diff -uNr opencv-2.4.10.orig/modules/highgui/CMakeLists.txt opencv-2.4.10/modules/highgui/CMakeLists.txt--- opencv-2.4.10.orig/modules/highgui/CMakeLists.txt 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/highgui/CMakeLists.txt 2014-10-08 23:37:06.407242200 +0900@@ -244,6 +244,32 @@ include_directories(AFTER SYSTEM "${OpenCV_SOURCE_DIR}/3rdparty/include") # for directshow in VS2005 and multi-monitor support on MinGW endif() +if(CYGWIN)+ # -ftree-vectorize (included in -O3 option) causes seg.fault+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize")+ list(APPEND highgui_srcs src/window_w32.cpp)+ if(HAVE_DSHOW)+ list(APPEND highgui_srcs src/cap_dshow.cpp)+ endif()+ if(HAVE_VFW)+ list(APPEND highgui_srcs src/cap_vfw.cpp)+ endif()+ if(HAVE_FFMPEG)+ if(BZIP2_LIBRARIES)+ list(APPEND HIGHGUI_LIBRARIES ${BZIP2_LIBRARIES})+ endif()+ if(NOT "${CYGWIN_FFMPEG_BUILT_DIR}" STREQUAL "")+ ocv_include_directories(${CYGWIN_FFMPEG_BUILT_DIR})+ endif()+ endif()+ foreach(P ${HIGHGUI_INCLUDE_DIRS})+ ocv_include_directories(${P})+ endforeach()+ foreach(P ${HIGHGUI_LIBRARY_DIRS})+ link_directories(${P})+ endforeach()+endif()+ if(UNIX) #these variables are set by CHECK_MODULE macro foreach(P ${HIGHGUI_INCLUDE_DIRS})diff -uNr opencv-2.4.10.orig/modules/highgui/src/cap_dshow.cpp opencv-2.4.10/modules/highgui/src/cap_dshow.cpp--- opencv-2.4.10.orig/modules/highgui/src/cap_dshow.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/highgui/src/cap_dshow.cpp 2014-10-08 22:10:12.664609500 +0900@@ -41,7 +41,7 @@ #include "precomp.hpp" -#if (defined WIN32 || defined _WIN32) && defined HAVE_DSHOW+#if (defined WIN32 || defined _WIN32 || defined __CYGWIN__) && defined HAVE_DSHOW /* DirectShow-based Video Capturing module is based on@@ -94,7 +94,6 @@ #pragma warning(disable: 4995) #endif -#include #include #include #include @@ -110,6 +109,12 @@ # include "Aviriff.h" # include "dvdmedia.h" # include "bdaiface.h"+#elif defined __CYGWIN__+#define __STRSAFE__NO_INLINE+#define STRSAFE_NO_DEPRECATE+#include +#include +#include #else # ifdef _MSC_VER # define __extension__@@ -159,7 +164,11 @@ #endif //for threading+#ifdef __CYGWIN__+#include +#else #include +#endif //this is for TryEnterCriticalSection #ifndef _WIN32_WINNT@@ -431,7 +440,7 @@ IMediaEventEx * pMediaEvent; GUID videoType;- long formatType;+ LONG formatType; SampleGrabberCallback * sgCallback; @@ -447,7 +456,7 @@ int connection; int storeConn; int myID;- long requestedFrameTime; //ie fps+ LONG requestedFrameTime; //ie fps char nDeviceName[255]; WCHAR wDeviceName[255];@@ -527,13 +536,13 @@ //Manual control over settings thanks..... //These are experimental for now.- bool setVideoSettingFilter(int deviceID, long Property, long lValue, long Flags = 0, bool useDefaultValue = false);- bool setVideoSettingFilterPct(int deviceID, long Property, float pctValue, long Flags = 0);- bool getVideoSettingFilter(int deviceID, long Property, long &min, long &max, long &SteppingDelta, long &currentValue, long &flags, long &defaultValue);-- bool setVideoSettingCamera(int deviceID, long Property, long lValue, long Flags = 0, bool useDefaultValue = false);- bool setVideoSettingCameraPct(int deviceID, long Property, float pctValue, long Flags = 0);- bool getVideoSettingCamera(int deviceID, long Property, long &min, long &max, long &SteppingDelta, long &currentValue, long &flags, long &defaultValue);+ bool setVideoSettingFilter(int deviceID, LONG Property, LONG lValue, LONG Flags = 0, bool useDefaultValue = false);+ bool setVideoSettingFilterPct(int deviceID, LONG Property, float pctValue, LONG Flags = 0);+ bool getVideoSettingFilter(int deviceID, LONG Property, LONG &min, LONG &max, LONG &SteppingDelta, LONG &currentValue, LONG &flags, LONG &defaultValue);++ bool setVideoSettingCamera(int deviceID, LONG Property, LONG lValue, LONG Flags = 0, bool useDefaultValue = false);+ bool setVideoSettingCameraPct(int deviceID, LONG Property, float pctValue, LONG Flags = 0);+ bool getVideoSettingCamera(int deviceID, LONG Property, LONG &min, LONG &max, LONG &SteppingDelta, LONG &currentValue, LONG &flags, LONG &defaultValue); //bool setVideoSettingCam(int deviceID, long Property, long lValue, long Flags = NULL, bool useDefaultValue = false); @@ -595,7 +604,7 @@ videoDevice * VDList[VI_MAX_CAMERAS]; GUID mediaSubtypes[VI_NUM_TYPES];- long formatTypes[VI_NUM_FORMATS];+ LONG formatTypes[VI_NUM_FORMATS]; static void __cdecl basicThread(void * objPtr); @@ -713,7 +722,7 @@ //This method is meant to have more overhead- STDMETHODIMP BufferCB(double, BYTE *, long){+ STDMETHODIMP BufferCB(double, BYTE *, LONG){ return E_NOTIMPL; } @@ -1265,7 +1274,7 @@ if(FAILED(hr)){ printf("SETUP: couldn't set requested format\n"); }else{- long lValue = 0;+ LONG lValue = 0; hr = pVideoDec->get_AvailableTVFormats(&lValue); if( SUCCEEDED(hr) && (lValue & VDList[deviceNumber]->formatType) ) {@@ -1509,8 +1518,8 @@ } else{ //regular capture method- long bufferSize = VDList[id]->videoSize;- HRESULT hr = VDList[id]->pGrabber->GetCurrentBuffer(&bufferSize, (long *)VDList[id]->pBuffer);+ LONG bufferSize = VDList[id]->videoSize;+ HRESULT hr = VDList[id]->pGrabber->GetCurrentBuffer(&bufferSize, (LONG *)VDList[id]->pBuffer); if(hr==S_OK){ int numBytes = VDList[id]->videoSize; if (numBytes == bufferSize){@@ -1636,14 +1645,19 @@ HRESULT hr = getDevice(&VDList[id]->pVideoInputFilter, id, VDList[id]->wDeviceName, VDList[id]->nDeviceName); if(hr == S_OK){ //myTempThread = (HANDLE)+#if ! defined __CYGWIN__ _beginthread(basicThread, 0, (void *)&VDList[id]);+#else+ pthread_t myTempThread;+ pthread_create(&myTempThread, NULL, (void* (*)(void*))basicThread, (void *)&VDList[id]);+#endif } } } // Set a video signal setting using IAMVideoProcAmp-bool videoInput::getVideoSettingFilter(int deviceID, long Property, long &min, long &max, long &SteppingDelta, long &currentValue, long &flags, long &defaultValue){+bool videoInput::getVideoSettingFilter(int deviceID, LONG Property, LONG &min, LONG &max, LONG &SteppingDelta, LONG &currentValue, LONG &flags, LONG &defaultValue){ if( !isDeviceSetup(deviceID) )return false; HRESULT hr;@@ -1673,7 +1687,11 @@ if (verbose) printf("Setting video setting %s.\n", propStr); pAMVideoProcAmp->GetRange(Property, &min, &max, &SteppingDelta, &defaultValue, &flags);+#ifdef __LP64__+ if (verbose) printf("Range for video setting %s: Min:%u Max:%u SteppingDelta:%u Default:%u Flags:%u\n", propStr, min, max, SteppingDelta, defaultValue, flags);+#else if (verbose) printf("Range for video setting %s: Min:%ld Max:%ld SteppingDelta:%ld Default:%ld Flags:%ld\n", propStr, min, max, SteppingDelta, defaultValue, flags);+#endif pAMVideoProcAmp->Get(Property, &currentValue, &flags); if(pAMVideoProcAmp)pAMVideoProcAmp->Release();@@ -1686,10 +1704,10 @@ // Set a video signal setting using IAMVideoProcAmp-bool videoInput::setVideoSettingFilterPct(int deviceID, long Property, float pctValue, long Flags){+bool videoInput::setVideoSettingFilterPct(int deviceID, LONG Property, float pctValue, LONG Flags){ if( !isDeviceSetup(deviceID) )return false; - long min, max, currentValue, flags, defaultValue, stepAmnt;+ LONG min, max, currentValue, flags, defaultValue, stepAmnt; if( !getVideoSettingFilter(deviceID, Property, min, max, stepAmnt, currentValue, flags, defaultValue) )return false; @@ -1700,8 +1718,8 @@ if(range GetRange(Property, &Min, &Max, &SteppingDelta, &Default, &AvailableCapsFlags);+#ifdef __LP64__+ if (verbose) printf("Range for video setting %s: Min:%u Max:%u SteppingDelta:%u Default:%u Flags:%u\n", propStr, Min, Max, SteppingDelta, Default, AvailableCapsFlags);+#else if (verbose) printf("Range for video setting %s: Min:%ld Max:%ld SteppingDelta:%ld Default:%ld Flags:%ld\n", propStr, Min, Max, SteppingDelta, Default, AvailableCapsFlags);+#endif pAMVideoProcAmp->Get(Property, &CurrVal, &CapsFlags); +#ifdef __LP64__+ if (verbose) printf("Current value: %u Flags %u (%s)\n", CurrVal, CapsFlags, (CapsFlags == 1 ? "Auto" : (CapsFlags == 2 ? "Manual" : "Unknown")));+#else if (verbose) printf("Current value: %ld Flags %ld (%s)\n", CurrVal, CapsFlags, (CapsFlags == 1 ? "Auto" : (CapsFlags == 2 ? "Manual" : "Unknown")));+#endif if (useDefaultValue) { pAMVideoProcAmp->Set(Property, Default, VideoProcAmp_Flags_Auto);@@ -1776,10 +1806,10 @@ } -bool videoInput::setVideoSettingCameraPct(int deviceID, long Property, float pctValue, long Flags){+bool videoInput::setVideoSettingCameraPct(int deviceID, LONG Property, float pctValue, LONG Flags){ if( !isDeviceSetup(deviceID) )return false; - long min, max, currentValue, flags, defaultValue, stepAmnt;+ LONG min, max, currentValue, flags, defaultValue, stepAmnt; if( !getVideoSettingCamera(deviceID, Property, min, max, stepAmnt, currentValue, flags, defaultValue) )return false; @@ -1790,8 +1820,8 @@ if(range GetRange(Property, &Min, &Max, &SteppingDelta, &Default, &AvailableCapsFlags);+#ifdef __LP64__+ if (verbose) printf("Range for video setting %s: Min:%u Max:%u SteppingDelta:%u Default:%u Flags:%u\n", propStr, Min, Max, SteppingDelta, Default, AvailableCapsFlags);+#else if (verbose) printf("Range for video setting %s: Min:%ld Max:%ld SteppingDelta:%ld Default:%ld Flags:%ld\n", propStr, Min, Max, SteppingDelta, Default, AvailableCapsFlags);+#endif pIAMCameraControl->Get(Property, &CurrVal, &CapsFlags);+#ifdef __LP64__+ if (verbose) printf("Current value: %u Flags %u (%s)\n", CurrVal, CapsFlags, (CapsFlags == 1 ? "Auto" : (CapsFlags == 2 ? "Manual" : "Unknown")));+#else if (verbose) printf("Current value: %ld Flags %ld (%s)\n", CurrVal, CapsFlags, (CapsFlags == 1 ? "Auto" : (CapsFlags == 2 ? "Manual" : "Unknown")));+#endif if (useDefaultValue) { pIAMCameraControl->Set(Property, Default, CameraControl_Flags_Auto); }@@ -1855,7 +1897,7 @@ -bool videoInput::getVideoSettingCamera(int deviceID, long Property, long &min, long &max, long &SteppingDelta, long &currentValue, long &flags, long &defaultValue){+bool videoInput::getVideoSettingCamera(int deviceID, LONG Property, LONG &min, LONG &max, LONG &SteppingDelta, LONG &currentValue, LONG &flags, LONG &defaultValue){ if( !isDeviceSetup(deviceID) )return false; HRESULT hr;@@ -1884,7 +1926,11 @@ if (verbose) printf("Setting video setting %s.\n", propStr); pIAMCameraControl->GetRange(Property, &min, &max, &SteppingDelta, &defaultValue, &flags);+#ifdef __LP64__+ if (verbose) printf("Range for video setting %s: Min:%u Max:%u SteppingDelta:%u Default:%u Flags:%u\n", propStr, min, max, SteppingDelta, defaultValue, flags);+#else if (verbose) printf("Range for video setting %s: Min:%ld Max:%ld SteppingDelta:%ld Default:%ld Flags:%ld\n", propStr, min, max, SteppingDelta, defaultValue, flags);+#endif pIAMCameraControl->Get(Property, &currentValue, &flags); if(pIAMCameraControl)pIAMCameraControl->Release();@@ -1923,7 +1969,7 @@ int tmpH = VDList[id]->height; bool bFormat = VDList[id]->specificFormat;- long format = VDList[id]->formatType;+ LONG format = VDList[id]->formatType; int nReconnect = VDList[id]->nFramesForReconnect; bool bReconnect = VDList[id]->autoReconnect;@@ -2741,10 +2787,10 @@ //MAKE SURE THE DEVICE IS SENDING VIDEO BEFORE WE FINISH if(!bCallback){ - long bufferSize = VD->videoSize;+ LONG bufferSize = VD->videoSize; while( hr != S_OK){- hr = VD->pGrabber->GetCurrentBuffer(&bufferSize, (long *)VD->pBuffer);+ hr = VD->pGrabber->GetCurrentBuffer(&bufferSize, (LONG *)VD->pBuffer); Sleep(10); } @@ -3208,7 +3254,7 @@ double CvCaptureCAM_DShow::getProperty( int property_id ) { - long min_value,max_value,stepping_delta,current_value,flags,defaultValue;+ LONG min_value,max_value,stepping_delta,current_value,flags,defaultValue; // image format proprrties switch( property_id )@@ -3343,7 +3389,7 @@ case CV_CAP_PROP_WHITE_BALANCE_BLUE_U: case CV_CAP_PROP_BACKLIGHT: case CV_CAP_PROP_GAIN:- return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(property_id),(long)value);+ return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(property_id),(LONG)value); } //camera properties@@ -3356,7 +3402,7 @@ case CV_CAP_PROP_EXPOSURE: case CV_CAP_PROP_IRIS: case CV_CAP_PROP_FOCUS:- return VI.setVideoSettingCamera(index,VI.getCameraPropertyFromCV(property_id),(long)value);+ return VI.setVideoSettingCamera(index,VI.getCameraPropertyFromCV(property_id),(LONG)value); } return false;diff -uNr opencv-2.4.10.orig/modules/highgui/src/cap_ffmpeg_impl.hpp opencv-2.4.10/modules/highgui/src/cap_ffmpeg_impl.hpp--- opencv-2.4.10.orig/modules/highgui/src/cap_ffmpeg_impl.hpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/highgui/src/cap_ffmpeg_impl.hpp 2014-10-08 22:10:12.670613500 +0900@@ -62,7 +62,9 @@ #include #ifdef WIN32+ #ifndef HAVE_FFMPEG_SWSCALE #define HAVE_FFMPEG_SWSCALE 1+ #endif #include #include #elsediff -uNr opencv-2.4.10.orig/modules/highgui/src/cap_vfw.cpp opencv-2.4.10/modules/highgui/src/cap_vfw.cpp--- opencv-2.4.10.orig/modules/highgui/src/cap_vfw.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/highgui/src/cap_vfw.cpp 2014-10-08 22:10:12.674616200 +0900@@ -41,6 +41,11 @@ #include "precomp.hpp" +#ifdef __CYGWIN__+#include +#include +#endif+ #include #ifdef __GNUC__@@ -156,13 +161,22 @@ bool CvCaptureAVI_VFW::open( const char* filename ) {+#ifdef __CYGWIN__+ char w32filename[MAX_PATH];+#endif+ close(); icvInitCapture_VFW(); if( !filename ) return false; +#ifdef __CYGWIN__+ cygwin_conv_path(CCP_POSIX_TO_WIN_W | CCP_RELATIVE, filename, w32filename, MAX_PATH);+ HRESULT hr = AVIFileOpen( &avifile, w32filename, OF_READ, NULL );+#else HRESULT hr = AVIFileOpen( &avifile, filename, OF_READ, NULL );+#endif if( SUCCEEDED(hr)) { hr = AVIFileGetStream( avifile, &avistream, streamtypeVIDEO, 0 );@@ -719,10 +733,19 @@ bool CvVideoWriter_VFW::open( const char* filename, int _fourcc, double _fps, CvSize frameSize, bool isColor ) {+#ifdef __CYGWIN__+ char w32filename[MAX_PATH];+#endif+ close(); icvInitCapture_VFW();+#ifdef __CYGWIN__+ cygwin_conv_path(CCP_POSIX_TO_WIN_A | CCP_RELATIVE, filename, w32filename, MAX_PATH);+ if( AVIFileOpen( &avifile, w32filename, OF_CREATE | OF_WRITE, 0 ) == AVIERR_OK )+#else if( AVIFileOpen( &avifile, filename, OF_CREATE | OF_WRITE, 0 ) == AVIERR_OK )+#endif { fourcc = _fourcc; fps = _fps;diff -uNr opencv-2.4.10.orig/modules/highgui/src/window_w32.cpp opencv-2.4.10/modules/highgui/src/window_w32.cpp--- opencv-2.4.10.orig/modules/highgui/src/window_w32.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/highgui/src/window_w32.cpp 2014-10-08 22:10:12.680621000 +0900@@ -39,9 +39,13 @@ // //M*/ +#if defined __CYGWIN__+#include +#endif+ #include "precomp.hpp" -#if defined WIN32 || defined _WIN32+#if defined WIN32 || defined _WIN32 || defined __CYGWIN__ #ifdef __GNUC__ # pragma GCC diagnostic ignored "-Wmissing-declarations"@@ -60,8 +64,12 @@ #include #include #include "opencv2/highgui/highgui.hpp"+#ifdef __CYGWIN__+#include +#else #include #endif+#endif static const char* trackbar_text = " ";diff -uNr opencv-2.4.10.orig/modules/legacy/src/calibfilter.cpp opencv-2.4.10/modules/legacy/src/calibfilter.cpp--- opencv-2.4.10.orig/modules/legacy/src/calibfilter.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/legacy/src/calibfilter.cpp 2014-10-08 22:10:12.683622800 +0900@@ -42,7 +42,9 @@ #include "precomp.hpp" #include +#ifndef __CYGWIN__ #undef quad+#endif CvCalibFilter::CvCalibFilter() {diff -uNr opencv-2.4.10.orig/modules/legacy/src/epilines.cpp opencv-2.4.10/modules/legacy/src/epilines.cpp--- opencv-2.4.10.orig/modules/legacy/src/epilines.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/legacy/src/epilines.cpp 2014-10-08 22:10:12.687625400 +0900@@ -46,7 +46,9 @@ /* Valery Mosyagin */ +#ifndef __CYGWIN__ #undef quad+#endif #define EPS64D 1e-9 diff -uNr opencv-2.4.10.orig/modules/ocl/include/opencv2/ocl/cl_runtime/cl_runtime_opencl.hpp opencv-2.4.10/modules/ocl/include/opencv2/ocl/cl_runtime/cl_runtime_opencl.hpp--- opencv-2.4.10.orig/modules/ocl/include/opencv2/ocl/cl_runtime/cl_runtime_opencl.hpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/include/opencv2/ocl/cl_runtime/cl_runtime_opencl.hpp 2014-10-08 22:10:12.691627700 +0900@@ -279,7 +279,7 @@ #define clGetExtensionFunctionAddress clGetExtensionFunctionAddress_pfn #ifndef CL_RUNTIME_EXPORT-#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_OCL_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE)+#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_OCL_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) #define CL_RUNTIME_EXPORT __declspec(dllimport) #else #define CL_RUNTIME_EXPORTdiff -uNr opencv-2.4.10.orig/modules/ocl/include/opencv2/ocl/cl_runtime/clamdblas_runtime.hpp opencv-2.4.10/modules/ocl/include/opencv2/ocl/cl_runtime/clamdblas_runtime.hpp--- opencv-2.4.10.orig/modules/ocl/include/opencv2/ocl/cl_runtime/clamdblas_runtime.hpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/include/opencv2/ocl/cl_runtime/clamdblas_runtime.hpp 2014-10-08 22:10:12.695630700 +0900@@ -538,7 +538,7 @@ #define clAmdBlasZher2k clAmdBlasZher2k_pfn #ifndef CL_RUNTIME_EXPORT-#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_OCL_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE)+#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_OCL_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) #define CL_RUNTIME_EXPORT __declspec(dllimport) #else #define CL_RUNTIME_EXPORTdiff -uNr opencv-2.4.10.orig/modules/ocl/include/opencv2/ocl/cl_runtime/clamdfft_runtime.hpp opencv-2.4.10/modules/ocl/include/opencv2/ocl/cl_runtime/clamdfft_runtime.hpp--- opencv-2.4.10.orig/modules/ocl/include/opencv2/ocl/cl_runtime/clamdfft_runtime.hpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/include/opencv2/ocl/cl_runtime/clamdfft_runtime.hpp 2014-10-08 22:10:12.698632900 +0900@@ -109,7 +109,7 @@ #define clAmdFftEnqueueTransform clAmdFftEnqueueTransform_pfn #ifndef CL_RUNTIME_EXPORT-#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_OCL_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE)+#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_OCL_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) #define CL_RUNTIME_EXPORT __declspec(dllimport) #else #define CL_RUNTIME_EXPORTdiff -uNr opencv-2.4.10.orig/modules/ocl/src/cl_context.cpp opencv-2.4.10/modules/ocl/src/cl_context.cpp--- opencv-2.4.10.orig/modules/ocl/src/cl_context.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/src/cl_context.cpp 2014-10-08 22:10:12.701634700 +0900@@ -59,7 +59,7 @@ using namespace cl_utils; -#if defined(WIN32)+#if defined WIN32 || defined __CYGWIN__ static bool __termination = false; #endif @@ -540,7 +540,7 @@ void create(ContextImpl* context_); void release() {-#ifdef WIN32+#if defined WIN32 || defined __CYGWIN__ // if process is on termination stage (ExitProcess was called and other threads were terminated) // then disable command queue release because it may cause program hang if (!__termination)@@ -622,7 +622,7 @@ } clDeviceID = NULL; -#ifdef WIN32+#if defined WIN32 || defined __CYGWIN__ // if process is on termination stage (ExitProcess was called and other threads were terminated) // then disable context release because it may cause program hang if (!__termination)@@ -920,7 +920,7 @@ __Module::~__Module() {-#if defined(WIN32) && defined(CVAPI_EXPORTS)+#if (defined WIN32 || defined __CYGWIN__) && defined(CVAPI_EXPORTS) // nothing, see DllMain #else ContextImpl::cleanupContext();@@ -931,7 +931,7 @@ } // namespace cv -#if defined(WIN32) && defined(CVAPI_EXPORTS)+#if (defined WIN32 || defined __CYGWIN__) && defined(CVAPI_EXPORTS) extern "C" BOOL WINAPI DllMain(HINSTANCE /*hInst*/, DWORD fdwReason, LPVOID lpReserved);diff -uNr opencv-2.4.10.orig/modules/ocl/src/cl_runtime/cl_runtime.cpp opencv-2.4.10/modules/ocl/src/cl_runtime/cl_runtime.cpp--- opencv-2.4.10.orig/modules/ocl/src/cl_runtime/cl_runtime.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/src/cl_runtime/cl_runtime.cpp 2014-10-08 22:10:12.704637300 +0900@@ -22,7 +22,7 @@ #define CV_CL_GET_PROC_ADDRESS(name) AppleCLGetProcAddress(name) #endif // __APPLE__ -#if defined(_WIN32)+#if defined(_WIN32) || defined(__CYGWIN__) static void* WinGetProcAddress(const char* name) { static HMODULE opencl_module = NULL;diff -uNr opencv-2.4.10.orig/modules/ocl/src/cl_runtime/clamdblas_runtime.cpp opencv-2.4.10/modules/ocl/src/cl_runtime/clamdblas_runtime.cpp--- opencv-2.4.10.orig/modules/ocl/src/cl_runtime/clamdblas_runtime.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/src/cl_runtime/clamdblas_runtime.cpp 2014-10-08 22:10:12.708638800 +0900@@ -8,7 +8,7 @@ #include "opencv2/ocl/cl_runtime/cl_runtime.hpp" #include "opencv2/ocl/cl_runtime/clamdblas_runtime.hpp" -#if defined(_WIN32)+#if defined(_WIN32) || defined(__CYGWIN__) static void* WinGetProcAddress(const char* name) { static HMODULE opencl_module = NULL;diff -uNr opencv-2.4.10.orig/modules/ocl/src/cl_runtime/clamdfft_runtime.cpp opencv-2.4.10/modules/ocl/src/cl_runtime/clamdfft_runtime.cpp--- opencv-2.4.10.orig/modules/ocl/src/cl_runtime/clamdfft_runtime.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/src/cl_runtime/clamdfft_runtime.cpp 2014-10-08 22:10:12.711639700 +0900@@ -8,7 +8,7 @@ #include "opencv2/ocl/cl_runtime/cl_runtime.hpp" #include "opencv2/ocl/cl_runtime/clamdfft_runtime.hpp" -#if defined(_WIN32)+#if defined(_WIN32) || defined(__CYGWIN__) static void* WinGetProcAddress(const char* name) { static HMODULE opencl_module = NULL;diff -uNr opencv-2.4.10.orig/modules/ocl/src/cl_runtime/generator/template/cl_runtime_opencl.hpp.in opencv-2.4.10/modules/ocl/src/cl_runtime/generator/template/cl_runtime_opencl.hpp.in--- opencv-2.4.10.orig/modules/ocl/src/cl_runtime/generator/template/cl_runtime_opencl.hpp.in 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/src/cl_runtime/generator/template/cl_runtime_opencl.hpp.in 2014-10-08 22:10:12.715642400 +0900@@ -12,7 +12,7 @@ @CL_REMAP_DYNAMIC@ #ifndef CL_RUNTIME_EXPORT-#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_OCL_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE)+#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_OCL_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) #define CL_RUNTIME_EXPORT __declspec(dllimport) #else #define CL_RUNTIME_EXPORTdiff -uNr opencv-2.4.10.orig/modules/ocl/src/cl_runtime/generator/template/clamdblas_runtime.cpp.in opencv-2.4.10/modules/ocl/src/cl_runtime/generator/template/clamdblas_runtime.cpp.in--- opencv-2.4.10.orig/modules/ocl/src/cl_runtime/generator/template/clamdblas_runtime.cpp.in 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/src/cl_runtime/generator/template/clamdblas_runtime.cpp.in 2014-10-08 22:10:12.718644200 +0900@@ -5,7 +5,10 @@ #include "opencv2/ocl/cl_runtime/cl_runtime.hpp" #include "opencv2/ocl/cl_runtime/clamdblas_runtime.hpp" -#if defined(_WIN32)+#if defined(_WIN32) || defined(__CYGWIN__)+#ifdef __CYGWIN__+ #include +#endif // __CYGWIN__ static void* WinGetProcAddress(const char* name) { static HMODULE opencl_module = NULL;diff -uNr opencv-2.4.10.orig/modules/ocl/src/cl_runtime/generator/template/clamdblas_runtime.hpp.in opencv-2.4.10/modules/ocl/src/cl_runtime/generator/template/clamdblas_runtime.hpp.in--- opencv-2.4.10.orig/modules/ocl/src/cl_runtime/generator/template/clamdblas_runtime.hpp.in 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/src/cl_runtime/generator/template/clamdblas_runtime.hpp.in 2014-10-08 22:10:12.721648000 +0900@@ -10,7 +10,7 @@ @CLAMDBLAS_REMAP_DYNAMIC@ #ifndef CL_RUNTIME_EXPORT-#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_OCL_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE)+#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_OCL_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) #define CL_RUNTIME_EXPORT __declspec(dllimport) #else #define CL_RUNTIME_EXPORTdiff -uNr opencv-2.4.10.orig/modules/ocl/src/cl_runtime/generator/template/clamdfft_runtime.cpp.in opencv-2.4.10/modules/ocl/src/cl_runtime/generator/template/clamdfft_runtime.cpp.in--- opencv-2.4.10.orig/modules/ocl/src/cl_runtime/generator/template/clamdfft_runtime.cpp.in 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/src/cl_runtime/generator/template/clamdfft_runtime.cpp.in 2014-10-08 22:10:12.724649400 +0900@@ -5,7 +5,10 @@ #include "opencv2/ocl/cl_runtime/cl_runtime.hpp" #include "opencv2/ocl/cl_runtime/clamdfft_runtime.hpp" -#if defined(_WIN32)+#if defined(_WIN32) || defined(__CYGWIN__)+#ifdef __CYGWIN__+ #include +#endif // __CYGWIN__ static void* WinGetProcAddress(const char* name) { static HMODULE opencl_module = NULL;diff -uNr opencv-2.4.10.orig/modules/ocl/src/cl_runtime/generator/template/clamdfft_runtime.hpp.in opencv-2.4.10/modules/ocl/src/cl_runtime/generator/template/clamdfft_runtime.hpp.in--- opencv-2.4.10.orig/modules/ocl/src/cl_runtime/generator/template/clamdfft_runtime.hpp.in 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/src/cl_runtime/generator/template/clamdfft_runtime.hpp.in 2014-10-08 22:10:12.727651600 +0900@@ -10,7 +10,7 @@ @CLAMDFFT_REMAP_DYNAMIC@ #ifndef CL_RUNTIME_EXPORT-#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_OCL_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE)+#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_OCL_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) #define CL_RUNTIME_EXPORT __declspec(dllimport) #else #define CL_RUNTIME_EXPORTdiff -uNr opencv-2.4.10.orig/modules/ocl/src/precomp.hpp opencv-2.4.10/modules/ocl/src/precomp.hpp--- opencv-2.4.10.orig/modules/ocl/src/precomp.hpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ocl/src/precomp.hpp 2014-10-08 22:10:12.730652100 +0900@@ -52,13 +52,13 @@ #pragma warning( disable: 4127 4267 4324 4244 4251 4710 4711 4514 4996 ) #endif -#if defined(_WIN32)+#if defined _WIN32 || defined __CYGWIN__ #include #endif #include "cvconfig.h" -#if defined(BUILD_SHARED_LIBS) && (defined WIN32 || defined _WIN32 || defined WINCE)+#if defined(BUILD_SHARED_LIBS) && (defined WIN32 || defined _WIN32 || defined WINCE || defined __CYGWIN__) #define CL_RUNTIME_EXPORT __declspec(dllexport) #else #define CL_RUNTIME_EXPORTdiff -uNr opencv-2.4.10.orig/modules/python/src2/cv2.cpp opencv-2.4.10/modules/python/src2/cv2.cpp--- opencv-2.4.10.orig/modules/python/src2/cv2.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/python/src2/cv2.cpp 2014-10-08 22:10:12.733654300 +0900@@ -1151,7 +1151,7 @@ #include "cv2.cv.hpp" extern "C"-#if defined WIN32 || defined _WIN32+#if defined WIN32 || defined _WIN32 || defined __CYGWIN__ __declspec(dllexport) #endif void initcv2();diff -uNr opencv-2.4.10.orig/modules/ts/include/opencv2/ts/ts_gtest.h opencv-2.4.10/modules/ts/include/opencv2/ts/ts_gtest.h--- opencv-2.4.10.orig/modules/ts/include/opencv2/ts/ts_gtest.h 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ts/include/opencv2/ts/ts_gtest.h 2014-10-08 22:10:12.743662200 +0900@@ -1912,11 +1912,11 @@ #endif // GTEST_HAS_SEH -#ifdef _MSC_VER+#if defined _MSC_VER || defined __MINGW__ || defined __CYGWIN__ -# if GTEST_LINKED_AS_SHARED_LIBRARY+# if defined GTEST_LINKED_AS_SHARED_LIBRARY && GTEST_LINKED_AS_SHARED_LIBRARY != 0 # define GTEST_API_ __declspec(dllimport)-# elif GTEST_CREATE_SHARED_LIBRARY+# elif defined GTEST_CREATE_SHARED_LIBRARY && GTEST_CREATE_SHARED_LIBRARY != 0 # define GTEST_API_ __declspec(dllexport) # endif diff -uNr opencv-2.4.10.orig/modules/ts/src/gpu_perf.cpp opencv-2.4.10/modules/ts/src/gpu_perf.cpp--- opencv-2.4.10.orig/modules/ts/src/gpu_perf.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/ts/src/gpu_perf.cpp 2014-10-08 22:10:12.747664900 +0900@@ -249,6 +249,12 @@ # else printf("[----------]\n[ GPU INFO ] \tRun on OS Apple x32.\n[----------]\n"), fflush(stdout); # endif+ #elif defined __CYGWIN__+ # if defined _LP64+ printf("[----------]\n[ GPU INFO ] \tRun on OS Cygwin x64.\n[----------]\n"), fflush(stdout);+ # else+ printf("[----------]\n[ GPU INFO ] \tRun on OS Cygwin x32.\n[----------]\n"), fflush(stdout);+ # endif #endif }diff -uNr opencv-2.4.10.orig/modules/viz/CMakeLists.txt opencv-2.4.10/modules/viz/CMakeLists.txt--- opencv-2.4.10.orig/modules/viz/CMakeLists.txt 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/viz/CMakeLists.txt 2014-10-08 23:46:23.247968100 +0900@@ -10,6 +10,11 @@ target_link_libraries(opencv_viz "-framework Cocoa") endif() +if(CYGWIN AND BUILD_opencv_viz)+ target_link_libraries(opencv_viz gdi32)+endif()++ if(TARGET opencv_test_viz) set_target_properties(opencv_test_viz PROPERTIES MACOSX_BUNDLE TRUE) endif()diff -uNr opencv-2.4.10.orig/modules/viz/src/vizimpl.cpp opencv-2.4.10/modules/viz/src/vizimpl.cpp--- opencv-2.4.10.orig/modules/viz/src/vizimpl.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/modules/viz/src/vizimpl.cpp 2014-10-08 22:10:12.750666700 +0900@@ -83,6 +83,17 @@ } } +#ifdef __CYGWIN__+void cv::viz::Viz3d::VizImpl::ExitCallback::Execute(vtkObject* caller, unsigned long event_id, void*)+{+ if (event_id == vtkCommand::ExitEvent)+ {+ vtkSmartPointer interactor = vtkRenderWindowInteractor::SafeDownCast(caller);+ interactor->TerminateApp();+ viz->interactor_ = 0;+ }+}+#else void cv::viz::Viz3d::VizImpl::ExitCallback::Execute(vtkObject*, unsigned long event_id, void*) { if (event_id == vtkCommand::ExitEvent)@@ -91,6 +102,7 @@ viz->interactor_ = 0; } }+#endif ///////////////////////////////////////////////////////////////////////////////////////////// diff -uNr opencv-2.4.10.orig/platforms/android/service/engine/jni/Tests/gtest/gtest.h opencv-2.4.10/platforms/android/service/engine/jni/Tests/gtest/gtest.h--- opencv-2.4.10.orig/platforms/android/service/engine/jni/Tests/gtest/gtest.h2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/platforms/android/service/engine/jni/Tests/gtest/gtest.h2014-10-08 22:10:12.759672400 +0900@@ -1710,7 +1710,7 @@ #endif // GTEST_HAS_SEH -#ifdef _MSC_VER+#if defined _MSC_VER || defined __MINGW__ || defined __CYGWIN__ # if GTEST_LINKED_AS_SHARED_LIBRARY # define GTEST_API_ __declspec(dllimport)diff -uNr opencv-2.4.10.orig/samples/cpp/Qt_sample/qt_opengl.cpp opencv-2.4.10/samples/cpp/Qt_sample/qt_opengl.cpp--- opencv-2.4.10.orig/samples/cpp/Qt_sample/qt_opengl.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/samples/cpp/Qt_sample/qt_opengl.cpp 2014-10-08 22:10:12.764676400 +0900@@ -12,6 +12,8 @@ #ifdef __APPLE__ #include +#elif defined __CYGWIN__+#include #else #include #endifdiff -uNr opencv-2.4.10.orig/samples/cpp/tutorial_code/viz/transformations.cpp opencv-2.4.10/samples/cpp/tutorial_code/viz/transformations.cpp--- opencv-2.4.10.orig/samples/cpp/tutorial_code/viz/transformations.cpp2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/samples/cpp/tutorial_code/viz/transformations.cpp 2014-10-08 22:10:12.767676900 +0900@@ -71,7 +71,7 @@ myWindow.showWidget("Coordinate Widget", viz::WCoordinateSystem()); /// Let's assume camera has the following properties- Point3f cam_pos(3.0f,3.0f,3.0f), cam_focal_point(3.0f,3.0f,2.0f), cam_y_dir(-1.0f,0.0f,0.0f);+ Vec3f cam_pos(3.0f,3.0f,3.0f), cam_focal_point(3.0f,3.0f,2.0f), cam_y_dir(-1.0f,0.0f,0.0f); /// We can get the pose of the cam using makeCameraPose Affine3f cam_pose = viz::makeCameraPose(cam_pos, cam_focal_point, cam_y_dir);diff -uNr opencv-2.4.10.orig/samples/gpu/opengl.cpp opencv-2.4.10/samples/gpu/opengl.cpp--- opencv-2.4.10.orig/samples/gpu/opengl.cpp 2014-10-01 16:33:36.000000000 +0900+++ opencv-2.4.10/samples/gpu/opengl.cpp 2014-10-08 22:10:12.770681200 +0900@@ -9,7 +9,7 @@ } #else -#ifdef WIN32+#if defined WIN32 || defined __CYGWIN__ #define WIN32_LEAN_AND_MEAN 1 #define NOMINMAX 1 #include @@ -18,6 +18,9 @@ #if defined(__APPLE__) #include #include +#elif defined(__CYGWIN__)+ #include + #include #else #include #include