logo

oasis

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

0003-Use-_Static_assert-instead-of-asm-for-empty-declarat.patch (1512B)


  1. From 20e0b159b36aabcdd7b33c07f8a20b4dd9c2a25f Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Thu, 2 Apr 2026 23:45:13 -0700
  4. Subject: [PATCH] Use _Static_assert instead of asm("") for empty declaration
  5. Also, use the same technique for LCRYPTO_USED.
  6. ---
  7. crypto/hidden/crypto_namespace.h | 6 +++---
  8. ssl/hidden/ssl_namespace.h | 4 ++--
  9. 2 files changed, 5 insertions(+), 5 deletions(-)
  10. diff --git a/crypto/hidden/crypto_namespace.h b/crypto/hidden/crypto_namespace.h
  11. index 43c8718..4ad8ce0 100644
  12. --- a/crypto/hidden/crypto_namespace.h
  13. +++ b/crypto/hidden/crypto_namespace.h
  14. @@ -42,13 +42,13 @@
  15. # define LCRYPTO_USED(x) typeof(x) x asm("_libre_"#x)
  16. #endif
  17. #else
  18. -# define LCRYPTO_UNUSED(x)
  19. -# define LCRYPTO_USED(x)
  20. +# define LCRYPTO_UNUSED(x) _Static_assert(1, "")
  21. +# define LCRYPTO_USED(x) _Static_assert(1, "")
  22. # define LCRYPTO_ALIAS1(pre,x)
  23. #ifdef _MSC_VER
  24. # define LCRYPTO_ALIAS(x)
  25. #else
  26. -# define LCRYPTO_ALIAS(x) asm("")
  27. +# define LCRYPTO_ALIAS(x) _Static_assert(1, "")
  28. #endif /* _MSC_VER */
  29. #endif
  30. diff --git a/ssl/hidden/ssl_namespace.h b/ssl/hidden/ssl_namespace.h
  31. index 763dcd7..d48c95e 100644
  32. --- a/ssl/hidden/ssl_namespace.h
  33. +++ b/ssl/hidden/ssl_namespace.h
  34. @@ -34,11 +34,11 @@
  35. #endif
  36. #else
  37. #define LSSL_UNUSED(x)
  38. -#define LSSL_USED(x)
  39. +#define LSSL_USED(x) _Static_assert(1, "")
  40. #ifdef _MSC_VER
  41. #define LSSL_ALIAS(x)
  42. #else
  43. -#define LSSL_ALIAS(x) asm("")
  44. +#define LSSL_ALIAS(x) _Static_assert(1, "")
  45. #endif /* _MSC_VER */
  46. #endif
  47. --
  48. 2.49.0