James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 2 | From: PJ Reiniger <pj.reiniger@gmail.com> |
| 3 | Date: Tue, 26 Apr 2022 15:19:14 -0400 |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 4 | Subject: [PATCH 04/10] Preprocessor cleanup |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 5 | |
| 6 | --- |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 7 | include/uv.h | 12 ------------ |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 8 | include/uv/unix.h | 8 -------- |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 9 | src/unix/internal.h | 2 ++ |
| 10 | src/win/fs.c | 1 + |
| 11 | src/win/tty.c | 2 ++ |
| 12 | src/win/util.c | 8 ++++++++ |
| 13 | src/win/winsock.c | 1 + |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 14 | 7 files changed, 14 insertions(+), 20 deletions(-) |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 15 | |
| 16 | diff --git a/include/uv.h b/include/uv.h |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 17 | index 02397dd0fdd43d51f86c0dde9a62046702f12bdb..d5342b0d52232bbf83825948cc6bc09e5d74a4c7 100644 |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 18 | --- a/include/uv.h |
| 19 | +++ b/include/uv.h |
| 20 | @@ -23,9 +23,6 @@ |
| 21 | |
| 22 | #ifndef UV_H |
| 23 | #define UV_H |
| 24 | -#ifdef __cplusplus |
| 25 | -extern "C" { |
| 26 | -#endif |
| 27 | |
| 28 | #if defined(BUILDING_UV_SHARED) && defined(USING_UV_SHARED) |
| 29 | #error "Define either BUILDING_UV_SHARED or USING_UV_SHARED, not both." |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 30 | @@ -796,16 +793,10 @@ UV_EXTERN int uv_tty_get_winsize(uv_tty_t*, int* width, int* height); |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 31 | UV_EXTERN void uv_tty_set_vterm_state(uv_tty_vtermstate_t state); |
| 32 | UV_EXTERN int uv_tty_get_vterm_state(uv_tty_vtermstate_t* state); |
| 33 | |
| 34 | -#ifdef __cplusplus |
| 35 | -extern "C++" { |
| 36 | - |
| 37 | inline int uv_tty_set_mode(uv_tty_t* handle, int mode) { |
| 38 | return uv_tty_set_mode(handle, static_cast<uv_tty_mode_t>(mode)); |
| 39 | } |
| 40 | |
| 41 | -} |
| 42 | -#endif |
| 43 | - |
| 44 | UV_EXTERN uv_handle_type uv_guess_handle(uv_file file); |
| 45 | |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 46 | enum { |
| 47 | @@ -1906,7 +1897,4 @@ UV_EXTERN void uv_loop_set_data(uv_loop_t*, void* data); |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 48 | #undef UV_LOOP_PRIVATE_PLATFORM_FIELDS |
| 49 | #undef UV__ERR |
| 50 | |
| 51 | -#ifdef __cplusplus |
| 52 | -} |
| 53 | -#endif |
| 54 | #endif /* UV_H */ |
| 55 | diff --git a/include/uv/unix.h b/include/uv/unix.h |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 56 | index 09f88a5674280d762c094d956e5dec6971c6a33e..e334cabe0280ef94bacbb1171049c71f17bf56ff 100644 |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 57 | --- a/include/uv/unix.h |
| 58 | +++ b/include/uv/unix.h |
| 59 | @@ -47,14 +47,6 @@ |
| 60 | |
| 61 | #if defined(__linux__) |
| 62 | # include "uv/linux.h" |
| 63 | -#elif defined (__MVS__) |
| 64 | -# include "uv/os390.h" |
| 65 | -#elif defined(__PASE__) /* __PASE__ and _AIX are both defined on IBM i */ |
| 66 | -# include "uv/posix.h" /* IBM i needs uv/posix.h, not uv/aix.h */ |
| 67 | -#elif defined(_AIX) |
| 68 | -# include "uv/aix.h" |
| 69 | -#elif defined(__sun) |
| 70 | -# include "uv/sunos.h" |
| 71 | #elif defined(__APPLE__) |
| 72 | # include "uv/darwin.h" |
| 73 | #elif defined(__DragonFly__) || \ |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 74 | diff --git a/src/unix/internal.h b/src/unix/internal.h |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 75 | index 98c437dcadec5b5106d697e82d5394d459f55e47..854d98a16a74c45e0b6cb92b17782de6803f6e28 100644 |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 76 | --- a/src/unix/internal.h |
| 77 | +++ b/src/unix/internal.h |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 78 | @@ -233,6 +233,8 @@ struct uv__statx { |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 79 | #if defined(__linux__) && O_NDELAY != O_NONBLOCK |
| 80 | #undef uv__nonblock |
| 81 | #define uv__nonblock uv__nonblock_fcntl |
| 82 | +#undef UV__NONBLOCK_IS_IOCTL |
| 83 | +#define UV__NONBLOCK_IS_FCNTL |
| 84 | #endif |
| 85 | |
| 86 | /* core */ |
| 87 | diff --git a/src/win/fs.c b/src/win/fs.c |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 88 | index 565c05fff13c2e6e74091c1da7b31636d7fd370d..f415ddc2c39d09eea317fc857777acce1ce7d13e 100644 |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 89 | --- a/src/win/fs.c |
| 90 | +++ b/src/win/fs.c |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 91 | @@ -40,6 +40,7 @@ |
| 92 | |
| 93 | #include <winioctl.h> |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 94 | |
| 95 | +#pragma comment(lib, "Advapi32.lib") |
| 96 | |
| 97 | #define UV_FS_FREE_PATHS 0x0002 |
| 98 | #define UV_FS_FREE_PTR 0x0008 |
| 99 | diff --git a/src/win/tty.c b/src/win/tty.c |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 100 | index abbe1315883257d6825b794344dcd4cba9514097..9bb3d9e830c901122da5e521e0c6b032dfd5044c 100644 |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 101 | --- a/src/win/tty.c |
| 102 | +++ b/src/win/tty.c |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 103 | @@ -37,6 +37,8 @@ |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 104 | #include "stream-inl.h" |
| 105 | #include "req-inl.h" |
| 106 | |
| 107 | +#pragma comment(lib, "User32.lib") |
| 108 | + |
| 109 | #ifndef InterlockedOr |
| 110 | # define InterlockedOr _InterlockedOr |
| 111 | #endif |
| 112 | diff --git a/src/win/util.c b/src/win/util.c |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 113 | index 1cfd7b2caf0d4ad1a6a66df9406c21f4e2b69b04..af18cfa6c106c5de0996e4fff9b4127aaa3b576b 100644 |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 114 | --- a/src/win/util.c |
| 115 | +++ b/src/win/util.c |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 116 | @@ -64,12 +64,20 @@ |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 117 | |
| 118 | |
| 119 | /* A RtlGenRandom() by any other name... */ |
| 120 | +extern "C" { |
| 121 | extern BOOLEAN NTAPI SystemFunction036(PVOID Buffer, ULONG BufferLength); |
| 122 | +} |
| 123 | |
| 124 | /* Cached copy of the process title, plus a mutex guarding it. */ |
| 125 | static char *process_title; |
| 126 | static CRITICAL_SECTION process_title_lock; |
| 127 | |
| 128 | +#pragma comment(lib, "Advapi32.lib") |
| 129 | +#pragma comment(lib, "IPHLPAPI.lib") |
| 130 | +#pragma comment(lib, "Psapi.lib") |
| 131 | +#pragma comment(lib, "Userenv.lib") |
| 132 | +#pragma comment(lib, "kernel32.lib") |
| 133 | + |
| 134 | /* Frequency of the high-resolution clock. */ |
| 135 | static uint64_t hrtime_frequency_ = 0; |
| 136 | |
| 137 | diff --git a/src/win/winsock.c b/src/win/winsock.c |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 138 | index a68b095366a78e78675b49a078749f45dbad6015..7843e9f13321c32419cebaacde82d30f471e11d7 100644 |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 139 | --- a/src/win/winsock.c |
| 140 | +++ b/src/win/winsock.c |
| 141 | @@ -25,6 +25,7 @@ |
| 142 | #include "uv.h" |
| 143 | #include "internal.h" |
| 144 | |
| 145 | +#pragma comment(lib, "Ws2_32.lib") |
| 146 | |
| 147 | /* Whether there are any non-IFS LSPs stacked on TCP */ |
| 148 | int uv_tcp_non_ifs_lsp_ipv4; |