summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDenis Pynkin <denis.pynkin@collabora.com>2019-11-19 02:44:16 +0300
committerDenis Pynkin <denis.pynkin@collabora.com>2020-03-25 15:23:54 +0300
commit485ff7335faf8afb9b4a47eca71cbae10ccd75aa (patch)
treef6bdd5707ed112d6e2f2786015f3ce7a59b195a6 /src
parentfbd2666e076c1cf4bd0a1b13c888b21094b1f97f (diff)
downloadostree-485ff7335faf8afb9b4a47eca71cbae10ccd75aa.tar.gz
lib/sign: allow to build with glib version less than 2.44
Ubuntu 14.04 uses glib-2.40 which have no some shiny macroses for interface declaration. Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Diffstat (limited to 'src')
-rw-r--r--src/libostree/ostree-autocleanups.h1
-rw-r--r--src/libostree/ostree-sign-dummy.c5
-rw-r--r--src/libostree/ostree-sign-dummy.h14
-rw-r--r--src/libostree/ostree-sign-ed25519.c5
-rw-r--r--src/libostree/ostree-sign-ed25519.h15
-rw-r--r--src/libostree/ostree-sign.c2
-rw-r--r--src/libostree/ostree-sign.h18
-rw-r--r--src/libostree/ostree.h1
8 files changed, 56 insertions, 5 deletions
diff --git a/src/libostree/ostree-autocleanups.h b/src/libostree/ostree-autocleanups.h
index c9692ebe..14017012 100644
--- a/src/libostree/ostree-autocleanups.h
+++ b/src/libostree/ostree-autocleanups.h
@@ -73,6 +73,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderOverride, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFinderResult, ostree_repo_finder_result_free)
G_DEFINE_AUTO_CLEANUP_FREE_FUNC (OstreeRepoFinderResultv, ostree_repo_finder_result_freev, NULL)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeSign, g_object_unref)
#endif
G_END_DECLS
diff --git a/src/libostree/ostree-sign-dummy.c b/src/libostree/ostree-sign-dummy.c
index e2d1fe56..48190149 100644
--- a/src/libostree/ostree-sign-dummy.c
+++ b/src/libostree/ostree-sign-dummy.c
@@ -24,6 +24,7 @@
#include "config.h"
+#include <libglnx.h>
#include "ostree-sign-dummy.h"
#include <string.h>
@@ -43,6 +44,10 @@ struct _OstreeSignDummy
gchar *signature_ascii;
};
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeSignDummy, g_object_unref)
+#endif
+
static void
ostree_sign_dummy_iface_init (OstreeSignInterface *self);
diff --git a/src/libostree/ostree-sign-dummy.h b/src/libostree/ostree-sign-dummy.h
index a0d10e1d..f80f8682 100644
--- a/src/libostree/ostree-sign-dummy.h
+++ b/src/libostree/ostree-sign-dummy.h
@@ -33,11 +33,25 @@ G_BEGIN_DECLS
#define OSTREE_TYPE_SIGN_DUMMY (ostree_sign_dummy_get_type ())
_OSTREE_PUBLIC
+GType ostree_sign_dummy_get_type (void);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+typedef struct _OstreeSignDummy OstreeSignDummy;
+typedef struct { GObjectClass parent_class; } OstreeSignDummyClass;
+
+static inline OstreeSignDummy *OSTREE_SIGN_DUMMY (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_sign_dummy_get_type (), OstreeSignDummy); }
+static inline gboolean OSTREE_IS_SIGN_DUMMY (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_sign_dummy_get_type ()); }
+
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+/* Have to use glib-2.44 for this
+_OSTREE_PUBLIC
G_DECLARE_FINAL_TYPE (OstreeSignDummy,
ostree_sign_dummy,
OSTREE,
SIGN_DUMMY,
GObject)
+*/
const gchar * ostree_sign_dummy_get_name (OstreeSign *self);
diff --git a/src/libostree/ostree-sign-ed25519.c b/src/libostree/ostree-sign-ed25519.c
index 0c7cd951..2d5bdb16 100644
--- a/src/libostree/ostree-sign-ed25519.c
+++ b/src/libostree/ostree-sign-ed25519.c
@@ -25,6 +25,7 @@
#include "config.h"
+#include <libglnx.h>
#include "ostree-sign-ed25519.h"
#ifdef HAVE_LIBSODIUM
#include <sodium.h>
@@ -47,6 +48,10 @@ struct _OstreeSignEd25519
GList *revoked_keys;
};
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeSignEd25519, g_object_unref)
+#endif
+
static void
ostree_sign_ed25519_iface_init (OstreeSignInterface *self);
diff --git a/src/libostree/ostree-sign-ed25519.h b/src/libostree/ostree-sign-ed25519.h
index bced1cdf..6e5dd665 100644
--- a/src/libostree/ostree-sign-ed25519.h
+++ b/src/libostree/ostree-sign-ed25519.h
@@ -33,12 +33,25 @@ G_BEGIN_DECLS
#define OSTREE_TYPE_SIGN_ED25519 (ostree_sign_ed25519_get_type ())
_OSTREE_PUBLIC
+GType ostree_sign_ed25519_get_type (void);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+typedef struct _OstreeSignEd25519 OstreeSignEd25519;
+typedef struct { GObjectClass parent_class; } OstreeSignEd25519Class;
+
+static inline OstreeSignEd25519 *OSTREE_SIGN_ED25519 (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_sign_ed25519_get_type (), OstreeSignEd25519); }
+static inline gboolean OSTREE_IS_SIGN_ED25519 (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_sign_ed25519_get_type ()); }
+
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+/* Have to use glib-2.44 for this
+_OSTREE_PUBLIC
G_DECLARE_FINAL_TYPE (OstreeSignEd25519,
ostree_sign_ed25519,
OSTREE,
SIGN_ED25519,
GObject)
-
+*/
gboolean ostree_sign_ed25519_data (OstreeSign *self,
GBytes *data,
diff --git a/src/libostree/ostree-sign.c b/src/libostree/ostree-sign.c
index 95319f67..75db0b26 100644
--- a/src/libostree/ostree-sign.c
+++ b/src/libostree/ostree-sign.c
@@ -47,6 +47,8 @@
#include "ostree-sign-ed25519.h"
#endif
+#include "ostree-autocleanups.h"
+
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "OSTreeSign"
diff --git a/src/libostree/ostree-sign.h b/src/libostree/ostree-sign.h
index 87ed25ce..1415becb 100644
--- a/src/libostree/ostree-sign.h
+++ b/src/libostree/ostree-sign.h
@@ -33,16 +33,26 @@
#include "ostree-remote.h"
#include "ostree-types.h"
-/* Special remote */
-#define OSTREE_SIGN_ALL_REMOTES "__OSTREE_ALL_REMOTES__"
-
-
G_BEGIN_DECLS
#define OSTREE_TYPE_SIGN (ostree_sign_get_type ())
_OSTREE_PUBLIC
+GType ostree_sign_get_type (void);
+
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+typedef struct _OstreeSign OstreeSign;
+typedef struct _OstreeSignInterface OstreeSignInterface;
+
+static inline OstreeSign *OSTREE_SIGN (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_CAST (ptr, ostree_sign_get_type (), OstreeSign); }
+static inline gboolean OSTREE_IS_SIGN (gpointer ptr) { return G_TYPE_CHECK_INSTANCE_TYPE (ptr, ostree_sign_get_type ()); }
+static inline OstreeSignInterface *OSTREE_SIGN_GET_IFACE (gpointer ptr) { return G_TYPE_INSTANCE_GET_INTERFACE (ptr, ostree_sign_get_type (), OstreeSignInterface); }
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+/* Have to use glib-2.44 for this
+_OSTREE_PUBLIC
G_DECLARE_INTERFACE (OstreeSign, ostree_sign, OSTREE, SIGN, GObject)
+*/
struct _OstreeSignInterface
{
diff --git a/src/libostree/ostree.h b/src/libostree/ostree.h
index 49ca919c..0308d0ed 100644
--- a/src/libostree/ostree.h
+++ b/src/libostree/ostree.h
@@ -40,5 +40,6 @@
#include <ostree-repo-finder-mount.h>
#include <ostree-repo-finder-override.h>
#include <ostree-kernel-args.h>
+#include <ostree-sign.h>
#include <ostree-autocleanups.h>
#include <ostree-version.h>