Commit 436f38c73c2466746bcff24f13209d16b9e3473d

Authored by Werneck
1 parent 184468d6

Playing with msc. Seens like it will not work since msc doesn´t have support for auto-free.

.vscode/c_cpp_properties.json
@@ -3,7 +3,9 @@ @@ -3,7 +3,9 @@
3 { 3 {
4 "name": "Win32", 4 "name": "Win32",
5 "includePath": [ 5 "includePath": [
6 - "${workspaceFolder}/**" 6 + "${workspaceFolder}/**",
  7 + "${vcpkgRoot}/x64-windows/include",
  8 + "${vcpkgRoot}/x64-windows-static/include"
7 ], 9 ],
8 "defines": [ 10 "defines": [
9 "_DEBUG", 11 "_DEBUG",
.vscode/tasks.json
@@ -10,7 +10,9 @@ @@ -10,7 +10,9 @@
10 "args": [ 10 "args": [
11 "/favor:AMD64", 11 "/favor:AMD64",
12 "/c", 12 "/c",
13 - "/I ${workspaceFolder}/src/include", 13 + "/I","${workspaceFolder}/src/include",
  14 + "/I","${env:VCPKG_ROOT}/x64-windows/include",
  15 + "/I","${env:VCPKG_ROOT}/x64-windows-static/include",
14 "${file}" 16 "${file}"
15 ], 17 ],
16 "group": { 18 "group": {
src/include/lib3270.h
@@ -47,6 +47,13 @@ @@ -47,6 +47,13 @@
47 #define ENOTCONN 126 47 #define ENOTCONN 126
48 #endif // !ENOTCONN 48 #endif // !ENOTCONN
49 49
  50 + #if defined (__GNUC__) || defined (__clang__)
  51 +
  52 + #define LIB3270_AUTOPTR_FUNC_NAME(TypeName) lib3270_autoptr_cleanup_##TypeName
  53 + #define lib3270_autoptr(TypeName) TypeName * __attribute__ ((__cleanup__(LIB3270_AUTOPTR_FUNC_NAME(TypeName))))
  54 +
  55 + #endif // __GNUC__
  56 +
50 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || defined (__clang__) 57 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || defined (__clang__)
51 58
52 #define LIB3270_DEPRECATED(func) func __attribute__ ((deprecated)) 59 #define LIB3270_DEPRECATED(func) func __attribute__ ((deprecated))
@@ -1360,14 +1367,6 @@ @@ -1360,14 +1367,6 @@
1360 LIB3270_EXPORT void * lib3270_realloc(void *p, int len); 1367 LIB3270_EXPORT void * lib3270_realloc(void *p, int len);
1361 LIB3270_EXPORT void * lib3270_strdup(const char *str); 1368 LIB3270_EXPORT void * lib3270_strdup(const char *str);
1362 1369
1363 - #define LIB3270_AUTOPTR_FUNC_NAME(TypeName) lib3270_autoptr_cleanup_##TypeName  
1364 -  
1365 - /**  
1366 - * @brief Declare an auto-cleanup pointer.  
1367 - *  
1368 - */  
1369 - #define lib3270_autoptr(TypeName) TypeName * __attribute__ ((__cleanup__(LIB3270_AUTOPTR_FUNC_NAME(TypeName))))  
1370 -  
1371 /** 1370 /**
1372 * @brief Release allocated memory. 1371 * @brief Release allocated memory.
1373 * 1372 *
src/testprogram/testprogram.c
@@ -19,6 +19,7 @@ static void write_trace(H3270 GNUC_UNUSED(*session), void GNUC_UNUSED(*userdata) @@ -19,6 +19,7 @@ static void write_trace(H3270 GNUC_UNUSED(*session), void GNUC_UNUSED(*userdata)
19 FILE *out = fopen(trace_file,"a"); 19 FILE *out = fopen(trace_file,"a");
20 if(out) 20 if(out)
21 { 21 {
  22 +
22 vfprintf(out,fmt,args); 23 vfprintf(out,fmt,args);
23 fclose(out); 24 fclose(out);
24 } 25 }
vc140.pdb 0 → 100644
No preview for this file type