Permalink
Browse files

Fix wrong constant names to create version number

Thanks to Denis Davydov
  • Loading branch information...
1 parent ce0bdfb commit e07924b54e1afc330db906d9c1806e021546e07d @stephane committed Jul 24, 2012
Showing with 4 additions and 4 deletions.
  1. +3 −3 src/modbus-version.h.in
  2. +1 −1 tests/version.c
View
@@ -35,9 +35,9 @@
#define LIBMODBUS_VERSION_STRING "@LIBMODBUS_VERSION@"
/* Numerically encoded version, like 0x010203 */
-#define LIBMODBUS_VERSION_HEX ((LIBMODBUS_MAJOR_VERSION << 24) | \
- (LIBMODBUS_MINOR_VERSION << 16) | \
- (LIBMODBUS_MICRO_VERSION << 8))
+#define LIBMODBUS_VERSION_HEX ((LIBMODBUS_VERSION_MAJOR << 24) | \
+ (LIBMODBUS_VERSION_MINOR << 16) | \
+ (LIBMODBUS_VERSION_MICRO << 8))
/* Evaluates to True if the version is greater than @major, @minor and @micro
*/
View
@@ -20,7 +20,7 @@
int main(void)
{
- printf("Compiled with libmodbus version %s\n", LIBMODBUS_VERSION_STRING);
+ printf("Compiled with libmodbus version %s (%08X)\n", LIBMODBUS_VERSION_STRING, LIBMODBUS_VERSION_HEX);
printf("Linked with libmodbus version %d.%d.%d\n",
libmodbus_version_major, libmodbus_version_minor, libmodbus_version_micro);

0 comments on commit e07924b

Please sign in to comment.