logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0007-Prevent-unused-definitions-in-some-configurations.patch (2243B)


  1. From 4a4b059a25abbcbfeb8593cdeb3098c2bd19011a Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sat, 16 Mar 2024 20:02:10 -0700
  4. Subject: [PATCH] Prevent unused definitions in some configurations
  5. ---
  6. src/dlmisc.c | 12 ++++++------
  7. src/pcm/pcm_rate.c | 2 ++
  8. 2 files changed, 8 insertions(+), 6 deletions(-)
  9. diff --git a/src/dlmisc.c b/src/dlmisc.c
  10. index 96784197..a1ab77c2 100644
  11. --- a/src/dlmisc.c
  12. +++ b/src/dlmisc.c
  13. @@ -196,6 +196,8 @@ int snd_dlclose(void *handle)
  14. #endif
  15. }
  16. +#ifdef HAVE_LIBDL
  17. +#ifdef VERSIONED_SYMBOLS
  18. /**
  19. * \brief Verifies a dynamically loaded symbol.
  20. * \param handle Library handle, similar to \c dlsym.
  21. @@ -208,7 +210,6 @@ int snd_dlclose(void *handle)
  22. */
  23. static int snd_dlsym_verify(void *handle, const char *name, const char *version)
  24. {
  25. -#ifdef HAVE_LIBDL
  26. int res;
  27. char *vname;
  28. @@ -225,10 +226,9 @@ static int snd_dlsym_verify(void *handle, const char *name, const char *version)
  29. if (res < 0)
  30. SNDERR("unable to verify version for symbol %s", name);
  31. return res;
  32. -#else
  33. - return 0;
  34. -#endif
  35. }
  36. +#endif
  37. +#endif
  38. /**
  39. * \brief Resolves a symbol from a dynamic library - ALSA wrapper for \c dlsym.
  40. @@ -245,8 +245,6 @@ static int snd_dlsym_verify(void *handle, const char *name, const char *version)
  41. */
  42. void *snd_dlsym(void *handle, const char *name, const char *version)
  43. {
  44. - int err;
  45. -
  46. #ifndef PIC
  47. if (handle == &snd_dlsym_start) {
  48. /* it's the funny part: */
  49. @@ -262,6 +260,8 @@ void *snd_dlsym(void *handle, const char *name, const char *version)
  50. #endif
  51. #ifdef HAVE_LIBDL
  52. #ifdef VERSIONED_SYMBOLS
  53. + int err;
  54. +
  55. if (version) {
  56. err = snd_dlsym_verify(handle, name, version);
  57. if (err < 0)
  58. diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
  59. index 5f0cc774..509b1b14 100644
  60. --- a/src/pcm/pcm_rate.c
  61. +++ b/src/pcm/pcm_rate.c
  62. @@ -1453,6 +1453,7 @@ static int rate_open_func(snd_pcm_rate_t *rate, const char *type, const snd_conf
  63. }
  64. #endif
  65. +#ifdef PIC
  66. /*
  67. * If the conf is an array of alternatives then the id of
  68. * the first element will be "0" (or maybe NULL). Otherwise assume it is
  69. @@ -1477,6 +1478,7 @@ static int is_string_array(const snd_config_t *conf)
  70. return 1;
  71. }
  72. +#endif
  73. /**
  74. * \brief Creates a new rate PCM
  75. --
  76. 2.44.0