source/include/nt_status.h: add macro W_ERROR_NOT_OK_GOTO(x, y)
authorMichael Adam <obnox@samba.org>
Wed, 25 Feb 2009 15:55:28 +0000 (16:55 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 19 Mar 2009 17:03:59 +0000 (18:03 +0100)
a goto destination can be specified as a second parameter.

Michael

Signed-off-by: Michael Adam <obnox@samba.org>
source/include/nt_status.h

index bf35d913f2365e57f30673d86c3abdb3596ca69a..c96ed3cfd7b252612962acb0301e5c91bccdf452 100644 (file)
@@ -89,6 +89,12 @@ typedef uint32 WERROR;
        }\
 } while (0)
 
+#define W_ERROR_NOT_OK_GOTO(x, y) do {\
+       if (!W_ERROR_IS_OK(x)) {\
+               goto y;\
+       }\
+} while(0)
+
 /* The top byte in an NTSTATUS code is used as a type field.
  * Windows only uses value 0xC0 as an indicator for an NT error
  * and 0x00 for success.