From 0cd80f9869feef92261d0972f3d2d018a3dcfb18 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Mon, 10 Sep 2007 20:45:58 -0700 Subject: Ready 12.4.2 release. To allow for easier detection of driver version by other VMware tools, we are embedding the version in a .modinfo section so that the Linux kernel 'modinfo' tool can be (ab)used to check it. --- src/vmmouse.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/vmmouse.c') diff --git a/src/vmmouse.c b/src/vmmouse.c index 2c2683b..af24848 100644 --- a/src/vmmouse.c +++ b/src/vmmouse.c @@ -76,12 +76,33 @@ ****************************************************************************/ #include "vmmouse_client.h" +/* + * This is the only way I know to turn a #define of an integer constant into + * a constant string. + */ +#define VMW_INNERSTRINGIFY(s) #s +#define VMW_STRING(str) VMW_INNERSTRINGIFY(str) + /* * Version constants */ #define VMMOUSE_MAJOR_VERSION 12 #define VMMOUSE_MINOR_VERSION 4 -#define VMMOUSE_PATCHLEVEL 0 +#define VMMOUSE_PATCHLEVEL 2 +#define VMMOUSE_DRIVER_VERSION \ + (VMMOUSE_MAJOR_VERSION * 65536 + VMMOUSE_MINOR_VERSION * 256 + VMMOUSE_PATCHLEVEL) +#define VMMOUSE_DRIVER_VERSION_STRING \ + VMW_STRING(VMMOUSE_MAJOR_VERSION) "." VMW_STRING(VMMOUSE_MINOR_VERSION) \ + "." VMW_STRING(VMMOUSE_PATCHLEVEL) + +/* + * Standard four digit version string expected by VMware Tools installer. + * As the driver's version is only {major, minor, patchlevel}, simply append an + * extra zero for the fourth digit. + */ +const char vm_version[] __attribute__((section(".modinfo"),unused)) = + "version=" VMMOUSE_DRIVER_VERSION_STRING ".0"; + /***************************************************************************** * static function header -- cgit v1.2.3