1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-25 17:57:42 +03:00

lib: use differing NTSTATUS and WERROR struct members

This allows the compiler to catch uses of incorrectly typed arguments
for [NT_STATUS|W_ERROR]_IS_OK() and [NT_STATUS|W_ERROR]_EQUAL(). I.e.

WERROR werr;

werr = my_fn();        /* XXX returns WERROR type */

if (NT_STATUS_EQUAL(werr, NT_STATUS_OBJECT_NAME_COLLISION)) {
This commit is contained in:
David Disseldorp 2012-01-23 12:18:20 -08:00 committed by Jeremy Allison
parent ec094bf9ac
commit af6bf7714d

View File

@ -30,9 +30,9 @@
*/
#if defined(HAVE_IMMEDIATE_STRUCTURES)
typedef struct {uint32_t v;} WERROR;
typedef struct {uint32_t w;} WERROR;
#define W_ERROR(x) ((WERROR) { x })
#define W_ERROR_V(x) ((x).v)
#define W_ERROR_V(x) ((x).w)
#else
typedef uint32_t WERROR;
#define W_ERROR(x) (x)