Skip to content

Instantly share code, notes, and snippets.

@kou1okada
Created January 16, 2016 11:56
Show Gist options
  • Save kou1okada/40b109fecf1f4ab3babe to your computer and use it in GitHub Desktop.
Save kou1okada/40b109fecf1f4ab3babe to your computer and use it in GitHub Desktop.
OpenCV 3.1.0 patch for cygwin.
*** opencv-3.1.0.orig/modules/core/src/parallel.cpp 2016-01-16 20:39:07.880186500 +0900
--- opencv-3.1.0/modules/core/src/parallel.cpp 2016-01-16 20:46:56.376797500 +0900
***************
*** 50,56 ****
#undef abs
#endif
! #if defined __linux__ || defined __APPLE__
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
--- 50,56 ----
#undef abs
#endif
! #if defined __linux__ || defined __APPLE__ || defined __CYGWIN__
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
*** opencv-3.1.0.orig/modules/core/src/system.cpp 2015-12-19 00:02:16.000000000 +0900
--- opencv-3.1.0/modules/core/src/system.cpp 2016-01-16 20:47:12.471354500 +0900
***************
*** 64,70 ****
# endif
#endif
! #if defined ANDROID || defined __linux__ || defined __FreeBSD__
# include <unistd.h>
# include <fcntl.h>
# include <elf.h>
--- 64,70 ----
# endif
#endif
! #if defined ANDROID || defined __linux__ || defined __FreeBSD__ || defined __CYGWIN__
# include <unistd.h>
# include <fcntl.h>
# include <elf.h>
***************
*** 406,412 ****
LARGE_INTEGER counter;
QueryPerformanceCounter( &counter );
return (int64)counter.QuadPart;
! #elif defined __linux || defined __linux__
struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp);
return (int64)tp.tv_sec*1000000000 + tp.tv_nsec;
--- 406,412 ----
LARGE_INTEGER counter;
QueryPerformanceCounter( &counter );
return (int64)counter.QuadPart;
! #elif defined __linux || defined __linux__ || defined __CYGWIN__
struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp);
return (int64)tp.tv_sec*1000000000 + tp.tv_nsec;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment