Commit dfe54d12baf03ef3723023e70e461ef219b891b8
Exists in
master
and in
3 other branches
Merge branch 'master' into CVE-2019-15525
Showing
4 changed files
with
52 additions
and
18 deletions
Show diff stats
... | ... | @@ -0,0 +1,21 @@ |
1 | +{ | |
2 | + "configurations": [ | |
3 | + { | |
4 | + "name": "Win32", | |
5 | + "includePath": [ | |
6 | + "${workspaceFolder}/**" | |
7 | + ], | |
8 | + "defines": [ | |
9 | + "_DEBUG", | |
10 | + "UNICODE", | |
11 | + "_UNICODE" | |
12 | + ], | |
13 | + "windowsSdkVersion": "10.0.18362.0", | |
14 | + "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe", | |
15 | + "cStandard": "c11", | |
16 | + "cppStandard": "c++17", | |
17 | + "intelliSenseMode": "msvc-x64" | |
18 | + } | |
19 | + ], | |
20 | + "version": 4 | |
21 | +} | |
0 | 22 | \ No newline at end of file | ... | ... |
.vscode/tasks.json
1 | +// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
2 | +// for the documentation about the tasks.json format | |
1 | 3 | { |
2 | - // See https://go.microsoft.com/fwlink/?LinkId=733558 | |
3 | - // for the documentation about the tasks.json format | |
4 | 4 | "version": "2.0.0", |
5 | 5 | "tasks": [ |
6 | 6 | { |
7 | + "label": "msvc build", | |
7 | 8 | "type": "shell", |
8 | - "label": "Make Debug", | |
9 | - "command": "make", | |
9 | + "command": "cl.exe", | |
10 | 10 | "args": [ |
11 | - "Debug" | |
12 | - ], | |
13 | - "problemMatcher": [ | |
14 | - "$gcc" | |
11 | + "/favor:AMD64", | |
12 | + "/c", | |
13 | + "/I ${workspaceFolder}/src/include", | |
14 | + "${file}" | |
15 | 15 | ], |
16 | 16 | "group": { |
17 | 17 | "kind": "build", |
18 | 18 | "isDefault": true |
19 | - } | |
19 | + }, | |
20 | + "presentation": { | |
21 | + "reveal": "always" | |
22 | + }, | |
23 | + "problemMatcher": "$msCompile" | |
20 | 24 | } |
21 | 25 | ] |
22 | -} | |
23 | 26 | \ No newline at end of file |
27 | + } | |
24 | 28 | \ No newline at end of file | ... | ... |
src/include/lib3270-internals.h
... | ... | @@ -107,16 +107,25 @@ |
107 | 107 | |
108 | 108 | #endif |
109 | 109 | |
110 | +#if defined(_WIN32) || defined(_MSC_VER) | |
111 | + | |
112 | + #include <winsock2.h> | |
113 | + #include <windows.h> | |
114 | + | |
115 | +#else | |
116 | + | |
117 | + #include <unistd.h> /* Unix system calls */ | |
118 | + #include <sys/time.h> /* System time-related data types */ | |
119 | + | |
120 | +#endif // _WIN32 | |
110 | 121 | |
111 | 122 | /* |
112 | 123 | * Prerequisite #includes. |
113 | 124 | */ |
114 | 125 | #include <stdio.h> /* Unix standard I/O library */ |
115 | -#include <unistd.h> /* Unix system calls */ | |
116 | 126 | #include <ctype.h> /* Character classes */ |
117 | 127 | #include <string.h> /* String manipulations */ |
118 | 128 | #include <sys/types.h> /* Basic system data types */ |
119 | -#include <sys/time.h> /* System time-related data types */ | |
120 | 129 | #include <time.h> /* C library time functions */ |
121 | 130 | #include "localdefs.h" /* {s,tcl,c}3270-specific defines */ |
122 | 131 | |
... | ... | @@ -293,7 +302,7 @@ struct lib3270_text |
293 | 302 | */ |
294 | 303 | typedef struct timeout |
295 | 304 | { |
296 | - LIB3270_LINKED_LIST_HEAD; | |
305 | + LIB3270_LINKED_LIST_HEAD | |
297 | 306 | |
298 | 307 | unsigned char in_play; |
299 | 308 | |
... | ... | @@ -315,7 +324,7 @@ typedef struct timeout |
315 | 324 | */ |
316 | 325 | typedef struct _input_t |
317 | 326 | { |
318 | - LIB3270_LINKED_LIST_HEAD; | |
327 | + LIB3270_LINKED_LIST_HEAD | |
319 | 328 | |
320 | 329 | unsigned char enabled; |
321 | 330 | int fd; |
... | ... | @@ -327,14 +336,14 @@ typedef struct _input_t |
327 | 336 | |
328 | 337 | struct lib3270_state_callback |
329 | 338 | { |
330 | - LIB3270_LINKED_LIST_HEAD; | |
339 | + LIB3270_LINKED_LIST_HEAD | |
331 | 340 | |
332 | 341 | void (*func)(H3270 *, int, void *); /**< @brief Function to call */ |
333 | 342 | }; |
334 | 343 | |
335 | 344 | struct lib3270_toggle_callback |
336 | 345 | { |
337 | - LIB3270_LINKED_LIST_HEAD; | |
346 | + LIB3270_LINKED_LIST_HEAD | |
338 | 347 | |
339 | 348 | void (*func)(H3270 *, LIB3270_TOGGLE_ID, char, void *); /**< @brief Function to call */ |
340 | 349 | }; | ... | ... |
src/include/lib3270/session.h
... | ... | @@ -31,13 +31,13 @@ |
31 | 31 | |
32 | 32 | #define LIB3270_SESSION_H_INCLUDED 1 |
33 | 33 | |
34 | - #ifdef WIN32 | |
34 | + #if defined(_WIN32) || defined(_MSC_VER) | |
35 | 35 | #include <winsock2.h> |
36 | 36 | #include <windows.h> |
37 | 37 | #include <ws2tcpip.h> |
38 | 38 | #else |
39 | 39 | #include <sys/socket.h> |
40 | - #endif // WIN32 | |
40 | + #endif // _WIN32 | |
41 | 41 | |
42 | 42 | #ifdef HAVE_LIBSSL |
43 | 43 | #include <openssl/ssl.h> | ... | ... |