Skip to content

Commit

Permalink
Rename strdup to _strdup under MSVC
Browse files Browse the repository at this point in the history
Signed-off-by: Szczepan Zalega <[email protected]>
  • Loading branch information
szszszsz committed Mar 11, 2017
1 parent fd254e6 commit a0df25c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions NK_C_API.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <cstring>
#include "NK_C_API.h"
#include "include/LibraryException.h"
#include "include/cxx_semantics.h"

using namespace nitrokey;

Expand Down
2 changes: 2 additions & 0 deletions NitrokeyManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <stick20_commands.h>
#include "include/misc.h"
#include <mutex>
#include "include/cxx_semantics.h"


namespace nitrokey{

Expand Down
6 changes: 5 additions & 1 deletion include/cxx_semantics.h
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down

0 comments on commit a0df25c

Please sign in to comment.