0001-Fix-gcc_struct-attribute-directive-ignored-warnings.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From d9c517d9a4e168c1f7ed28ad0eb9365d69f5ceb2 Mon Sep 17 00:00:00 2001
  2. From: Rodrigo Rebello <rprebello@gmail.com>
  3. Date: Thu, 22 Oct 2015 11:29:55 -0200
  4. Subject: [PATCH] Fix "`gcc_struct' attribute directive ignored" warnings
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Compilation for target architectures other than i386, x86_64 or PowerPC
  9. (e.g. ARM) caused multiple warnings like the following to appear:
  10. doomdata.h:75:1: warning: ‘gcc_struct’ attribute directive ignored
  11. } PACKEDATTR mapsidedef_t;
  12. ^
  13. This was due to 'gcc_struct' being undefined for these architectures.
  14. Since that attribute was actually introduced by commit 87db726b9a9ae61ca
  15. to address the fact that -mms-bitfields became the default for GCC on
  16. Windows, limit it to that case.
  17. Upstream-status: accepted, not yet released.
  18. https://github.com/chocolate-doom/chocolate-doom/pull/629
  19. Signed-off-by: Rodrigo Rebello <rprebello@gmail.com>
  20. ---
  21. src/doomtype.h | 6 +++---
  22. 1 file changed, 3 insertions(+), 3 deletions(-)
  23. diff --git a/src/doomtype.h b/src/doomtype.h
  24. index bf0a40e..77c026c 100644
  25. --- a/src/doomtype.h
  26. +++ b/src/doomtype.h
  27. @@ -52,10 +52,10 @@
  28. #ifdef __GNUC__
  29. -#ifdef __clang__
  30. -#define PACKEDATTR __attribute__((packed))
  31. -#else
  32. +#if defined(_WIN32) && !defined(__clang__)
  33. #define PACKEDATTR __attribute__((packed,gcc_struct))
  34. +#else
  35. +#define PACKEDATTR __attribute__((packed))
  36. #endif
  37. #else
  38. --
  39. 2.1.4