diff options
author | Andrew MacIntyre <andymac@bullseye.apana.org.au> | 2002-02-26 11:36:35 (GMT) |
---|---|---|
committer | Andrew MacIntyre <andymac@bullseye.apana.org.au> | 2002-02-26 11:36:35 (GMT) |
commit | c487439aa79acaf6c83a65985c110d5ca1ea71da (patch) | |
tree | 82e92be005591f583ab902c6f6755ba046d41f56 /Objects/unicodeobject.c | |
parent | 5e090fc98525308d2a86eaf5c535c3c2ba1a644c (diff) | |
download | cpython-c487439aa79acaf6c83a65985c110d5ca1ea71da.zip cpython-c487439aa79acaf6c83a65985c110d5ca1ea71da.tar.gz cpython-c487439aa79acaf6c83a65985c110d5ca1ea71da.tar.bz2 |
OS/2 EMX port changes (Objects part of patch #450267):
Objects/
fileobject.c
stringobject.c
unicodeobject.c
This commit doesn't include the cleanup patches for stringobject.c and
unicodeobject.c which are shown separately in the patch manager. Those
patches will be regenerated and applied in a subsequent commit, so as
to preserve a fallback position (this commit to those files).
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 1d0508c..f214c20 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5162,6 +5162,15 @@ formatint(Py_UNICODE *buf, * Compaq Tru64) violate the std by converting 0 w/ leading 0x anyway. * So add it only if the platform doesn't already. */ +#if defined(PYOS_OS2) && defined(PYCC_GCC) + if ((flags & F_ALT) && (type == 'x' || type == 'X')) { + /* the EMX runtime gives 0x as the base marker when we want 0X + * so we cover all bets by supplying our own for both cases. + */ + use_native_c_format = 0; + PyOS_snprintf(fmt, sizeof(fmt), "0%c%%.%dl%c", type, prec, type); + } +#else if (x == 0 && (flags & F_ALT) && (type == 'x' || type == 'X')) { /* Only way to know what the platform does is to try it. */ PyOS_snprintf(fmt, sizeof(fmt), type == 'x' ? "%#x" : "%#X", 0); @@ -5171,6 +5180,7 @@ formatint(Py_UNICODE *buf, PyOS_snprintf(fmt, sizeof(fmt), "0%c%%#.%dl%c", type, prec, type); } } +#endif if (use_native_c_format) PyOS_snprintf(fmt, sizeof(fmt), "%%%s.%dl%c", (flags & F_ALT) ? "#" : "", prec, type); |