Skip to content

Commit

Permalink
WinRT/WinCE/WP8 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mshabunin committed Oct 15, 2024
1 parent d131137 commit 2d3a500
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 64 deletions.
2 changes: 1 addition & 1 deletion modules/cannops/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(IOS OR WINRT OR ANDROID OR APPLE OR WIN32 OR (NOT HAVE_CANN))
if(IOS OR ANDROID OR APPLE OR WIN32 OR (NOT HAVE_CANN))
ocv_module_disable(cannops)
endif()

Expand Down
2 changes: 1 addition & 1 deletion modules/cudaarithm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(IOS OR WINRT OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
ocv_module_disable(cudaarithm)
endif()

Expand Down
4 changes: 2 additions & 2 deletions modules/cudacodec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(IOS OR APPLE OR WINRT OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
if(IOS OR APPLE OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
ocv_module_disable(cudacodec)
endif()

Expand Down Expand Up @@ -54,4 +54,4 @@ endif()
ocv_create_module(${extra_libs})

ocv_add_accuracy_tests()
ocv_add_perf_tests()
ocv_add_perf_tests()
2 changes: 1 addition & 1 deletion modules/cudafeatures2d/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(IOS OR WINRT OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
ocv_module_disable(cudafeatures2d)
endif()

Expand Down
2 changes: 1 addition & 1 deletion modules/cudafilters/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(IOS OR WINRT OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
ocv_module_disable(cudafilters)
endif()

Expand Down
2 changes: 1 addition & 1 deletion modules/cudaimgproc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(IOS OR WINRT OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
ocv_module_disable(cudaimgproc)
endif()

Expand Down
4 changes: 2 additions & 2 deletions modules/cudaoptflow/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(IOS OR WINRT OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
ocv_module_disable(cudaoptflow)
endif()

Expand Down Expand Up @@ -27,4 +27,4 @@ if(NOT CUDA_VERSION VERSION_LESS "10.0")
add_definitions(-DHAVE_NVIDIA_OPTFLOW=2)
ocv_include_directories(SYSTEM "${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH}/NVIDIAOpticalFlowSDK-${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT}")
endif()
endif()
endif()
2 changes: 1 addition & 1 deletion modules/cudastereo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(IOS OR WINRT OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
ocv_module_disable(cudastereo)
endif()

Expand Down
2 changes: 1 addition & 1 deletion modules/cudawarping/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(IOS OR WINRT OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS))
ocv_module_disable(cudawarping)
endif()

Expand Down
16 changes: 1 addition & 15 deletions modules/datasets/src/tinyxml2/tinyxml2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ XMLUnknown* XMLDocument::NewUnknown( const char* str )

static FILE* callfopen( const char* filepath, const char* mode )
{
#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
FILE* fp = 0;
errno_t err = fopen_s( &fp, filepath, mode );
if ( err ) {
Expand Down Expand Up @@ -1862,17 +1862,7 @@ void XMLPrinter::Print( const char* format, ... )
}
else {
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
#if defined(WINCE)
int len = 512;
do {
len = len*2;
char* str = new char[len]();
len = _vsnprintf(str, len, format, va);
delete[] str;
}while (len < 0);
#else
int len = _vscprintf( format, va );
#endif
#else
int len = vsnprintf( 0, 0, format, va );
#endif
Expand All @@ -1881,11 +1871,7 @@ void XMLPrinter::Print( const char* format, ... )
va_start( va, format );
char* p = _buffer.PushArr( len ) - 1; // back up over the null terminator.
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
#if defined(WINCE)
_vsnprintf( p, len+1, format, va );
#else
vsnprintf_s( p, len+1, _TRUNCATE, format, va );
#endif
#else
vsnprintf( p, len+1, format, va );
#endif
Expand Down
27 changes: 12 additions & 15 deletions modules/datasets/src/tinyxml2/tinyxml2.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ distribution.
#endif


#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
// Microsoft visual studio, version 2005 and higher.
/*int _snprintf_s(
char *buffer,
Expand All @@ -109,9 +109,6 @@ inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )
return result;
}
#define TIXML_SSCANF sscanf_s
#elif defined WINCE
#define TIXML_SNPRINTF _snprintf
#define TIXML_SSCANF sscanf
#else
// GCC version 3 and higher
//#warning( "Using sn* functions." )
Expand Down Expand Up @@ -506,13 +503,13 @@ class XMLUtil
static bool IsWhiteSpace( char p ) {
return !IsUTF8Continuation(p) && isspace( static_cast<unsigned char>(p) );
}

inline static bool IsNameStartChar( unsigned char ch ) {
return ( ( ch < 128 ) ? isalpha( ch ) : 1 )
|| ch == ':'
|| ch == '_';
}

inline static bool IsNameChar( unsigned char ch ) {
return IsNameStartChar( ch )
|| isdigit( ch )
Expand All @@ -535,7 +532,7 @@ class XMLUtil
}
return false;
}

inline static int IsUTF8Continuation( const char p ) {
return p & 0x80;
}
Expand Down Expand Up @@ -1266,14 +1263,14 @@ class TINYXML2_LIB XMLElement : public XMLNode
return a->QueryFloatValue( value );
}


/** Given an attribute name, QueryAttribute() returns
XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the conversion
can't be performed, or XML_NO_ATTRIBUTE if the attribute
doesn't exist. It is overloaded for the primitive types,
and is a generally more convenient replacement of
QueryIntAttribute() and related functions.
If successful, the result of the conversion
will be written to 'value'. If not successful, nothing will
be written to 'value'. This allows you to provide default
Expand Down Expand Up @@ -1401,7 +1398,7 @@ class TINYXML2_LIB XMLElement : public XMLNode
@verbatim
<foo>Hullaballoo!<b>This is text</b></foo>
@endverbatim
For this XML:
@verbatim
<foo />
Expand All @@ -1415,13 +1412,13 @@ class TINYXML2_LIB XMLElement : public XMLNode
/// Convenience method for setting text inside and element. See SetText() for important limitations.
void SetText( int value );
/// Convenience method for setting text inside and element. See SetText() for important limitations.
void SetText( unsigned value );
void SetText( unsigned value );
/// Convenience method for setting text inside and element. See SetText() for important limitations.
void SetText( bool value );
void SetText( bool value );
/// Convenience method for setting text inside and element. See SetText() for important limitations.
void SetText( double value );
void SetText( double value );
/// Convenience method for setting text inside and element. See SetText() for important limitations.
void SetText( float value );
void SetText( float value );

/**
Convenience method to query the value of a child text node. This is probably best
Expand Down Expand Up @@ -1673,7 +1670,7 @@ class TINYXML2_LIB XMLDocument : public XMLNode
}
/// If there is an error, print it to stdout.
void PrintError() const;

/// Clear the document, resetting it to the initial state.
void Clear();

Expand Down
2 changes: 1 addition & 1 deletion modules/julia/cmake/init.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OCV_OPTION(WITH_JULIA "Include Julia support (opencv_contrib)" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT AND NOT WIN32))
OCV_OPTION(WITH_JULIA "Include Julia support (opencv_contrib)" OFF IF (NOT ANDROID AND NOT IOS AND NOT WIN32))

ocv_assert(OPENCV_INITIAL_PASS)

Expand Down
2 changes: 1 addition & 1 deletion modules/matlab/cmake/init.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OCV_OPTION(WITH_MATLAB "Include Matlab support (opencv_contrib)" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT))
OCV_OPTION(WITH_MATLAB "Include Matlab support (opencv_contrib)" OFF IF (NOT ANDROID AND NOT IOS))

ocv_assert(OPENCV_INITIAL_PASS)

Expand Down
2 changes: 1 addition & 1 deletion modules/superres/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(IOS OR WINRT)
if(IOS)
ocv_module_disable(superres)
endif()

Expand Down
4 changes: 0 additions & 4 deletions modules/tracking/perf/perf_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ static
void initTrackingTests()
{
const char* extraTestDataPath =
#ifdef WINRT
NULL;
#else
getenv("OPENCV_DNN_TEST_DATA_PATH");
#endif
if (extraTestDataPath)
cvtest::addDataSearchPath(extraTestDataPath);

Expand Down
4 changes: 0 additions & 4 deletions modules/tracking/test/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ static
void initTrackingTests()
{
const char* extraTestDataPath =
#ifdef WINRT
NULL;
#else
getenv("OPENCV_DNN_TEST_DATA_PATH");
#endif
if (extraTestDataPath)
cvtest::addDataSearchPath(extraTestDataPath);

Expand Down
4 changes: 0 additions & 4 deletions modules/videostab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ if(HAVE_CUDA)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations -Wshadow -Wunused-parameter)
endif()

if(DEFINED WINRT AND NOT DEFINED ENABLE_WINRT_MODE_NATIVE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW")
endif()

ocv_define_module(videostab opencv_imgproc opencv_features2d opencv_video opencv_photo opencv_3d
OPTIONAL opencv_cudawarping opencv_cudaoptflow opencv_videoio WRAP python)
4 changes: 0 additions & 4 deletions modules/wechat_qrcode/perf/perf_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ void initQRTests()
{
#ifdef HAVE_OPENCV_DNN
const char* extraTestDataPath =
#ifdef WINRT
NULL;
#else
getenv("OPENCV_DNN_TEST_DATA_PATH");
#endif
if (extraTestDataPath)
cvtest::addDataSearchPath(extraTestDataPath);
#endif // HAVE_OPENCV_DNN
Expand Down
4 changes: 0 additions & 4 deletions modules/wechat_qrcode/test/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ void initTests()
{
#ifdef HAVE_OPENCV_DNN
const char* extraTestDataPath =
#ifdef WINRT
NULL;
#else
getenv("OPENCV_DNN_TEST_DATA_PATH");
#endif
if (extraTestDataPath)
cvtest::addDataSearchPath(extraTestDataPath);
#endif // HAVE_OPENCV_DNN
Expand Down

0 comments on commit 2d3a500

Please sign in to comment.