Commit 436f38c73c2466746bcff24f13209d16b9e3473d
1 parent
184468d6
Exists in
master
and in
3 other branches
Playing with msc. Seens like it will not work since msc doesn´t have support for auto-free.
Showing
5 changed files
with
14 additions
and
10 deletions
Show diff stats
.vscode/c_cpp_properties.json
.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
No preview for this file type