0002-global-h-move-__STRING-macro-outside-PIC-ifdef-block.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 10bd599970acc71c92f85eb08943eb8d3d702a9c Mon Sep 17 00:00:00 2001
  2. From: Jaroslav Kysela <perex@perex.cz>
  3. Date: Wed, 6 Sep 2023 15:16:44 +0200
  4. Subject: [PATCH] global.h: move __STRING() macro outside !PIC ifdef block
  5. It solves the musl libc compilation issue.
  6. control.c: In function 'snd_ctl_open_conf':
  7. ../../include/global.h:98:36: warning: implicit declaration of function '__STRING' [-Wimplicit-function-declaratio]
  8. 98 | #define SND_DLSYM_VERSION(version) __STRING(version)
  9. | ^~~~~~~~
  10. Fixes: https://github.com/alsa-project/alsa-lib/issues/350
  11. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  12. Upstream: https://github.com/alsa-project/alsa-lib/commit/10bd599970acc71c92f85eb08943eb8d3d702a9c
  13. Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
  14. ---
  15. include/global.h | 10 +++++-----
  16. 1 file changed, 5 insertions(+), 5 deletions(-)
  17. diff --git a/include/global.h b/include/global.h
  18. index dfe9bc2b..3ecaeee8 100644
  19. --- a/include/global.h
  20. +++ b/include/global.h
  21. @@ -51,6 +51,11 @@ const char *snd_asoundlib_version(void);
  22. #define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
  23. #endif
  24. +#ifndef __STRING
  25. +/** \brief Return 'x' argument as string */
  26. +#define __STRING(x) #x
  27. +#endif
  28. +
  29. #ifdef PIC /* dynamic build */
  30. /** \hideinitializer \brief Helper macro for #SND_DLSYM_BUILD_VERSION. */
  31. @@ -71,11 +76,6 @@ struct snd_dlsym_link {
  32. extern struct snd_dlsym_link *snd_dlsym_start;
  33. -#ifndef __STRING
  34. -/** \brief Return 'x' argument as string */
  35. -#define __STRING(x) #x
  36. -#endif
  37. -
  38. /** \hideinitializer \brief Helper macro for #SND_DLSYM_BUILD_VERSION. */
  39. #define __SND_DLSYM_VERSION(prefix, name, version) _ ## prefix ## name ## version
  40. /**