0003-Fix-build-using-WITH_TLS-no-when-the-openssl-headers.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From c25229c13a738af3efeb67724c6ca3dcb91971bd Mon Sep 17 00:00:00 2001
  2. From: "Roger A. Light" <roger@atchoo.org>
  3. Date: Fri, 4 Dec 2020 23:44:38 +0000
  4. Subject: [PATCH] Fix build using WITH_TLS=no when the openssl headers aren't
  5. available.
  6. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  7. ---
  8. ChangeLog.txt | 2 ++
  9. src/password_mosq.c | 10 ++++++----
  10. 2 files changed, 8 insertions(+), 4 deletions(-)
  11. diff --git a/ChangeLog.txt b/ChangeLog.txt
  12. index 030ea8c5..868e3e8a 100644
  13. --- a/ChangeLog.txt
  14. +++ b/ChangeLog.txt
  15. @@ -1,4 +1,6 @@
  16. +Build:
  17. - Fix cjson include paths.
  18. +- Fix build using WITH_TLS=no when the openssl headers aren't available.
  19. 2.0.0 - 2020-12-03
  20. diff --git a/src/password_mosq.c b/src/password_mosq.c
  21. index 73b81976..62e06925 100644
  22. --- a/src/password_mosq.c
  23. +++ b/src/password_mosq.c
  24. @@ -19,10 +19,12 @@ Contributors:
  25. #include "config.h"
  26. #include <errno.h>
  27. -#include <openssl/opensslv.h>
  28. -#include <openssl/evp.h>
  29. -#include <openssl/rand.h>
  30. -#include <openssl/buffer.h>
  31. +#ifdef WITH_TLS
  32. +# include <openssl/opensslv.h>
  33. +# include <openssl/evp.h>
  34. +# include <openssl/rand.h>
  35. +# include <openssl/buffer.h>
  36. +#endif
  37. #include <signal.h>
  38. #include <stdio.h>
  39. #include <stdlib.h>
  40. --
  41. 2.20.1