[json-glib] Reimplement JSON_VERSION_HEX as a macro call
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [json-glib] Reimplement JSON_VERSION_HEX as a macro call
- Date: Tue, 18 Mar 2014 18:20:50 +0000 (UTC)
commit d3095c5f8fe91209cc98e1e2d7e75a8aad1e8d88
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Mar 6 15:09:04 2014 +0000
Reimplement JSON_VERSION_HEX as a macro call
Add a JSON_ENCODE_VERSION macro and use it in JSON_VERSION_HEX.
doc/reference/json-glib-sections.txt | 1 +
json-glib/json-version.h.in | 12 +++++++-----
2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/doc/reference/json-glib-sections.txt b/doc/reference/json-glib-sections.txt
index 83c8087..89c1120 100644
--- a/doc/reference/json-glib-sections.txt
+++ b/doc/reference/json-glib-sections.txt
@@ -306,6 +306,7 @@ JSON_DEPRECATED_IN_1_0
JSON_DEPRECATED_IN_1_0_FOR
<SUBSECTION Private>
+JSON_ENCODE_VERSION
JSON_DEPRECATED
JSON_DEPRECATED_FOR
JSON_UNAVAILABLE
diff --git a/json-glib/json-version.h.in b/json-glib/json-version.h.in
index c46ff49..d18caa2 100644
--- a/json-glib/json-version.h.in
+++ b/json-glib/json-version.h.in
@@ -67,20 +67,22 @@
/**
* JSON_VERSION_S:
*
- * Json version, encoded as a string, useful for printing and
+ * JSON-GLib version, encoded as a string, useful for printing and
* concatenation.
*/
#define JSON_VERSION_S "@JSON_VERSION@"
+#define JSON_ENCODE_VERSION(major,minor,micro) \
+ ((major) << 24 | (minor) << 16 | (micro) << 8)
+
/**
* JSON_VERSION_HEX:
*
- * Json version, encoded as an hexadecimal number, useful for
+ * JSON-GLib version, encoded as an hexadecimal number, useful for
* integer comparisons.
*/
-#define JSON_VERSION_HEX (JSON_MAJOR_VERSION << 24 | \
- JSON_MINOR_VERSION << 16 | \
- JSON_MICRO_VERSION << 8)
+#define JSON_VERSION_HEX \
+ (JSON_ENCODE_VERSION (JSON_MAJOR_VERSION, JSON_MINOR_VERSION, JSON_MICRO_VERSION))
/**
* JSON_CHECK_VERSION:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]