Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-12-14 16:14:28 +0300
committerCorinna Vinschen <corinna@vinschen.de>2016-12-14 16:14:28 +0300
commit86fc4bf065d2f71c955ba2356b5b442fec596014 (patch)
treed5be2f1d0031b9818daa7743b13fed01c9db1204
parent74f7872f89dc8ecad500c5d5c4e03b4757f6418d (diff)
Define RtlGenRandom correctly in ntsecapi.h wrapper
Include ntsecapi.h where required and just redefine RtlGenRandom correctly in the ntsecapi.h wrapper. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/fhandler_random.cc1
-rw-r--r--winsup/cygwin/fhandler_socket.cc1
-rw-r--r--winsup/cygwin/miscfuncs.cc1
-rw-r--r--winsup/cygwin/ntdll.h6
-rw-r--r--winsup/cygwin/ntsecapi.h26
5 files changed, 29 insertions, 6 deletions
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 <ntsecapi.h>
#include <unistd.h>
#include <sys/param.h>
#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 <ntsecapi.h>
#include <ws2tcpip.h>
#include <mswsock.h>
#include <iphlpapi.h>
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 <ntsecapi.h>
#include <sys/uio.h>
#include <assert.h>
#include <alloca.h>
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 <ntsecapi.h>
+
+#undef SystemFunction036
+
+#define RtlGenRandom SystemFunction036
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+BOOLEAN WINAPI RtlGenRandom (PVOID, ULONG);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _CYGWIN_NTSECAPI_H */