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