aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-06-16 02:01:18 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-06-16 02:09:33 +0300
commitc45dfbe0ef86ef3d8f91d1547bb16880d87eba4f (patch)
tree6ca191241e1c3fcc3c33785300099a0ef7b1a878
parent8756a52d86ef0fe71fa9aee34b23466795bdc94b (diff)
downloadydb-c45dfbe0ef86ef3d8f91d1547bb16880d87eba4f.tar.gz
Intermediate changes
-rw-r--r--contrib/tools/m4/lib/platform/win64/config.h2
-rw-r--r--contrib/tools/m4/lib/platform/win64/win_sdk10.h55
2 files changed, 56 insertions, 1 deletions
diff --git a/contrib/tools/m4/lib/platform/win64/config.h b/contrib/tools/m4/lib/platform/win64/config.h
index 7b03effd7b..e05b4a31af 100644
--- a/contrib/tools/m4/lib/platform/win64/config.h
+++ b/contrib/tools/m4/lib/platform/win64/config.h
@@ -1,7 +1,7 @@
/* lib/config.h. Generated from config.hin by configure. */
/* lib/config.hin. Generated from configure.ac by autoheader. */
-#include <contrib/tools/bison/lib/win_sdk10.h>
+#include "win_sdk10.h"
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
diff --git a/contrib/tools/m4/lib/platform/win64/win_sdk10.h b/contrib/tools/m4/lib/platform/win64/win_sdk10.h
new file mode 100644
index 0000000000..76e5c86ccd
--- /dev/null
+++ b/contrib/tools/m4/lib/platform/win64/win_sdk10.h
@@ -0,0 +1,55 @@
+#pragma once
+
+#if defined(_MSC_VER)
+
+#include <ntverp.h>
+
+// Check for Windows SDK 10+
+#if defined(VER_PRODUCTBUILD) && VER_PRODUCTBUILD >= 9600
+#define WIN_SDK10 1
+#else
+#define WIN_SDK10 0
+#endif
+
+// Since Windows SDK 10 FILE is an internal opaque structure with no backward compatibility.
+// This code has been transplanted from Windows SDK
+// corecrt_internal_stdio.h
+
+// __crt_stdio_stream_data
+#if WIN_SDK10
+typedef struct {
+ union {
+ void* _public_file;
+ char* _ptr;
+ };
+
+ char* _base;
+ int _cnt;
+ long _flags;
+ long _file;
+ int _charbuf;
+ int _bufsiz;
+ char* _tmpfname;
+ //CRITICAL_SECTION _lock;
+} TWinSdk10File;
+
+enum EWinSdk10ModeBits {
+ WIN_SDK10_IOREAD = 0x0001,
+ WIN_SDK10_IOWRITE = 0x0002,
+ WIN_SDK10_IOUPDATE = 0x0004,
+ WIN_SDK10_IOEOF = 0x0008,
+ WIN_SDK10_IOERROR = 0x0010,
+ WIN_SDK10_IOCTRLZ = 0x0020,
+ WIN_SDK10_IOBUFFER_CRT = 0x0040,
+ WIN_SDK10_IOBUFFER_USER = 0x0080,
+ WIN_SDK10_IOBUFFER_SETVBUF = 0x0100,
+ WIN_SDK10_IOBUFFER_STBUF = 0x0200,
+ WIN_SDK10_IOBUFFER_NONE = 0x0400,
+ WIN_SDK10_IOCOMMIT = 0x0800,
+ WIN_SDK10_IOSTRING = 0x1000,
+ WIN_SDK10_IOALLOCATED = 0x2000,
+};
+#endif
+
+#endif
+