[gnome-desktop/mcatanzaro/check-version] Add GNOME_DESKTOP_CHECK_VERSION macro
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop/mcatanzaro/check-version] Add GNOME_DESKTOP_CHECK_VERSION macro
- Date: Mon, 11 Apr 2022 19:44:56 +0000 (UTC)
commit 162722b9a5aac4ceca2a1d181a568bc82f3ae9be
Author: Michael Catanzaro <mcatanzaro redhat com>
Date: Mon Apr 11 14:43:15 2022 -0500
Add GNOME_DESKTOP_CHECK_VERSION macro
This is improves !137. It's a little more convenient for developers, and
is more consistent with GLib and GTK.
libgnome-desktop/gnome-desktop-version.c | 2 +-
libgnome-desktop/gnome-desktop-version.h.in | 12 +++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/libgnome-desktop/gnome-desktop-version.c b/libgnome-desktop/gnome-desktop-version.c
index 5c3baa5f..e2f9af55 100644
--- a/libgnome-desktop/gnome-desktop-version.c
+++ b/libgnome-desktop/gnome-desktop-version.c
@@ -37,5 +37,5 @@
int
gnome_get_platform_version (void)
{
- return GNOME_DESKTOP_PLATFORM_VERSION;
+ return GNOME_DESKTOP_MAJOR_VERSION;
}
diff --git a/libgnome-desktop/gnome-desktop-version.h.in b/libgnome-desktop/gnome-desktop-version.h.in
index 839cf420..7951702c 100644
--- a/libgnome-desktop/gnome-desktop-version.h.in
+++ b/libgnome-desktop/gnome-desktop-version.h.in
@@ -1,6 +1,7 @@
/* gnome-desktop-version.h
*
* Copyright (C) 2022 Sergio Costas
+ * Copyright (C) 2022 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
@@ -22,8 +23,17 @@
#ifndef __GNOME_DESKTOP_VERSION_H__
#define __GNOME_DESKTOP_VERSION_H__
-#define GNOME_DESKTOP_PLATFORM_VERSION @GNOME_PLATFORM@
+#define GNOME_DESKTOP_MAJOR_VERSION @GNOME_PLATFORM@
+#define GNOME_DESKTOP_MINOR_VERSION @GNOME_MINOR@
+#define GNOME_DESKTOP_MICRO_VERSION @GNOME_MICRO@
+
+#define GNOME_DESKTOP_CHECK_VERSION(major,minor,micro) \
+ (GNOME_DESKTOP_MAJOR_VERSION > (major) || \
+ (GNOME_DESKTOP_MAJOR_VERSION == (major) && GNOME_DESKTOP_MINOR_VERSION > (minor)) || \
+ (GNOME_DESKTOP_MAJOR_VERSION == (major) && GNOME_DESKTOP_MINOR_VERSION == (minor) && \
+ GNOME_DESKTOP_MICRO_VERSION >= (micro)))
int gnome_get_platform_version (void);
+
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]