diff options
author | kwm <kwm@df743ca5-7f9a-e211-a948-0013205c9059> | 2009-09-28 19:50:49 +0800 |
---|---|---|
committer | kwm <kwm@df743ca5-7f9a-e211-a948-0013205c9059> | 2009-09-28 19:50:49 +0800 |
commit | 8cd2c62b9616a56e7a3b4b4f06d1f07a459555a9 (patch) | |
tree | 6a91b2495817dafffcf3590b7e8c6394e01725cd /x11-toolkits/wxgtk24/files/patch-src-common-datetime.cpp | |
parent | ee490f9c1d681ae11bc3f01bf0f40186b20a9824 (diff) | |
download | marcuscom-ports-8cd2c62b9616a56e7a3b4b4f06d1f07a459555a9.tar marcuscom-ports-8cd2c62b9616a56e7a3b4b4f06d1f07a459555a9.tar.gz marcuscom-ports-8cd2c62b9616a56e7a3b4b4f06d1f07a459555a9.tar.bz2 marcuscom-ports-8cd2c62b9616a56e7a3b4b4f06d1f07a459555a9.tar.lz marcuscom-ports-8cd2c62b9616a56e7a3b4b4f06d1f07a459555a9.tar.xz marcuscom-ports-8cd2c62b9616a56e7a3b4b4f06d1f07a459555a9.tar.zst marcuscom-ports-8cd2c62b9616a56e7a3b4b4f06d1f07a459555a9.zip |
Fix build with new glib
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@13065 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'x11-toolkits/wxgtk24/files/patch-src-common-datetime.cpp')
-rw-r--r-- | x11-toolkits/wxgtk24/files/patch-src-common-datetime.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/x11-toolkits/wxgtk24/files/patch-src-common-datetime.cpp b/x11-toolkits/wxgtk24/files/patch-src-common-datetime.cpp new file mode 100644 index 000000000..f4931273f --- /dev/null +++ b/x11-toolkits/wxgtk24/files/patch-src-common-datetime.cpp @@ -0,0 +1,56 @@ +--- src/common/datetime.cpp.orig Tue Nov 4 09:50:09 2003 ++++ src/common/datetime.cpp Tue Nov 4 09:52:02 2003 +@@ -349,6 +349,35 @@ + return wxString(buf); + } + ++#ifdef HAVE_STRPTIME ++ ++// Unicode-friendly strptime() wrapper ++static const wxChar * ++CallStrptime(const wxChar *input, const char *fmt, tm *tm) ++{ ++ // the problem here is that strptime() returns pointer into the string we ++ // passed to it while we're really interested in the pointer into the ++ // original, Unicode, string so we try to transform the pointer back ++#if wxUSE_UNICODE ++ wxCharBuffer inputMB(wxConvertWX2MB(input)); ++#else // ASCII ++ const char * const inputMB = input; ++#endif // Unicode/Ascii ++ ++ const char *result = strptime(inputMB, fmt, tm); ++ if ( !result ) ++ return NULL; ++ ++#if wxUSE_UNICODE ++ // FIXME: this is wrong in presence of surrogates &c ++ return input + (result - inputMB.data()); ++#else // ASCII ++ return result; ++#endif // Unicode/Ascii ++} ++ ++#endif // HAVE_STRPTIME ++ + // if year and/or month have invalid values, replace them with the current ones + static void ReplaceDefaultYearMonthWithCurrent(int *year, + wxDateTime::Month *month) +@@ -2920,7 +2949,7 @@ + // to our generic code anyhow (FIXME !Unicode friendly) + { + struct tm tm; +- const wxChar *result = strptime(input, "%x", &tm); ++ const wxChar *result = CallStrptime(input, "%x", &tm); + if ( result ) + { + input = result; +@@ -2985,7 +3014,7 @@ + { + // use strptime() to do it for us (FIXME !Unicode friendly) + struct tm tm; +- input = strptime(input, "%X", &tm); ++ input = CallStrptime(input, "%X", &tm); + if ( !input ) + { + return (wxChar *)NULL; |