diff options
author | dsainty <dsainty@pkgsrc.org> | 2010-04-06 04:36:00 +0000 |
---|---|---|
committer | dsainty <dsainty@pkgsrc.org> | 2010-04-06 04:36:00 +0000 |
commit | dfb550a4dd47f41b8df032a3234b58268c03785a (patch) | |
tree | 0bc64429a4d8d4c9df2251b32b62e36e2df3cc85 /emulators | |
parent | e73da3a6d5c29aa4fac075d245b96694fbe2e0d8 (diff) | |
download | pkgsrc-dfb550a4dd47f41b8df032a3234b58268c03785a.tar.gz |
Casts to va_list are forbidden by ISO C++. Even if everything works as
intended, the format string parser that generates the va_list does not support
all formatting characters.
Make this code portable by failing to parse any format string at all, not just
the ones that aren't fully supported.
Bump PKGREVISION for the functional change, though this code is probably
generally unused anyway. Unmark as BROKEN and NOT_FOR_PLATFORM - I think all
uses of va_list casts are inhibited.
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/palmosemulator/Makefile | 9 | ||||
-rw-r--r-- | emulators/palmosemulator/distinfo | 3 | ||||
-rw-r--r-- | emulators/palmosemulator/patches/patch-as | 77 |
3 files changed, 81 insertions, 8 deletions
diff --git a/emulators/palmosemulator/Makefile b/emulators/palmosemulator/Makefile index 680432598c8..76e837b3829 100644 --- a/emulators/palmosemulator/Makefile +++ b/emulators/palmosemulator/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.30 2010/02/15 16:17:29 joerg Exp $ +# $NetBSD: Makefile,v 1.31 2010/04/06 04:36:00 dsainty Exp $ # DISTNAME= emulator_src_${POSE_VERSION} PKGNAME= palmosemulator-${POSE_VERSION} -PKGREVISION= 9 +PKGREVISION= 10 CATEGORIES= emulators x11 MASTER_SITES= http://www.palmos.com/dev/tools/emulator/sources/ DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ @@ -16,8 +16,6 @@ COMMENT= Palm OS Emulator PKG_DESTDIR_SUPPORT= user-destdir -BROKEN= Casts to va_list are forbidden by ISO C++. - POSE_VERSION= 3.5 DIST_SUBDIR= ${PKGBASE} @@ -44,9 +42,6 @@ CONFIGURE_ENV+= PACKAGE_SKINS_DIR=${POSE_SKINS_DIR:Q} REPLACE_PERL= Scripting/Perl/*.pl -# Assumes too much about how to build va_list's from scratch -NOT_FOR_PLATFORM= *-*-powerpc - INSTALLATION_DIRS= bin ${POSE_SHARE_DIR}/docs ${POSE_SHARE_DIR}/scripting INSTALLATION_DIRS+= ${POSE_SHARE_DIR}/prc ${POSE_SKINS_DIR} diff --git a/emulators/palmosemulator/distinfo b/emulators/palmosemulator/distinfo index 16ae1721187..a1d4a499a5a 100644 --- a/emulators/palmosemulator/distinfo +++ b/emulators/palmosemulator/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.8 2007/10/24 14:28:14 dsainty Exp $ +$NetBSD: distinfo,v 1.9 2010/04/06 04:36:00 dsainty Exp $ SHA1 (palmosemulator/emulator_src_3.5.tar.gz) = 2debd7690736397d0af41f7b2d482df65391fc65 RMD160 (palmosemulator/emulator_src_3.5.tar.gz) = fbb6761e4c43ecc9fb20d90d2ae0ec6ccf1c3f27 @@ -24,3 +24,4 @@ SHA1 (patch-ao) = 9ace708f71d33802059db53c9242f0d89a77e4da SHA1 (patch-ap) = 1fe9bf4a1d70230f2abb9375b9e439a3a163b4d7 SHA1 (patch-aq) = f3d3a6bf278f71573fb7d45021305561c3dcc114 SHA1 (patch-ar) = 50562522b9625e034b858439bd409b177f819f85 +SHA1 (patch-as) = 63d6db2db9f456193408d5e7407149fe4adf4cfb diff --git a/emulators/palmosemulator/patches/patch-as b/emulators/palmosemulator/patches/patch-as new file mode 100644 index 00000000000..b669aed963c --- /dev/null +++ b/emulators/palmosemulator/patches/patch-as @@ -0,0 +1,77 @@ +$NetBSD: patch-as,v 1.1 2010/04/06 04:36:00 dsainty Exp $ + +Casts to va_list are forbidden by ISO C++. Even if everything works as +intended, the format string parser that generates the va_list does not support +all formatting characters. + +Make this code portable by failing to parse any format string at all, not just +the ones that aren't fully supported. + +--- SrcShared/HostControl.cpp.orig 2010-04-06 15:17:21.970083672 +1200 ++++ SrcShared/HostControl.cpp 2010-04-06 15:22:12.868914553 +1200 +@@ -143,8 +143,10 @@ + + static HostHandler PrvHostGetHandler (HostControlSelectorType selector); + ++#ifdef ILLEGAL_VA_LIST_CASTS + static Bool PrvCollectParameters (EmSubroutine& sub, const string& fmt, + ByteList& stackData, StringList& stringData); ++#endif /* ILLEGAL_VA_LIST_CASTS */ + static void PrvPushShort (EmSubroutine& sub, ByteList& stackData); + static void PrvPushLong (EmSubroutine& sub, ByteList& stackData); + static void PrvPushDouble (EmSubroutine& sub, ByteList& stackData); +@@ -228,6 +230,7 @@ + return fgets (s, n, f); + } + ++#ifdef ILLEGAL_VA_LIST_CASTS + inline int x_vfprintf (FILE* f, const char* fmt, va_list args) + { + if (f == hostLogFILE) +@@ -237,6 +240,7 @@ + + return vfprintf (f, fmt, args); + } ++#endif /* ILLEGAL_VA_LIST_CASTS */ + + inline int x_fputc (int c, FILE* f) + { +@@ -1119,11 +1123,14 @@ + ByteList stackData; + StringList stringData; + ++#ifdef ILLEGAL_VA_LIST_CASTS + if (!::PrvCollectParameters (sub, string (fmt), stackData, stringData)) + { ++#endif /* ILLEGAL_VA_LIST_CASTS */ + PUT_RESULT_VAL (long, EOF); + errno = hostErrInvalidParameter; + return; ++#ifdef ILLEGAL_VA_LIST_CASTS + } + + // Write everything out to the file using vfprintf. +@@ -1133,6 +1140,7 @@ + // Return the result. + + PUT_RESULT_VAL (long, result); ++#endif /* ILLEGAL_VA_LIST_CASTS */ + } + + +@@ -4190,6 +4198,7 @@ + // ¥ PrvCollectParameters + // --------------------------------------------------------------------------- + ++#ifdef ILLEGAL_VA_LIST_CASTS + Bool PrvCollectParameters (EmSubroutine& sub, const string& fmt, ByteList& stackData, StringList& stringData) + { + // Start parsing up the format string. +@@ -4473,6 +4482,7 @@ + stackData.insert (stackData.end (), sizeof (char*), 0); // Make space for a "char*" + *(const char**) &stackData[oldSize] = (*(stringData.end () - 1)).c_str (); + } ++#endif /* ILLEGAL_VA_LIST_CASTS */ + + + // --------------------------------------------------------------------------- |