packages feed

ansi-terminal 1.0.1 → 1.0.2

raw patch · 4 files changed

+17/−6 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,6 +1,11 @@ Changes
 =======
 
+Version 1.0.2
+-------------
+
+* On Windows, fix linker error about a duplicate symbol `castUINTPtrToPtr`.
+
 Version 1.0.1
 -------------
 
ansi-terminal.cabal view
@@ -1,6 +1,6 @@ Cabal-Version:       1.22
 Name:                ansi-terminal
-Version:             1.0.1
+Version:             1.0.2
 Category:            User Interfaces
 Synopsis:            Simple ANSI terminal support
 Description:         ANSI terminal support for Haskell: allows cursor movement,
win/System/Console/ANSI/Windows/Foreign.hs view
@@ -476,7 +476,7 @@ nullHANDLE :: HANDLE
 nullHANDLE = nullPtr
 
-foreign import ccall unsafe "HsWin32.h"
+foreign import ccall unsafe "HsWin32.h _ansi_terminal_castUINTPtrToPtr"
   castUINTPtrToPtr :: UINT_PTR -> Ptr a
 
 foreign import ccall unsafe "windows.h GetConsoleMode"
win/include/HsWin32.h view
@@ -1,9 +1,15 @@-#ifndef __HSWIN32_H
-#define __HSWIN32_H
+#ifndef _ANSI_TERMINAL_HSWIN32_H
+#define _ANSI_TERMINAL_HSWIN32_H
 
 #define UNICODE
 #include <windows.h>
 
+/* Copied from the Win32-2.13.4.0 package, but renamed `castUINTPtrToPtr` to
+ * `_ansi_terminal_castUINTPtrToPtr`, in order to avoid problems with duplicate
+ * symbols in GHC's object files. See:
+ * https://gitlab.haskell.org/ghc/ghc/-/issues/23365.
+ */
+
 #ifndef INLINE
 # if defined(_MSC_VER)
 #  define INLINE extern __inline
@@ -12,6 +18,6 @@ # endif
 #endif
 
-INLINE void *castUINTPtrToPtr(UINT_PTR n) { return (void *)n; }
+INLINE void *_ansi_terminal_castUINTPtrToPtr(UINT_PTR n) { return (void *)n; }
 
-#endif /* __HSWIN32_H */
+#endif /* _ANSI_TERMINAL_HSWIN32_H */