From cf8f94f38bcfaaff9577439f35f0716054856c1f Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Fri, 17 Feb 2017 14:48:48 +0100 Subject: [PATCH] Lib: fix mingw build for older versions of mingw This define was introduced to winternl.h on 2012-07-12 but I couldn't find out which version that corresponds to. At least version 2.0.1-1 of mingw-w64-dev in Ubuntu 12.04 LTS does not define it. --- lib/diagnostics_win.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/diagnostics_win.h b/lib/diagnostics_win.h index a6f6a5fc2e..2e5234f69b 100644 --- a/lib/diagnostics_win.h +++ b/lib/diagnostics_win.h @@ -150,4 +150,11 @@ typedef enum _THREAD_WAIT_REASON { } THREAD_WAIT_REASON; #endif +// older mingw versions (before 2012-07-12) do not define this in winternl.h +#if defined(__MINGW32__) +#ifndef NT_SUCCESS +#define NT_SUCCESS(status) ((NTSTATUS) (status) >= 0) +#endif +#endif + #endif