Blame view

stack/modbus-version.h 1.19 KB
b85a3e4a   Peter M. Groen   Setting up workin...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  #pragma once 
  
  /* The major version, (1, if %LIBMODBUS_VERSION is 1.2.3) */
  #define LIBMODBUS_VERSION_MAJOR (3)
  
  /* The minor version (2, if %LIBMODBUS_VERSION is 1.2.3) */
  #define LIBMODBUS_VERSION_MINOR (1)
  
  /* The micro version (3, if %LIBMODBUS_VERSION is 1.2.3) */
  #define LIBMODBUS_VERSION_MICRO (4)
  
  /* The full version, like 1.2.3 */
  #define LIBMODBUS_VERSION        3.1.4
  
  /* The full version, in string form (suited for string concatenation)
   */
  #define LIBMODBUS_VERSION_STRING "3.1.4"
  
  /* Numerically encoded version, like 0x010203 */
  #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
   */
  #define LIBMODBUS_VERSION_CHECK(major,minor,micro)      \
      (LIBMODBUS_VERSION_MAJOR > (major) ||               \
       (LIBMODBUS_VERSION_MAJOR == (major) &&             \
        LIBMODBUS_VERSION_MINOR > (minor)) ||             \
       (LIBMODBUS_VERSION_MAJOR == (major) &&             \
        LIBMODBUS_VERSION_MINOR == (minor) &&             \
        LIBMODBUS_VERSION_MICRO >= (micro)))