--- orig/rhash-1.4.3/common_func.c	2022-06-14 22:25:13.000000000 +0200
+++ common_func.c	2023-03-24 16:30:19.880219800 +0100
@@ -11,8 +11,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <wchar.h>
+#include <sys/time.h>

-#if defined( _WIN32) || defined(__CYGWIN__)
+#if defined( _WIN32)
 # include <windows.h>
 #endif

@@ -231,7 +232,7 @@
  * Timer functions
  *=========================================================================*/

-#if defined( _WIN32) || defined(__CYGWIN__)
+#if defined( _WIN32)
 #define get_timedelta(delta) QueryPerformanceCounter((LARGE_INTEGER*)delta)
 #else
 #define get_timedelta(delta) gettimeofday(delta, NULL)
@@ -245,7 +246,7 @@
 uint64_t rsh_timer_stop(timedelta_t* timer)
 {
 	timedelta_t end;
-#if defined( _WIN32) || defined(__CYGWIN__)
+#if defined( _WIN32)
 	LARGE_INTEGER frequency;
 	get_timedelta(&end);
 	*timer = end - *timer;
@@ -261,7 +262,7 @@

 unsigned rhash_get_ticks(void)
 {
-#if defined( _WIN32) || defined(__CYGWIN__)
+#if defined( _WIN32)
 	return GetTickCount();
 #else
 	struct timeval tv;
--- origsrc/RHash-1.3.9/common_func.h	2019-12-14 17:52:11.000000000 +0100
+++ common_func.h	2019-12-19 16:19:03.896876500 +0100
@@ -18,7 +18,7 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <time.h> /* for time_t */
-#if !defined( _WIN32) && !defined(__CYGWIN__)
+#if !defined( _WIN32)
 # include <sys/time.h> /* for timeval */
 #elif _MSC_VER > 1300
 # include "platform.h"
@@ -86,7 +86,7 @@ const char* get_bt_program_name(void);
 /* time delta and timer functions */

 /* portable timer definition */
-#if defined( _WIN32) || defined(__CYGWIN__)
+#if defined( _WIN32)
 typedef unsigned long long timedelta_t;
 #else
 #include <sys/time.h> /* for timeval */
--- origsrc/RHash-1.3.9/file.c	2019-12-14 17:52:11.000000000 +0100
+++ file.c	2019-12-19 16:19:29.386535500 +0100
@@ -19,7 +19,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>  /* _O_RDONLY, _O_BINARY, posix_fadvise */

-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)
 # include <windows.h>
 #if !defined(__CYGWIN__)
 # include <share.h> /* for _SH_DENYWR */
--- origsrc/RHash-1.3.9/librhash/plug_openssl.c	2019-12-14 17:52:11.000000000 +0100
+++ librhash/plug_openssl.c	2019-12-19 16:34:19.467508100 +0100
@@ -57,7 +57,7 @@
 #endif

 #if defined(OPENSSL_RUNTIME)
-#  if defined(_WIN32) || defined(__CYGWIN__)
+#  if defined(_WIN32)
 #    include <windows.h>
 #  else
 #    include <dlfcn.h>
@@ -176,7 +176,7 @@

 #ifdef OPENSSL_RUNTIME

-#if (defined(_WIN32) || defined(__CYGWIN__)) /* __CYGWIN__ is also defined in MSYS */
+#if defined(_WIN32)
 # define GET_DLSYM(name) (void(*)(void))GetProcAddress(handle, name)
 #else  /* _WIN32 */
 # define GET_DLSYM(name) dlsym(handle, name)
@@ -195,7 +195,7 @@
  */
 static int load_openssl_runtime(void)
 {
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)
 	HMODULE handle = 0;
 	size_t i;

--- origsrc/RHash-1.3.9/librhash/rhash.c	2019-12-14 17:52:11.000000000 +0100
+++ librhash/rhash.c	2019-12-19 16:48:42.605848200 +0100
@@ -15,7 +15,7 @@
  */

 /* modifier for Windows DLL */
-#if (defined(_WIN32) || defined(__CYGWIN__)) && defined(RHASH_EXPORTS)
+#if defined(_WIN32) && defined(RHASH_EXPORTS)
 # define RHASH_API __declspec(dllexport)
 #endif

@@ -621,7 +621,7 @@ size_t RHASH_API rhash_print(char* outpu
 	return rhash_print_bytes(output, digest, digest_size, flags);
 }

-#if (defined(_WIN32) || defined(__CYGWIN__)) && defined(RHASH_EXPORTS)
+#if defined(_WIN32) && defined(RHASH_EXPORTS)
 #include <windows.h>
 BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID reserved);
 BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID reserved)
--- origsrc/RHash-1.3.9/librhash/rhash_torrent.c	2019-12-14 17:52:11.000000000 +0100
+++ librhash/rhash_torrent.c	2019-12-19 16:54:28.185099200 +0100
@@ -15,7 +15,7 @@
  */

 /* modifier for Windows DLL */
-#if (defined(_WIN32) || defined(__CYGWIN__) ) && defined(RHASH_EXPORTS)
+#if defined(_WIN32) && defined(RHASH_EXPORTS)
 # define RHASH_API __declspec(dllexport)
 #endif

--- origsrc/RHash-1.3.9/win_utils.c	2019-12-14 17:52:11.000000000 +0100
+++ win_utils.c	2019-12-19 16:25:58.681744700 +0100
@@ -1,5 +1,5 @@
 /* win_utils.c - utility functions for Windows and CygWin */
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)

 /* Fix #138: require to use MSVCRT implementation of *printf functions */
 #define __USE_MINGW_ANSI_STDIO 0
@@ -575,4 +575,4 @@ size_t win_fwrite(const void* ptr, size_
 #endif /* _WIN32 */
 #else
 typedef int dummy_declaration_required_by_strict_iso_c;
-#endif /* defined(_WIN32) || defined(__CYGWIN__) */
+#endif /* defined(_WIN32) */
--- origsrc/RHash-1.3.9/win_utils.h	2019-12-14 17:52:11.000000000 +0100
+++ win_utils.h	2019-12-19 16:26:20.156506200 +0100
@@ -2,7 +2,7 @@
 #ifndef WIN_UTILS_H
 #define WIN_UTILS_H

-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)

 #ifdef __cplusplus
 extern "C" {
@@ -58,6 +58,6 @@ size_t win_fwrite(const void* ptr, size_
 }
 #endif

-#endif /* defined(_WIN32) || defined(__CYGWIN__) */
+#endif /* defined(_WIN32) */

 #endif /* WIN_UTILS_H */
