Преглед изворни кода

libdpkg: Add new DPKG_VERSION_OBJECT macro

Guillem Jover пре 12 година
родитељ
комит
ef88152dc8
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      lib/dpkg/version.h

+ 6 - 0
lib/dpkg/version.h

@@ -48,6 +48,12 @@ struct dpkg_version {
 	const char *revision;
 };
 
+/**
+ * Compound literal for a dpkg_version.
+ */
+#define DPKG_VERSION_OBJECT(e, v, r) \
+	(struct dpkg_version){ .epoch = (e), .version = (v), .revision = (r) }
+
 /**
  * Enum constants for the supported relation operations that can be done
  * on Debian versions.