diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 43e5188..374141a 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -3,7 +3,9 @@ { "name": "Win32", "includePath": [ - "${workspaceFolder}/**" + "${workspaceFolder}/**", + "${vcpkgRoot}/x64-windows/include", + "${vcpkgRoot}/x64-windows-static/include" ], "defines": [ "_DEBUG", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 2cf6d73..a93a454 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -10,7 +10,9 @@ "args": [ "/favor:AMD64", "/c", - "/I ${workspaceFolder}/src/include", + "/I","${workspaceFolder}/src/include", + "/I","${env:VCPKG_ROOT}/x64-windows/include", + "/I","${env:VCPKG_ROOT}/x64-windows-static/include", "${file}" ], "group": { diff --git a/src/include/lib3270.h b/src/include/lib3270.h index a386dd4..9c61ddb 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -47,6 +47,13 @@ #define ENOTCONN 126 #endif // !ENOTCONN + #if defined (__GNUC__) || defined (__clang__) + + #define LIB3270_AUTOPTR_FUNC_NAME(TypeName) lib3270_autoptr_cleanup_##TypeName + #define lib3270_autoptr(TypeName) TypeName * __attribute__ ((__cleanup__(LIB3270_AUTOPTR_FUNC_NAME(TypeName)))) + + #endif // __GNUC__ + #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || defined (__clang__) #define LIB3270_DEPRECATED(func) func __attribute__ ((deprecated)) @@ -1360,14 +1367,6 @@ LIB3270_EXPORT void * lib3270_realloc(void *p, int len); LIB3270_EXPORT void * lib3270_strdup(const char *str); - #define LIB3270_AUTOPTR_FUNC_NAME(TypeName) lib3270_autoptr_cleanup_##TypeName - - /** - * @brief Declare an auto-cleanup pointer. - * - */ - #define lib3270_autoptr(TypeName) TypeName * __attribute__ ((__cleanup__(LIB3270_AUTOPTR_FUNC_NAME(TypeName)))) - /** * @brief Release allocated memory. * diff --git a/src/testprogram/testprogram.c b/src/testprogram/testprogram.c index fc31c66..cd20dc1 100644 --- a/src/testprogram/testprogram.c +++ b/src/testprogram/testprogram.c @@ -19,6 +19,7 @@ static void write_trace(H3270 GNUC_UNUSED(*session), void GNUC_UNUSED(*userdata) FILE *out = fopen(trace_file,"a"); if(out) { + vfprintf(out,fmt,args); fclose(out); } diff --git a/vc140.pdb b/vc140.pdb new file mode 100644 index 0000000..48ff294 Binary files /dev/null and b/vc140.pdb differ -- libgit2 0.21.2