Skip to content

Commit

Permalink
Merge pull request #960 from alalek:issue_contrib_955
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Jan 20, 2017
2 parents 44071d7 + 695996e commit f36e5f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions modules/dnn/CMakeLists.txt
@@ -1,8 +1,4 @@
cmake_minimum_required(VERSION 2.8)

if(APPLE_FRAMEWORK OR WINRT
OR AARCH64 # protobuf doesn't know this platform
)
if(WINRT)
ocv_module_disable(dnn)
endif()

Expand All @@ -29,6 +25,10 @@ else()
)
endif()

if(APPLE_FRAMEWORK)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshorten-64-to-32)
endif()

if(ANDROID)
add_definitions(-DDISABLE_POSIX_MEMALIGN -DTH_DISABLE_HEAP_TRACKING)
endif()
Expand Down
4 changes: 2 additions & 2 deletions modules/dnn/src/torch/THDiskFile.cpp
Expand Up @@ -30,11 +30,11 @@ const char *THDiskFile_name(THFile *self)

/* workaround mac osx lion ***insane*** fread bug */
#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;
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;
}
#else
Expand Down

0 comments on commit f36e5f9

Please sign in to comment.