[pacman-dev] [PATCH 1/1] libalpm: add version information to alpm.h
From: Christian Hesse <mail@eworm.de> Programs linked against libalpm (for example packagekit) may want to use preprocessor macros to check version and choose correct API. This adds version information to alpm.h. Signed-off-by: Christian Hesse <mail@eworm.de> --- lib/libalpm/alpm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 91b9461..e3f6e67 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -23,6 +23,14 @@ #ifndef _ALPM_H #define _ALPM_H +#define ALPM_VERSION "9.0.0" + +#define ALPM_VERSION_MAJOR 9 +#define ALPM_VERSION_MINOR 0 +#define ALPM_VERSION_PATCH 0 + +#define ALPM_VERSION_NUMBER 0x090000 + #ifdef __cplusplus extern "C" { #endif -- 2.2.1
On Sun, Dec 28, 2014 at 08:45:38PM +0100, Christian Hesse wrote:
From: Christian Hesse <mail@eworm.de>
Programs linked against libalpm (for example packagekit) may want to use preprocessor macros to check version and choose correct API. This adds version information to alpm.h.
Signed-off-by: Christian Hesse <mail@eworm.de> --- lib/libalpm/alpm.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 91b9461..e3f6e67 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -23,6 +23,14 @@ #ifndef _ALPM_H #define _ALPM_H
+#define ALPM_VERSION "9.0.0" + +#define ALPM_VERSION_MAJOR 9 +#define ALPM_VERSION_MINOR 0 +#define ALPM_VERSION_PATCH 0 + +#define ALPM_VERSION_NUMBER 0x090000 +
+1 for the idea, -1 for the implementation. This should be generated from constants defined nearby the actual versioning of the library. Otherwise, someone will forget to bump this.
#ifdef __cplusplus extern "C" { #endif -- 2.2.1
On 29/12/14 06:24, Dave Reisner wrote:
On Sun, Dec 28, 2014 at 08:45:38PM +0100, Christian Hesse wrote:
From: Christian Hesse <mail@eworm.de>
Programs linked against libalpm (for example packagekit) may want to use preprocessor macros to check version and choose correct API. This adds version information to alpm.h.
Signed-off-by: Christian Hesse <mail@eworm.de> --- lib/libalpm/alpm.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 91b9461..e3f6e67 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -23,6 +23,14 @@ #ifndef _ALPM_H #define _ALPM_H
+#define ALPM_VERSION "9.0.0" + +#define ALPM_VERSION_MAJOR 9 +#define ALPM_VERSION_MINOR 0 +#define ALPM_VERSION_PATCH 0 + +#define ALPM_VERSION_NUMBER 0x090000 +
+1 for the idea, -1 for the implementation. This should be generated from constants defined nearby the actual versioning of the library. Otherwise, someone will forget to bump this.
You can probably have configure update these via a sed. So anytime the values are updated for release, a configure will adjust them in the header. Allan
Dave Reisner <d@falconindy.com> on Sun, 2014/12/28 15:24:
On Sun, Dec 28, 2014 at 08:45:38PM +0100, Christian Hesse wrote:
From: Christian Hesse <mail@eworm.de>
Programs linked against libalpm (for example packagekit) may want to use preprocessor macros to check version and choose correct API. This adds version information to alpm.h.
Signed-off-by: Christian Hesse <mail@eworm.de> --- lib/libalpm/alpm.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 91b9461..e3f6e67 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -23,6 +23,14 @@ #ifndef _ALPM_H #define _ALPM_H
+#define ALPM_VERSION "9.0.0" + +#define ALPM_VERSION_MAJOR 9 +#define ALPM_VERSION_MINOR 0 +#define ALPM_VERSION_PATCH 0 + +#define ALPM_VERSION_NUMBER 0x090000 +
+1 for the idea, -1 for the implementation. This should be generated from constants defined nearby the actual versioning of the library. Otherwise, someone will forget to bump this.
Agreed. ;) I just wanted some feedback whether or not it is worth looking into. -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Chris get my mail address: */=0;b=c[a++];) putchar(b-1/(/* gcc -o sig sig.c && ./sig */b/42*2-3)*42);}
participants (3)
-
Allan McRae
-
Christian Hesse
-
Dave Reisner