0002-zbarcam-zbar-cam-img-.c-fix-build-with-musl.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From ecf90fcff066c06eda1fb931d08fadf5989ecb36 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sat, 29 Aug 2020 14:23:04 +0200
  4. Subject: [PATCH] zbarcam/zbar{cam,img}.c: fix build with musl
  5. setlocale is used since version 0.23.1 and
  6. https://git.linuxtv.org/zbar.git/commit/id=d05911f8d5fb8c1e064bd93ed9ec9f038c5da096
  7. Include locale.h to avoid the following build failure on musl:
  8. zbarcam/zbarcam.c:168:5: warning: implicit declaration of function 'setlocale'; did you mean 'setstate'? [-Wimplicit-function-declaration]
  9. setlocale (LC_ALL, "");
  10. ^~~~~~~~~
  11. setstate
  12. zbarcam/zbarcam.c:168:16: error: 'LC_ALL' undeclared (first use in this function)
  13. setlocale (LC_ALL, "");
  14. ^~~~~~
  15. Fixes:
  16. - http://autobuild.buildroot.org/results/b93ce5430bf22ddda94ee30882a883348617f5b1
  17. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  18. [Upstream status: https://github.com/mchehab/zbar/pull/115]
  19. ---
  20. zbarcam/zbarcam.c | 1 +
  21. zbarimg/zbarimg.c | 1 +
  22. 2 files changed, 2 insertions(+)
  23. diff --git a/zbarcam/zbarcam.c b/zbarcam/zbarcam.c
  24. index 6e13c8c..b8bc732 100644
  25. --- a/zbarcam/zbarcam.c
  26. +++ b/zbarcam/zbarcam.c
  27. @@ -36,6 +36,7 @@
  28. #ifdef ENABLE_NLS
  29. # include <libintl.h>
  30. +# include <locale.h>
  31. # define _(string) gettext(string)
  32. #else
  33. # define _(string) string
  34. diff --git a/zbarimg/zbarimg.c b/zbarimg/zbarimg.c
  35. index d05d832..52502b2 100644
  36. --- a/zbarimg/zbarimg.c
  37. +++ b/zbarimg/zbarimg.c
  38. @@ -41,6 +41,7 @@
  39. #ifdef ENABLE_NLS
  40. # include <libintl.h>
  41. +# include <locale.h>
  42. # define _(string) gettext(string)
  43. #else
  44. # define _(string) string
  45. --
  46. 2.28.0