mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r4607: add some usefull macros to make the code more readable
metze
(This used to be commit 62c45635ff
)
This commit is contained in:
parent
fd254e01b6
commit
e0b0d934ec
@ -64,6 +64,30 @@ typedef uint32_t WERROR;
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
#define NT_STATUS_IS_OK_RETURN(x) do { \
|
||||
if (NT_STATUS_IS_OK(x)) {\
|
||||
return x;\
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
#define NT_STATUS_NOT_OK_RETURN(x) do { \
|
||||
if (!NT_STATUS_IS_OK(x)) {\
|
||||
return x;\
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
#define NT_STATUS_IS_ERR_RETURN(x) do { \
|
||||
if (NT_STATUS_IS_ERR(x)) {\
|
||||
return x;\
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
#define NT_STATUS_NOT_ERR_RETURN(x) do { \
|
||||
if (!NT_STATUS_IS_ERR(x)) {\
|
||||
return x;\
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
#define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0)
|
||||
#define W_ERROR_EQUAL(x,y) (W_ERROR_V(x) == W_ERROR_V(y))
|
||||
|
||||
@ -73,6 +97,18 @@ typedef uint32_t WERROR;
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
#define W_ERROR_IS_OK_RETURN(x) do { \
|
||||
if (W_ERROR_IS_OK(x)) {\
|
||||
return x;\
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
#define W_ERROR_NOT_OK_RETURN(x) do { \
|
||||
if (!W_ERROR_IS_OK(x)) {\
|
||||
return x;\
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
/* this defines special NTSTATUS codes to represent DOS errors. I
|
||||
have chosen this macro to produce status codes in the invalid
|
||||
NTSTATUS range */
|
||||
|
Loading…
Reference in New Issue
Block a user