From 1d8d9aa384568cb7f38447dd5b28f94a7d6097d7 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 15 Jan 2018 13:24:26 -0800 Subject: [PATCH] Switch to 4.19.7.dev1801141749 on darwin --- build.py | 4 ++-- sip/siplib/sip.h | 11 ++++++++--- sip/siplib/siplib.c | 21 +++++++++++++++++++++ 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index 06c9cbb8..23ba40e1 100755 --- a/build.py +++ b/build.py @@ -75,9 +75,9 @@ wxICON = 'docs/sphinx/_static/images/sphinxdocs/mondrian.png' # Some tools will be downloaded for the builds. These are the versions and # MD5s of the tool binaries currently in use. -sipCurrentVersion = '4.19.5' +sipCurrentVersion = '4.19.7.dev1801141749' sipMD5 = { - 'darwin' : '06308e0a0d3735992a53986fe99bde07', + 'darwin' : '9f2c414004ec4b98d6d6bb4d5fe9fb85', 'win32' : '107f2bbac5445f2a3c5df64000b1e1c3', 'linux32' : '6dc2998b10c1e81bbc5cb9bd007f9345', 'linux64' : '62104b11351b00da3dd5ed6094a2c744', diff --git a/sip/siplib/sip.h b/sip/siplib/sip.h index c10e4564..df15b369 100644 --- a/sip/siplib/sip.h +++ b/sip/siplib/sip.h @@ -54,8 +54,8 @@ extern "C" { /* * Define the SIP version number. */ -#define SIP_VERSION 0x041305 -#define SIP_VERSION_STR "4.19.5" +#define SIP_VERSION 0x041307 +#define SIP_VERSION_STR "4.19.7.dev1801141749" /* @@ -1460,6 +1460,8 @@ typedef struct _sipCharInstanceDef { /* * The information describing a string instance to be added to a dictionary. + * This is also used as a hack to add (or fix) other types rather than add a + * new table type and so requiring a new major version of the API. */ typedef struct _sipStringInstanceDef { /* The string name. */ @@ -1468,7 +1470,10 @@ typedef struct _sipStringInstanceDef { /* The string value. */ const char *si_val; - /* The encoding used, either 'A', 'L', '8' or 'N'. */ + /* + * The encoding used, either 'A', 'L', '8' or 'N'. 'w' and 'W' are also + * used to support the fix for wchar_t. + */ char si_encoding; } sipStringInstanceDef; diff --git a/sip/siplib/siplib.c b/sip/siplib/siplib.c index a309761a..19567a86 100644 --- a/sip/siplib/siplib.c +++ b/sip/siplib/siplib.c @@ -8464,6 +8464,27 @@ static int addStringInstances(PyObject *dict, sipStringInstanceDef *si) #endif break; + case 'w': + /* The hack for wchar_t. */ +#if defined(HAVE_WCHAR_H) + w = PyUnicode_FromWideChar((const wchar_t *)si->si_val, 1); + break; +#else + raiseNoWChar(); + return -1; +#endif + + case 'W': + /* The hack for wchar_t*. */ +#if defined(HAVE_WCHAR_H) + w = PyUnicode_FromWideChar((const wchar_t *)si->si_val, + wcslen((const wchar_t *)si->si_val)); + break; +#else + raiseNoWChar(); + return -1; +#endif + default: w = SIPBytes_FromString(si->si_val); }