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 3 {
4 4 "name": "Win32",
5 5 "includePath": [
6   - "${workspaceFolder}/**"
  6 + "${workspaceFolder}/**",
  7 + "${vcpkgRoot}/x64-windows/include",
  8 + "${vcpkgRoot}/x64-windows-static/include"
7 9 ],
8 10 "defines": [
9 11 "_DEBUG",
... ...
.vscode/tasks.json
... ... @@ -10,7 +10,9 @@
10 10 "args": [
11 11 "/favor:AMD64",
12 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 16 "${file}"
15 17 ],
16 18 "group": {
... ...
src/include/lib3270.h
... ... @@ -47,6 +47,13 @@
47 47 #define ENOTCONN 126
48 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 57 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || defined (__clang__)
51 58  
52 59 #define LIB3270_DEPRECATED(func) func __attribute__ ((deprecated))
... ... @@ -1360,14 +1367,6 @@
1360 1367 LIB3270_EXPORT void * lib3270_realloc(void *p, int len);
1361 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 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 19 FILE *out = fopen(trace_file,"a");
20 20 if(out)
21 21 {
  22 +
22 23 vfprintf(out,fmt,args);
23 24 fclose(out);
24 25 }
... ...
vc140.pdb 0 → 100644
No preview for this file type