| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#ifdef _WIN32 |
| 5 |
|
| 6 |
#define STRINGIFY_HELPER(x) #x |
| 7 |
#define STRINGIFY(x) STRINGIFY_HELPER(x) |
| 8 |
|
| 9 |
#if defined _MSC_FULL_VER && _MSC_FULL_VER < 193632532 |
| 10 |
#pragma message("Current _MSC_FULL_VER: " STRINGIFY(_MSC_FULL_VER)) |
| 11 |
#error Please update your build environment to the latest Visual Studio 2022! |
| 12 |
#endif |
| 13 |
|
| 14 |
#include <sdkddkver.h> |
| 15 |
#ifndef NTDDI_WIN10_NI |
| 16 |
#pragma message("Current WDK_NTDDI_VERSION: " STRINGIFY(WDK_NTDDI_VERSION)) |
| 17 |
#error Windows 10.0.22621 SDK or later is required |
| 18 |
#endif |
| 19 |
|
| 20 |
#undef STRINGIFY |
| 21 |
#undef STRINGIFY_HELPER |
| 22 |
|
| 23 |
#endif |
| 24 |
|
| 25 |
#include <algorithm> |
| 26 |
#include <array> |
| 27 |
#include <assert.h> |
| 28 |
#include <bitset> |
| 29 |
#include <cassert> |
| 30 |
#include <cctype> |
| 31 |
#include <cerrno> |
| 32 |
#include <cmath> |
| 33 |
#include <cstdarg> |
| 34 |
#include <cstddef> |
| 35 |
#include <cstdio> |
| 36 |
#include <cstdlib> |
| 37 |
#include <cstring> |
| 38 |
#include <ctime> |
| 39 |
#include <ctype.h> |
| 40 |
#include <deque> |
| 41 |
#include <errno.h> |
| 42 |
#if !defined ANDROID && !defined _WIN32 |
| 43 |
#include <execinfo.h> |
| 44 |
#endif |
| 45 |
#include <fcntl.h> |
| 46 |
#include <filesystem> |
| 47 |
#include <float.h> |
| 48 |
#include <fmt/format.h> |
| 49 |
#include <fstream> |
| 50 |
#include <functional> |
| 51 |
#ifndef _WIN32 |
| 52 |
#include <getopt.h> |
| 53 |
#endif |
| 54 |
#if defined _WIN32 && defined _M_X86_64 |
| 55 |
#include <intrin.h> |
| 56 |
#endif |
| 57 |
#include <iomanip> |
| 58 |
#include <iostream> |
| 59 |
#include <limits.h> |
| 60 |
#include <limits> |
| 61 |
#include <list> |
| 62 |
#include <locale.h> |
| 63 |
#include <map> |
| 64 |
#include <math.h> |
| 65 |
#include <memory.h> |
| 66 |
#include <memory> |
| 67 |
#include <mutex> |
| 68 |
#include <numeric> |
| 69 |
#include <optional> |
| 70 |
#ifndef _WIN32 |
| 71 |
#include <pthread.h> |
| 72 |
#endif |
| 73 |
#include <queue> |
| 74 |
#include <set> |
| 75 |
#include <sstream> |
| 76 |
#include <stack> |
| 77 |
#include <stdarg.h> |
| 78 |
#include <stddef.h> |
| 79 |
#include <stdint.h> |
| 80 |
#include <stdio.h> |
| 81 |
#include <stdlib.h> |
| 82 |
#include <string.h> |
| 83 |
#include <string_view> |
| 84 |
#include <thread> |
| 85 |
#include <time.h> |
| 86 |
#include <type_traits> |
| 87 |
#ifndef _WIN32 |
| 88 |
#include <unistd.h> |
| 89 |
#endif |
| 90 |
#include <unordered_map> |
| 91 |
#include <unordered_set> |
| 92 |
#include <utility> |
| 93 |
#include <variant> |
| 94 |
#include <vector> |
| 95 |
|
| 96 |
#ifdef _WIN32 |
| 97 |
#include <Windows.h> |
| 98 |
#endif |
| 99 |
|
| 100 |
#include "Common/Common.h" |
| 101 |
#include "Common/Thread.h" |