diff --git a/winsup/cygwin/fhandler_random.cc b/winsup/cygwin/fhandler_random.cc index c56ce73d3..1a3edd16f 100644 --- a/winsup/cygwin/fhandler_random.cc +++ b/winsup/cygwin/fhandler_random.cc @@ -7,6 +7,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ #include "winsup.h" +#include #include #include #include "cygerrno.h" diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 801a731a5..f3d1d6925 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -21,6 +21,7 @@ #undef u_long #define u_long __ms_u_long #endif +#include #include #include #include diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc index 0b19b2892..e92ccbabb 100644 --- a/winsup/cygwin/miscfuncs.cc +++ b/winsup/cygwin/miscfuncs.cc @@ -8,6 +8,7 @@ details. */ #include "winsup.h" #include "miscfuncs.h" +#include #include #include #include diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h index bf5a7cf80..448eadf20 100644 --- a/winsup/cygwin/ntdll.h +++ b/winsup/cygwin/ntdll.h @@ -1608,10 +1608,4 @@ extern "C" } } - -/* There's a bug in ntsecapi.h (Mingw as well as MSFT). SystemFunction036 - is, in fact, a WINAPI function, but it's not defined as such. Therefore - we have to do it correctly here. *Strictly*, this is not ntdll... */ -#define RtlGenRandom SystemFunction036 -extern "C" BOOLEAN WINAPI RtlGenRandom (PVOID, ULONG); #endif diff --git a/winsup/cygwin/ntsecapi.h b/winsup/cygwin/ntsecapi.h new file mode 100644 index 000000000..8b0a7e77f --- /dev/null +++ b/winsup/cygwin/ntsecapi.h @@ -0,0 +1,26 @@ +#ifndef _CYGWIN_NTSECAPI_H +#define _CYGWIN_NTSECAPI_H + +/* There's a bug in ntsecapi.h (Mingw as well as MSFT). SystemFunction036 + is, in fact, a WINAPI function, but it's not defined as such. Therefore + we have to do it correctly here in the ntsecapi.h wrapper. */ + +#define SystemFunction036 __nonexistant_SystemFunction036__ + +#include_next + +#undef SystemFunction036 + +#define RtlGenRandom SystemFunction036 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +BOOLEAN WINAPI RtlGenRandom (PVOID, ULONG); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _CYGWIN_NTSECAPI_H */