From e0a828ecbd708757d67977f7e92a6f4c1b0b92fd Mon Sep 17 00:00:00 2001 From: ThePhD Date: Tue, 23 Jun 2015 09:07:17 -0400 Subject: [PATCH] Back to using regular `strdup`, with an `hb-private.hh` fix that special-cases VC++'s definition and usage of the words --- src/hb-common.cc | 2 +- src/hb-private.hh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-common.cc b/src/hb-common.cc index 1484bbb2e..a37154579 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -219,7 +219,7 @@ struct hb_language_item_t { } inline hb_language_item_t & operator = (const char *s) { - lang = (hb_language_t) _strdup (s); + lang = (hb_language_t) strdup (s); for (unsigned char *p = (unsigned char *) lang; *p; p++) *p = canon_map[*p]; diff --git a/src/hb-private.hh b/src/hb-private.hh index 45afc20b1..996d88d29 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -132,6 +132,9 @@ static int errno = 0; /* Use something better? */ # endif # if defined(_MSC_VER) && _MSC_VER < 1900 # define snprintf _snprintf +# elif defined(_MSC_VER) && _MSC_VER >= 1900 +# /* Covers VC++ Error for strdup being a deprected POSIX name and to instead use _strdup instead */ +# define strdup _strdup # endif #endif