Explorar o código

libdpkg: Add new DPKG_VERSION_OBJECT macro

Guillem Jover %!s(int64=12) %!d(string=hai) anos
pai
achega
ef88152dc8
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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.