From a0df25c10bfc21574d474547bf2f25372bdbb417 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 16 Feb 2017 12:29:28 +0100 Subject: Rename strdup to _strdup under MSVC Signed-off-by: Szczepan Zalega --- NK_C_API.cc | 1 + NitrokeyManager.cc | 2 ++ include/cxx_semantics.h | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NK_C_API.cc b/NK_C_API.cc index 6d18e52..0fde829 100644 --- a/NK_C_API.cc +++ b/NK_C_API.cc @@ -1,6 +1,7 @@ #include #include "NK_C_API.h" #include "include/LibraryException.h" +#include "include/cxx_semantics.h" using namespace nitrokey; diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index 6ce9910..fa32557 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -7,6 +7,8 @@ #include #include "include/misc.h" #include +#include "include/cxx_semantics.h" + namespace nitrokey{ diff --git a/include/cxx_semantics.h b/include/cxx_semantics.h index 29e51c3..f358e8f 100644 --- a/include/cxx_semantics.h +++ b/include/cxx_semantics.h @@ -1,12 +1,16 @@ #ifndef CXX_SEMANTICS_H #define CXX_SEMANTICS_H -#ifndef _WINDOWS +#ifndef _MSC_VER #define __packed __attribute__((__packed__)) #else #define __packed #endif +#ifdef _MSC_VER +#define strdup _strdup +#endif + /* * There's no need to include Boost for a simple subset this project needs. */ -- cgit v1.2.3