/dev-lang/ghc/files/ghc-8.2.1_rc1-win32-cross-1.patch

https://gitlab.com/argent/portage · Patch · 124 lines · 103 code · 21 blank · 0 comment · 0 complexity · a2d6c344857edfbf472057f9cc80f342 MD5 · raw file

  1. commit a691f6a7a191a268380805481d8e63134764a4a1
  2. Author: Sergei Trofimovich <slyfox@inbox.ru>
  3. Date: Sat Apr 29 22:02:24 2017 +0100
  4. add basic cross-compilation support (#87)
  5. * fix include case: s/#include <Lmcons.h>/#include <lmcons.h>
  6. Noticed when cross-compiling win32 on linux to i686-w64-mingw32-gcc.
  7. i686-w64-mingw32 provides all headers in lowercase.
  8. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  9. * Pen.hsc: don't use c99-style comments in enum declarations
  10. Ths change workarounds hsc2hs bug in cross-compile mode:
  11. https://ghc.haskell.org/trac/ghc/ticket/13619
  12. To reproduce the build failure it's enough to run
  13. $ cabal configure --hsc2hs-options='--cross-safe --cross-compile'
  14. $ cabal build --hsc2hs-options='--cross-safe --cross-compile'
  15. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  16. * SimpleMAPI.hsc: don't use #ifdef in enum declarations
  17. This change workarounds hsc2hs bug in cross-compile mode:
  18. https://ghc.haskell.org/trac/ghc/ticket/13620
  19. To reproduce the build failure it's enough to run
  20. $ cabal configure --hsc2hs-options='--cross-safe --cross-compile'
  21. $ cabal build --hsc2hs-options='--cross-safe --cross-compile'
  22. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  23. diff --git a/Graphics/Win32/GDI/Pen.hsc b/Graphics/Win32/GDI/Pen.hsc
  24. index c880170..8d8df5d 100644
  25. --- a/Graphics/Win32/GDI/Pen.hsc
  26. +++ b/Graphics/Win32/GDI/Pen.hsc
  27. @@ -56,7 +56,7 @@ foreign import WINDOWS_CCONV unsafe "windows.h DeleteObject"
  28. type PenStyle = INT
  29. -#{enum PenStyle, // Pick one of these
  30. +#{enum PenStyle,
  31. , pS_SOLID = PS_SOLID // default
  32. , pS_DASH = PS_DASH // -------
  33. , pS_DOT = PS_DOT // .......
  34. @@ -69,14 +69,14 @@ type PenStyle = INT
  35. , pS_STYLE_MASK = PS_STYLE_MASK // all the above
  36. }
  37. -#{enum PenStyle , // "or" with one of these
  38. +#{enum PenStyle,
  39. , pS_ENDCAP_ROUND = PS_ENDCAP_ROUND // default
  40. , pS_ENDCAP_SQUARE = PS_ENDCAP_SQUARE
  41. , pS_ENDCAP_FLAT = PS_ENDCAP_FLAT
  42. , pS_ENDCAP_MASK = PS_ENDCAP_MASK // all the above
  43. }
  44. -#{enum PenStyle, // "or" with one of these
  45. +#{enum PenStyle,
  46. , pS_JOIN_ROUND = PS_JOIN_ROUND // default
  47. , pS_JOIN_BEVEL = PS_JOIN_BEVEL
  48. , pS_JOIN_MITER = PS_JOIN_MITER
  49. @@ -87,7 +87,7 @@ If PS_JOIN_MASK is not defined with your GNU Windows32 header files,
  50. you'll have to define it.
  51. -}
  52. -#{enum PenStyle, // "or" with one of these
  53. +#{enum PenStyle,
  54. , pS_COSMETIC = PS_COSMETIC // default
  55. , pS_GEOMETRIC = PS_GEOMETRIC
  56. , pS_TYPE_MASK = PS_TYPE_MASK // all the above
  57. diff --git a/System/Win32/Info/Computer.hsc b/System/Win32/Info/Computer.hsc
  58. index bb2eb72..65ae8dc 100644
  59. --- a/System/Win32/Info/Computer.hsc
  60. +++ b/System/Win32/Info/Computer.hsc
  61. @@ -65,7 +65,7 @@ import System.Win32.Utils ( tryWithoutNull )
  62. import System.Win32.Word ( DWORD, LPDWORD )
  63. #include <windows.h>
  64. -#include <Lmcons.h>
  65. +#include <lmcons.h>
  66. #include "alignment.h"
  67. ##include "windows_cconv.h"
  68. diff --git a/System/Win32/SimpleMAPI.hsc b/System/Win32/SimpleMAPI.hsc
  69. index 9727cfc..5ebf06b 100644
  70. --- a/System/Win32/SimpleMAPI.hsc
  71. +++ b/System/Win32/SimpleMAPI.hsc
  72. @@ -53,12 +53,6 @@ type MapiFlag = ULONG
  73. , mAPI_LOGON_UI = MAPI_LOGON_UI
  74. , mAPI_NEW_SESSION = MAPI_NEW_SESSION
  75. , mAPI_FORCE_DOWNLOAD = MAPI_FORCE_DOWNLOAD
  76. -#ifdef MAPI_LOGOFF_SHARED
  77. - , mAPI_LOGOFF_SHARED = MAPI_LOGOFF_SHARED
  78. -#endif
  79. -#ifdef MAPI_LOGOFF_UI
  80. - , mAPI_LOGOFF_UI = MAPI_LOGOFF_UI
  81. -#endif
  82. , mAPI_DIALOG = MAPI_DIALOG
  83. , mAPI_UNREAD_ONLY = MAPI_UNREAD_ONLY
  84. , mAPI_LONG_MSGID = MAPI_LONG_MSGID
  85. @@ -74,6 +68,19 @@ type MapiFlag = ULONG
  86. , mAPI_RECEIPT_REQUESTED = MAPI_RECEIPT_REQUESTED
  87. , mAPI_SENT = MAPI_SENT
  88. }
  89. +-- Have to define enum values outside previous declaration due to
  90. +-- hsc2hs bug in --cross-compile mode:
  91. +-- https://ghc.haskell.org/trac/ghc/ticket/13620
  92. +#ifdef MAPI_LOGOFF_SHARED
  93. +#{enum MapiFlag,
  94. + , mAPI_LOGOFF_SHARED = MAPI_LOGOFF_SHARED
  95. +}
  96. +#endif
  97. +#ifdef MAPI_LOGOFF_UI
  98. +#{enum MapiFlag,
  99. + , mAPI_LOGOFF_UI = MAPI_LOGOFF_UI
  100. +}
  101. +#endif
  102. mapiErrors :: [(ULONG,String)]
  103. mapiErrors =