Fix ostree autoptr checks for git master

The export g_autoptr changes in ostree will be in the release 2017.4,
but the gnome CI is currently failing due to them also being in current
git master which is called 2017.3 atm. We fix this by checking against
2017.3 instead, which is safe, because the actual OSTREE_CHECK_VERSION
macro was added after the 2017.3 release too.
tingping/wmclass
Alexander Larsson 2017-03-30 09:42:56 +02:00 committed by Alexander Larsson
parent ea114f5d6c
commit f42a4d735b
1 changed files with 6 additions and 1 deletions

View File

@ -495,10 +495,15 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakRepoTransaction, flatpak_repo_transaction_
#define AUTOLOCK(name) G_GNUC_UNUSED __attribute__((cleanup (flatpak_auto_unlock_helper))) GMutex * G_PASTE (auto_unlock, __LINE__) = flatpak_auto_lock_helper (&G_LOCK_NAME (name))
/* OSTREE_CHECK_VERSION was added immediately after the 2017.3 release */
#ifndef OSTREE_CHECK_VERSION
#define OSTREE_CHECK_VERSION(year, minor) (0)
#endif
#if !OSTREE_CHECK_VERSION(2017, 4)
/* Cleanups are always exported in 2017.4, and some git releases between 2017.3 and 2017.4.
We actually check against 2017.3 so that we work on the git releases *after* 2017.3
which is safe, because the real OSTREE_CHECK_VERSION macro was added after 2017.3
too. */
#if !OSTREE_CHECK_VERSION(2017, 3)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepo, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeMutableTree, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeAsyncProgress, g_object_unref)