Commit 6993cb42531cd611019cde82f388c7fe468f38ab
1 parent
8099e7ad
Exists in
master
and in
1 other branch
Fixing RHEL7 build issues.
Showing
3 changed files
with
17 additions
and
4 deletions
Show diff stats
hllapi.cbp
@@ -63,9 +63,6 @@ | @@ -63,9 +63,6 @@ | ||
63 | </Unit> | 63 | </Unit> |
64 | <Unit filename="src/ipc3270c/windows/private.h" /> | 64 | <Unit filename="src/ipc3270c/windows/private.h" /> |
65 | <Unit filename="src/ipc3270c/windows/resources.rc" /> | 65 | <Unit filename="src/ipc3270c/windows/resources.rc" /> |
66 | - <Unit filename="src/plugin/linux/daemon.h" /> | ||
67 | - <Unit filename="src/plugin/linux/globals.h" /> | ||
68 | - <Unit filename="src/plugin/linux/service.h" /> | ||
69 | <Unit filename="src/plugin/windows/private.h" /> | 66 | <Unit filename="src/plugin/windows/private.h" /> |
70 | <Unit filename="src/plugin/windows/resources.rc" /> | 67 | <Unit filename="src/plugin/windows/resources.rc" /> |
71 | <Unit filename="src/testprograms/hllapi.c"> | 68 | <Unit filename="src/testprograms/hllapi.c"> |
src/ipc3270c/linux/globals.h
@@ -34,6 +34,7 @@ | @@ -34,6 +34,7 @@ | ||
34 | #define PW3270_DBUS_GLOBALS_H_INCLUDED 1 | 34 | #define PW3270_DBUS_GLOBALS_H_INCLUDED 1 |
35 | 35 | ||
36 | #include <libintl.h> | 36 | #include <libintl.h> |
37 | + #include <glib.h> | ||
37 | #include <glib/gi18n.h> | 38 | #include <glib/gi18n.h> |
38 | 39 | ||
39 | #include <errno.h> | 40 | #include <errno.h> |
@@ -41,6 +42,13 @@ | @@ -41,6 +42,13 @@ | ||
41 | #include <lib3270/log.h> | 42 | #include <lib3270/log.h> |
42 | #include <glib.h> | 43 | #include <glib.h> |
43 | 44 | ||
45 | +#if ! GLIB_CHECK_VERSION(2,44,0) | ||
46 | + | ||
47 | + G_GNUC_INTERNAL void hllapi_autoptr_cleanup_generic_gfree(void *p); | ||
48 | + #define g_autofree __attribute__((cleanup(v3270_autoptr_cleanup_generic_gfree))) | ||
49 | + | ||
50 | +#endif // ! GLIB(2,44,0) | ||
51 | + | ||
44 | // | 52 | // |
45 | // Disabling warning on unused-function defined in dbus-glib-bindings.h | 53 | // Disabling warning on unused-function defined in dbus-glib-bindings.h |
46 | // warning: 'org_freedesktop_DBus_reload_config' defined but not used [-Wunused-function] ... | 54 | // warning: 'org_freedesktop_DBus_reload_config' defined but not used [-Wunused-function] ... |
src/ipc3270c/linux/main.c
@@ -41,6 +41,7 @@ | @@ -41,6 +41,7 @@ | ||
41 | #include <pw3270/plugin.h> | 41 | #include <pw3270/plugin.h> |
42 | 42 | ||
43 | #include "service.h" | 43 | #include "service.h" |
44 | +#include "globals.h" | ||
44 | #include "dbus-glue.h" | 45 | #include "dbus-glue.h" |
45 | 46 | ||
46 | #include <gtk/gtk.h> | 47 | #include <gtk/gtk.h> |
@@ -175,5 +176,12 @@ | @@ -175,5 +176,12 @@ | ||
175 | return lib3270_get_default_session_handle(); | 176 | return lib3270_get_default_session_handle(); |
176 | } | 177 | } |
177 | 178 | ||
178 | - | 179 | +#if ! GLIB_CHECK_VERSION(2,44,0) |
180 | +// Reference: https://github.com/ImageMagick/glib/blob/master/glib/glib-autocleanups.h | ||
181 | +void hllapi_autoptr_cleanup_generic_gfree(void *p) | ||
182 | +{ | ||
183 | + void **pp = (void**)p; | ||
184 | + g_free (*pp); | ||
185 | +} | ||
186 | +#endif // ! GLIB(2,44,0) | ||
179 | 187 |