Commit d66624c48c0a9efe3a9b9e82866e86a13657328e

Authored by Perry Werneck
1 parent 00823dd5

Adjustments for build with MSC

.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
@@ -105,16 +105,25 @@ @@ -105,16 +105,25 @@
105 105
106 #endif 106 #endif
107 107
  108 +#if defined(_WIN32) || defined(_MSC_VER)
  109 +
  110 + #include <winsock2.h>
  111 + #include <windows.h>
  112 +
  113 +#else
  114 +
  115 + #include <unistd.h> /* Unix system calls */
  116 + #include <sys/time.h> /* System time-related data types */
  117 +
  118 +#endif // _WIN32
108 119
109 /* 120 /*
110 * Prerequisite #includes. 121 * Prerequisite #includes.
111 */ 122 */
112 #include <stdio.h> /* Unix standard I/O library */ 123 #include <stdio.h> /* Unix standard I/O library */
113 -#include <unistd.h> /* Unix system calls */  
114 #include <ctype.h> /* Character classes */ 124 #include <ctype.h> /* Character classes */
115 #include <string.h> /* String manipulations */ 125 #include <string.h> /* String manipulations */
116 #include <sys/types.h> /* Basic system data types */ 126 #include <sys/types.h> /* Basic system data types */
117 -#include <sys/time.h> /* System time-related data types */  
118 #include <time.h> /* C library time functions */ 127 #include <time.h> /* C library time functions */
119 #include "localdefs.h" /* {s,tcl,c}3270-specific defines */ 128 #include "localdefs.h" /* {s,tcl,c}3270-specific defines */
120 129
@@ -291,7 +300,7 @@ struct lib3270_text @@ -291,7 +300,7 @@ struct lib3270_text
291 */ 300 */
292 typedef struct timeout 301 typedef struct timeout
293 { 302 {
294 - LIB3270_LINKED_LIST_HEAD; 303 + LIB3270_LINKED_LIST_HEAD
295 304
296 unsigned char in_play; 305 unsigned char in_play;
297 306
@@ -313,7 +322,7 @@ typedef struct timeout @@ -313,7 +322,7 @@ typedef struct timeout
313 */ 322 */
314 typedef struct _input_t 323 typedef struct _input_t
315 { 324 {
316 - LIB3270_LINKED_LIST_HEAD; 325 + LIB3270_LINKED_LIST_HEAD
317 326
318 unsigned char enabled; 327 unsigned char enabled;
319 int fd; 328 int fd;
@@ -325,14 +334,14 @@ typedef struct _input_t @@ -325,14 +334,14 @@ typedef struct _input_t
325 334
326 struct lib3270_state_callback 335 struct lib3270_state_callback
327 { 336 {
328 - LIB3270_LINKED_LIST_HEAD; 337 + LIB3270_LINKED_LIST_HEAD
329 338
330 void (*func)(H3270 *, int, void *); /**< @brief Function to call */ 339 void (*func)(H3270 *, int, void *); /**< @brief Function to call */
331 }; 340 };
332 341
333 struct lib3270_toggle_callback 342 struct lib3270_toggle_callback
334 { 343 {
335 - LIB3270_LINKED_LIST_HEAD; 344 + LIB3270_LINKED_LIST_HEAD
336 345
337 void (*func)(H3270 *, LIB3270_TOGGLE_ID, char, void *); /**< @brief Function to call */ 346 void (*func)(H3270 *, LIB3270_TOGGLE_ID, char, void *); /**< @brief Function to call */
338 }; 347 };
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>