From 644cd0ae174e439b38be883473e4f9e11b098f58 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Mon, 12 Dec 2011 23:53:07 +0100 Subject: [PATCH] include: Add a missing wincrypt.h include directive to mprapi.h. Also add the USE_WC_PREFIX macro so one can cleanly deal with the CMSG_DATA conflict with sys/socket.h. --- dlls/ws2_32/socket.c | 1 + include/mprapi.h | 1 + include/wincrypt.h | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 4650f6402b2..0d44e687d6a 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -146,6 +146,7 @@ #include "mstcpip.h" #include "af_irda.h" #include "winnt.h" +#define USE_WC_PREFIX /* For CMSG_DATA */ #include "iphlpapi.h" #include "wine/server.h" #include "wine/debug.h" diff --git a/include/mprapi.h b/include/mprapi.h index 1860f987528..4e67ff0e8a2 100644 --- a/include/mprapi.h +++ b/include/mprapi.h @@ -22,6 +22,7 @@ #include #include #include +#include #define MAX_DEVICE_NAME 128 #define MAX_DEVICETYPE_NAME 16 diff --git a/include/wincrypt.h b/include/wincrypt.h index ae5aa05097e..1311f31086b 100644 --- a/include/wincrypt.h +++ b/include/wincrypt.h @@ -3432,6 +3432,7 @@ typedef struct _CERT_ID #define CERT_ID_KEY_IDENTIFIER 2 #define CERT_ID_SHA1_HASH 3 +#ifndef USE_WC_PREFIX #undef CMSG_DATA /* may be defined by sys/socket.h */ #define CMSG_DATA 1 #define CMSG_SIGNED 2 @@ -3446,6 +3447,21 @@ typedef struct _CERT_ID #define CMSG_ENVELOPED_FLAG (1 << CMSG_ENVELOPED) #define CMSG_SIGNED_AND_ENVELOPED_FLAG (1 << CMSG_SIGNED_AND_ENVELOPED) #define CMSG_ENCRYPTED_FLAG (1 << CMSG_ENCRYPTED) +#else +#define WC_CMSG_DATA 1 +#define WC_CMSG_SIGNED 2 +#define WC_CMSG_ENVELOPED 3 +#define WC_CMSG_SIGNED_AND_ENVELOPED 4 +#define WC_CMSG_HASHED 5 +#define WC_CMSG_ENCRYPTED 6 + +#define WC_CMSG_ALL_FLAGS ~0U +#define WC_CMSG_DATA_FLAG (1 << WC_CMSG_DATA) +#define WC_CMSG_SIGNED_FLAG (1 << WC_CMSG_SIGNED) +#define WC_CMSG_ENVELOPED_FLAG (1 << WC_CMSG_ENVELOPED) +#define WC_CMSG_SIGNED_AND_ENVELOPED_FLAG (1 << WC_CMSG_SIGNED_AND_ENVELOPED) +#define WC_CMSG_ENCRYPTED_FLAG (1 << WC_CMSG_ENCRYPTED) +#endif typedef struct _CMSG_SIGNER_ENCODE_INFO {