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.

43 lines
1.4 KiB

  1. From b7a9982022ea54d87d310a041c38c6c69b6e49da Mon Sep 17 00:00:00 2001
  2. From: Klaas de Waal <klaas@kldo.nl>
  3. Date: Sun, 17 May 2020 23:00:09 +0200
  4. Subject: [PATCH] Fix declaration and definition of global variables
  5. Definition of global variable httpc now in utils.c with declaration in utils.h.
  6. Definition of global variable source_map now in adapter.c with declaration in adapter.h.
  7. This fixes multiple defined symbol linking errors with linking issue with multiple defined symbols
  8. in Fedora 32 with gcc version 10.1.1 20200507 (Red Hat 10.1.1-1) (GCC)
  9. ---
  10. src/adapter.c | 1 +
  11. src/adapter.h | 2 +-
  12. src/utils.c | 2 ++
  13. src/utils.h | 3 ++-
  14. 4 files changed, 6 insertions(+), 2 deletions(-)
  15. diff --git a/src/utils.c b/src/utils.c
  16. index 8c27954..5be35fd 100644
  17. --- a/src/utils.c
  18. +++ b/src/utils.c
  19. @@ -63,6 +63,8 @@
  20. int MAX_SINFO;
  21. char pn[256];
  22. +Shttp_client *httpc[MAX_HTTPC];
  23. +
  24. typedef struct tmpinfo
  25. {
  26. unsigned char enabled;
  27. diff --git a/src/utils.h b/src/utils.h
  28. index 6ef1831..efcccfa 100644
  29. --- a/src/utils.h
  30. +++ b/src/utils.h
  31. @@ -88,7 +88,8 @@ typedef struct struct_http_client
  32. #define get_httpc(i) ((i >= 0 && i < MAX_HTTPC && httpc[i] && httpc[i]->enabled) ? httpc[i] : NULL)
  33. -Shttp_client *httpc[MAX_HTTPC];
  34. +extern Shttp_client *httpc[MAX_HTTPC];
  35. +
  36. int http_client(char *url, char *request, void *callback, void *opaque);
  37. unsigned char *getItem(uint32_t key);