Commit f36e5f92 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #960 from alalek:issue_contrib_955

parents 44071d78 695996e8
cmake_minimum_required(VERSION 2.8) if(WINRT)
if(APPLE_FRAMEWORK OR WINRT
OR AARCH64 # protobuf doesn't know this platform
)
ocv_module_disable(dnn) ocv_module_disable(dnn)
endif() endif()
...@@ -29,6 +25,10 @@ else() ...@@ -29,6 +25,10 @@ else()
) )
endif() endif()
if(APPLE_FRAMEWORK)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshorten-64-to-32)
endif()
if(ANDROID) if(ANDROID)
add_definitions(-DDISABLE_POSIX_MEMALIGN -DTH_DISABLE_HEAP_TRACKING) add_definitions(-DDISABLE_POSIX_MEMALIGN -DTH_DISABLE_HEAP_TRACKING)
endif() endif()
......
...@@ -30,11 +30,11 @@ const char *THDiskFile_name(THFile *self) ...@@ -30,11 +30,11 @@ const char *THDiskFile_name(THFile *self)
/* workaround mac osx lion ***insane*** fread bug */ /* workaround mac osx lion ***insane*** fread bug */
#ifdef __APPLE__ #ifdef __APPLE__
size_t fread__(void *ptr, size_t size, size_t nitems, FILE *stream) static size_t fread__(void *ptr, size_t size, size_t nitems, FILE *stream)
{ {
size_t nread = 0; size_t nread = 0;
while(!feof(stream) && !ferror(stream) && (nread < nitems)) while(!feof(stream) && !ferror(stream) && (nread < nitems))
nread += fread((char*)ptr+nread*size, size, THMin(2147483648/size, nitems-nread), stream); nread += fread((char*)ptr+nread*size, size, THMin(2147483648UL/size, nitems-nread), stream);
return nread; return nread;
} }
#else #else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment