modbus-version.h.in 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright © 2010 Stéphane Raimbault <stephane.raimbault@gmail.com>
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef _MODBUS_VERSION_H_
  18. #define _MODBUS_VERSION_H_
  19. /* The major version, (1, if %LIBMODBUS_VERSION is 1.2.3) */
  20. #define LIBMODBUS_VERSION_MAJOR (@LIBMODBUS_VERSION_MAJOR@)
  21. /* The minor version (2, if %LIBMODBUS_VERSION is 1.2.3) */
  22. #define LIBMODBUS_VERSION_MINOR (@LIBMODBUS_VERSION_MINOR@)
  23. /* The micro version (3, if %LIBMODBUS_VERSION is 1.2.3) */
  24. #define LIBMODBUS_VERSION_MICRO (@LIBMODBUS_VERSION_MICRO@)
  25. /* The full version, like 1.2.3 */
  26. #define LIBMODBUS_VERSION @LIBMODBUS_VERSION@
  27. /* The full version, in string form (suited for string concatenation)
  28. */
  29. #define LIBMODBUS_VERSION_STRING "@LIBMODBUS_VERSION@"
  30. /* Numerically encoded version, like 0x010203 */
  31. #define LIBMODBUS_VERSION_HEX ((LIBMODBUS_MAJOR_VERSION << 24) | \
  32. (LIBMODBUS_MINOR_VERSION << 16) | \
  33. (LIBMODBUS_MICRO_VERSION << 8))
  34. /* Evaluates to True if the version is greater than @major, @minor and @micro
  35. */
  36. #define LIBMODBUS_VERSION_CHECK(major,minor,micro) \
  37. (LIBMODBUS_VERSION_MAJOR > (major) || \
  38. (LIBMODBUS_VERSION_MAJOR == (major) && \
  39. LIBMODBUS_VERSION_MINOR > (minor)) || \
  40. (LIBMODBUS_VERSION_MAJOR == (major) && \
  41. LIBMODBUS_VERSION_MINOR == (minor) && \
  42. LIBMODBUS_VERSION_MICRO >= (micro)))
  43. #endif /* _MODBUS_VERSION_H_ */