diff --git a/tools/hitag2crack/crack5opencl/ht2crack5opencl.c b/tools/hitag2crack/crack5opencl/ht2crack5opencl.c index 924932b2c..ec261dff8 100644 --- a/tools/hitag2crack/crack5opencl/ht2crack5opencl.c +++ b/tools/hitag2crack/crack5opencl/ht2crack5opencl.c @@ -35,6 +35,18 @@ #include "hitag2.h" #include "dolphin_macro.h" +#if defined(__MINGW64__) +#define timersub(a, b, result) \ + do { \ + (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((result)->tv_usec < 0) { \ + --(result)->tv_sec; \ + (result)->tv_usec += 1000000;\ + } \ + } while (0) +#endif + #define MAX_BITSLICES 32 #define VECTOR_SIZE (MAX_BITSLICES/8)