You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.7 KiB

  1. From dcdd2ae7d6809f45c5f6bbe2ba6fe9c70802bb42 Mon Sep 17 00:00:00 2001
  2. From: Lukas Tribus <luky-37@hotmail.com>
  3. Date: Mon, 12 Sep 2016 21:42:07 +0000
  4. Subject: [PATCH 03/26] MINOR: show Built with PCRE version
  5. Inspired by PCRE's pcre_version.c and improved with Willy's
  6. suggestions. Reusable parts have been added to
  7. include/common/standard.h.
  8. (cherry picked from commit dcbc5c5ecf6506b5ad55b98bbec910b29f011f14)
  9. ---
  10. include/common/standard.h | 9 +++++++++
  11. src/haproxy.c | 3 +++
  12. 2 files changed, 12 insertions(+)
  13. diff --git a/include/common/standard.h b/include/common/standard.h
  14. index 6098550..26a52ff 100644
  15. --- a/include/common/standard.h
  16. +++ b/include/common/standard.h
  17. @@ -1065,4 +1065,13 @@ static inline void *my_realloc2(void *ptr, size_t size)
  18. return ret;
  19. }
  20. +/* HAP_STRING() makes a string from a literal while HAP_XSTRING() first
  21. + * evaluates the argument and is suited to pass macros.
  22. + *
  23. + * They allow macros like PCRE_MAJOR to be defined without quotes, which
  24. + * is convenient for applications that want to test its value.
  25. + */
  26. +#define HAP_STRING(...) #__VA_ARGS__
  27. +#define HAP_XSTRING(...) HAP_STRING(__VA_ARGS__)
  28. +
  29. #endif /* _COMMON_STANDARD_H */
  30. diff --git a/src/haproxy.c b/src/haproxy.c
  31. index 44d32b9..37d700b 100644
  32. --- a/src/haproxy.c
  33. +++ b/src/haproxy.c
  34. @@ -347,6 +347,9 @@ void display_build_opts()
  35. #endif
  36. #ifdef USE_PCRE
  37. + printf("Built with PCRE version : %s\n", (HAP_XSTRING(Z PCRE_PRERELEASE)[1] == 0)?
  38. + HAP_XSTRING(PCRE_MAJOR.PCRE_MINOR PCRE_DATE) :
  39. + HAP_XSTRING(PCRE_MAJOR.PCRE_MINOR) HAP_XSTRING(PCRE_PRERELEASE PCRE_DATE));
  40. printf("Running on PCRE version : %s", pcre_version());
  41. printf("\nPCRE library supports JIT : ");
  42. #ifdef USE_PCRE_JIT
  43. --
  44. 2.7.3