From da33226631403a7f7a6e3d6bd5aba570112bed93 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Fri, 21 Jun 2019 09:47:24 +0100 Subject: [PATCH] Fix COAP_DEPRECATED for Windows C++ builds include/coap2/libcoap.h: Simplify COAP_DEPRECATED definition to generically handle Windows or other builds when setting the define for COAP_DEPRECATED. Fixes #363 --- include/coap2/libcoap.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/coap2/libcoap.h b/include/coap2/libcoap.h index bee4cfea..77ba5db2 100644 --- a/include/coap2/libcoap.h +++ b/include/coap2/libcoap.h @@ -40,14 +40,10 @@ typedef USHORT in_port_t; # endif #endif #ifndef COAP_DEPRECATED -# if defined(__cplusplus) -# define COAP_DEPRECATED __attribute__ ((deprecated)) +# if defined(_MSC_VER) +# define COAP_DEPRECATED __declspec(deprecated) # else -# if defined(_MSC_VER) -# define COAP_DEPRECATED __declspec(deprecated) -# else -# define COAP_DEPRECATED __attribute__ ((deprecated)) -# endif +# define COAP_DEPRECATED __attribute__ ((deprecated)) # endif #endif