Commit dfe54d12baf03ef3723023e70e461ef219b891b8

Authored by Perry Werneck
2 parents 1f0bb6c5 d66624c4

Merge branch 'master' into CVE-2019-15525

.vscode/c_cpp_properties.json 0 → 100644
@@ -0,0 +1,21 @@ @@ -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 \ No newline at end of file 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 "version": "2.0.0", 4 "version": "2.0.0",
5 "tasks": [ 5 "tasks": [
6 { 6 {
  7 + "label": "msvc build",
7 "type": "shell", 8 "type": "shell",
8 - "label": "Make Debug",  
9 - "command": "make", 9 + "command": "cl.exe",
10 "args": [ 10 "args": [
11 - "Debug"  
12 - ],  
13 - "problemMatcher": [  
14 - "$gcc" 11 + "/favor:AMD64",
  12 + "/c",
  13 + "/I ${workspaceFolder}/src/include",
  14 + "${file}"
15 ], 15 ],
16 "group": { 16 "group": {
17 "kind": "build", 17 "kind": "build",
18 "isDefault": true 18 "isDefault": true
19 - } 19 + },
  20 + "presentation": {
  21 + "reveal": "always"
  22 + },
  23 + "problemMatcher": "$msCompile"
20 } 24 }
21 ] 25 ]
22 -}  
23 \ No newline at end of file 26 \ No newline at end of file
  27 + }
24 \ No newline at end of file 28 \ No newline at end of file
src/include/lib3270-internals.h
@@ -107,16 +107,25 @@ @@ -107,16 +107,25 @@
107 107
108 #endif 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 * Prerequisite #includes. 123 * Prerequisite #includes.
113 */ 124 */
114 #include <stdio.h> /* Unix standard I/O library */ 125 #include <stdio.h> /* Unix standard I/O library */
115 -#include <unistd.h> /* Unix system calls */  
116 #include <ctype.h> /* Character classes */ 126 #include <ctype.h> /* Character classes */
117 #include <string.h> /* String manipulations */ 127 #include <string.h> /* String manipulations */
118 #include <sys/types.h> /* Basic system data types */ 128 #include <sys/types.h> /* Basic system data types */
119 -#include <sys/time.h> /* System time-related data types */  
120 #include <time.h> /* C library time functions */ 129 #include <time.h> /* C library time functions */
121 #include "localdefs.h" /* {s,tcl,c}3270-specific defines */ 130 #include "localdefs.h" /* {s,tcl,c}3270-specific defines */
122 131
@@ -293,7 +302,7 @@ struct lib3270_text @@ -293,7 +302,7 @@ struct lib3270_text
293 */ 302 */
294 typedef struct timeout 303 typedef struct timeout
295 { 304 {
296 - LIB3270_LINKED_LIST_HEAD; 305 + LIB3270_LINKED_LIST_HEAD
297 306
298 unsigned char in_play; 307 unsigned char in_play;
299 308
@@ -315,7 +324,7 @@ typedef struct timeout @@ -315,7 +324,7 @@ typedef struct timeout
315 */ 324 */
316 typedef struct _input_t 325 typedef struct _input_t
317 { 326 {
318 - LIB3270_LINKED_LIST_HEAD; 327 + LIB3270_LINKED_LIST_HEAD
319 328
320 unsigned char enabled; 329 unsigned char enabled;
321 int fd; 330 int fd;
@@ -327,14 +336,14 @@ typedef struct _input_t @@ -327,14 +336,14 @@ typedef struct _input_t
327 336
328 struct lib3270_state_callback 337 struct lib3270_state_callback
329 { 338 {
330 - LIB3270_LINKED_LIST_HEAD; 339 + LIB3270_LINKED_LIST_HEAD
331 340
332 void (*func)(H3270 *, int, void *); /**< @brief Function to call */ 341 void (*func)(H3270 *, int, void *); /**< @brief Function to call */
333 }; 342 };
334 343
335 struct lib3270_toggle_callback 344 struct lib3270_toggle_callback
336 { 345 {
337 - LIB3270_LINKED_LIST_HEAD; 346 + LIB3270_LINKED_LIST_HEAD
338 347
339 void (*func)(H3270 *, LIB3270_TOGGLE_ID, char, void *); /**< @brief Function to call */ 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,13 +31,13 @@
31 31
32 #define LIB3270_SESSION_H_INCLUDED 1 32 #define LIB3270_SESSION_H_INCLUDED 1
33 33
34 - #ifdef WIN32 34 + #if defined(_WIN32) || defined(_MSC_VER)
35 #include <winsock2.h> 35 #include <winsock2.h>
36 #include <windows.h> 36 #include <windows.h>
37 #include <ws2tcpip.h> 37 #include <ws2tcpip.h>
38 #else 38 #else
39 #include <sys/socket.h> 39 #include <sys/socket.h>
40 - #endif // WIN32 40 + #endif // _WIN32
41 41
42 #ifdef HAVE_LIBSSL 42 #ifdef HAVE_LIBSSL
43 #include <openssl/ssl.h> 43 #include <openssl/ssl.h>