| 1 |
#ifndef _ANSI_TERMINAL_ERRORS_H |
| 2 |
#define _ANSI_TERMINAL_ERRORS_H |
| 3 |
|
| 4 |
#include <windows.h> |
| 5 |
|
| 6 |
/* Copied from the Win32-2.13.4.0 package, but renamed `getErrorMessage` to |
| 7 |
* `_ansi_terminal_getErrorMessage`, in order to avoid problems with duplicate |
| 8 |
* symbols in GHC's object files. See: |
| 9 |
* https://gitlab.haskell.org/ghc/ghc/-/issues/23365. |
| 10 |
*/ |
| 11 |
|
| 12 |
/* There's two ways we can generate error messages - with different tradeoffs: |
| 13 |
* If we do a function call, we have to use a static buffer. |
| 14 |
* If we use a macro and ANSI C's string splicing, we have to use constant |
| 15 |
* strings - and accept a certain amount of overhead from inserting the |
| 16 |
* boilerplate text. |
| 17 |
*/ |
| 18 |
|
| 19 |
/* result should be freed using LocalFree */ |
| 20 |
extern LPTSTR _ansi_terminal_getErrorMessage(DWORD err); |
| 21 |
|
| 22 |
#endif /* _ANSI_TERMINAL_ERRORS_H */ |