Fix missing G_END_DECL from public headers

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2018-03-23 12:07:28 -04:00
parent ba6750ea21
commit a223c7919c
No known key found for this signature in database
GPG Key ID: 7A25556236BAA3A3
2 changed files with 113 additions and 1 deletions

View File

@ -0,0 +1,106 @@
From 4cda83964e79d14eb5616060a9f31d92d6afdb89 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Fri, 23 Mar 2018 09:42:28 -0400
Subject: [PATCH] Fix up header issues
Use G_END_DECLS properly and wrap modulemd-util.h in an import-
once ifdef block.
Fixes: https://github.com/fedora-modularity/libmodulemd/issues/30
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
---
modulemd/modulemd-component-module.h | 2 ++
modulemd/modulemd-component-rpm.h | 2 ++
modulemd/modulemd-util.h | 9 +++++++++
modulemd/modulemd-yaml.h | 6 +++++-
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/modulemd/modulemd-component-module.h b/modulemd/modulemd-component-module.h
index 9fbf8335d6beb8d4fa6e656ad492f7fb3a23d1fb..32a612b16e70c0776cd82b3d9aec69880f470c16 100644
--- a/modulemd/modulemd-component-module.h
+++ b/modulemd/modulemd-component-module.h
@@ -61,6 +61,8 @@ modulemd_component_module_get_repository (ModulemdComponentModule *self);
const gchar *
modulemd_component_module_peek_repository (ModulemdComponentModule *self);
gchar *
modulemd_component_module_dup_repository (ModulemdComponentModule *self);
+G_END_DECLS
+
#endif /* MODULEMD_COMPONENT_MODULE_H */
diff --git a/modulemd/modulemd-component-rpm.h b/modulemd/modulemd-component-rpm.h
index f92fe58414703106d1dabd1cabe98687b67c72e2..bc1de59b616fa715f86d1a47e0776602b2d75dfd 100644
--- a/modulemd/modulemd-component-rpm.h
+++ b/modulemd/modulemd-component-rpm.h
@@ -89,6 +89,8 @@ modulemd_component_rpm_get_repository (ModulemdComponentRpm *self);
const gchar *
modulemd_component_rpm_peek_repository (ModulemdComponentRpm *self);
gchar *
modulemd_component_rpm_dup_repository (ModulemdComponentRpm *self);
+G_END_DECLS
+
#endif /* MODULEMD_COMPONENT_RPM_H */
diff --git a/modulemd/modulemd-util.h b/modulemd/modulemd-util.h
index 3aaadbf102d33e890a5863e658dca0f15a03b038..03119aa22fc6fb3d0237f27b25fa83909269dd92 100644
--- a/modulemd/modulemd-util.h
+++ b/modulemd/modulemd-util.h
@@ -20,12 +20,17 @@
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#ifndef MODULEMD_UTIL_H
+#define MODULEMD_UTIL_H
+
#include "modulemd.h"
+G_BEGIN_DECLS
+
GHashTable *
_modulemd_hash_table_deep_str_copy (GHashTable *orig);
GHashTable *
_modulemd_hash_table_deep_obj_copy (GHashTable *orig);
@@ -39,5 +44,9 @@ _modulemd_strcmp_sort (gconstpointer a, gconstpointer b);
GPtrArray *
_modulemd_ordered_str_keys (GHashTable *htable, GCompareFunc compare_func);
void
modulemd_variant_unref (void *ptr);
+
+G_END_DECLS
+
+#endif /* MODULEMD_UTIL_H */
diff --git a/modulemd/modulemd-yaml.h b/modulemd/modulemd-yaml.h
index 7604b74e5d5923121243fa9f51fed70ae077a730..563324ba5935b43dd04a9807e7d5528d12f5cebe 100644
--- a/modulemd/modulemd-yaml.h
+++ b/modulemd/modulemd-yaml.h
@@ -27,10 +27,12 @@
#include <glib.h>
#include <yaml.h>
#include "modulemd.h"
+G_BEGIN_DECLS
+
#define MODULEMD_YAML_ERROR modulemd_yaml_error_quark ()
GQuark
modulemd_yaml_error_quark (void);
enum ModulemdYamlError
@@ -278,6 +280,8 @@ _emit_modulemd (yaml_emitter_t *emitter,
gboolean
_emit_defaults (yaml_emitter_t *emitter,
ModulemdDefaults *defaults,
GError **error);
-#endif
+G_END_DECLS
+
+#endif /* MODULEMD_YAML_H */
--
2.16.2

View File

@ -6,7 +6,7 @@
Name: libmodulemd
Version: %{majorminorversion}%{?patchversion:.%{patchversion}}
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Module metadata manipulation library
License: MIT
@ -23,6 +23,9 @@ BuildRequires: python3-gobject-base
# Patches
# Fix missing G_END_DECL from several headers
Patch0001: 0001-Fix-up-header-issues.patch
%description
C Library for manipulating module metadata files.
See https://github.com/fedora-modularity/libmodulemd/blob/master/README.md for
@ -70,6 +73,9 @@ export LC_CTYPE=C.utf8
%{_datadir}/gtk-doc/html/modulemd/
%changelog
* Fri Mar 23 2018 Stephen Gallagher <sgallagh@redhat.com> - 1.1.3-2
- Fix missing G_END_DECL from public headers
* Mon Mar 19 2018 Stephen Gallagher <sgallagh@redhat.com> - 1.1.3-1
- Fix numerous memory leaks
- Drop upstreamed patch