Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 161801 Details for
Bug 233447
[PATCH] games-puzzle/krystaldrop-0.7.2: fails to compile with gcc 4.3.1
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix building with GCC 4.3.1
krystaldrop-0.7.2-gcc43.patch (text/plain), 3.32 KB, created by
Jabari R. Roberts
on 2008-07-31 04:11:15 UTC
(
hide
)
Description:
Patch to fix building with GCC 4.3.1
Filename:
MIME Type:
Creator:
Jabari R. Roberts
Created:
2008-07-31 04:11:15 UTC
Size:
3.32 KB
patch
obsolete
>--- krystaldrop/Sources/KDpp/Resources/ArchiveReader.h.old 2008-07-30 22:05:18.000000000 -0500 >+++ krystaldrop/Sources/KDpp/Resources/ArchiveReader.h 2008-07-30 22:27:20.000000000 -0500 >@@ -2,7 +2,26 @@ > #define ArchiveReader_H > > #include <map> >-#include <string> >+#include <cstring> >+#include <locale> >+ >+/* >+ * structs needed for std::transform() >+ * See: http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html#7 >+ */ >+struct ToUpper { >+ ToUpper(std::locale const& l) : loc(l) {;} >+ char operator() (char c) const { return std::toupper(c,loc); } >+private: >+ std::locale const& loc; >+}; >+ >+struct ToLower { >+ ToLower(std::locale const& l) : loc(l) {;} >+ char operator() (char c) const { return std::tolower(c,loc); } >+private: >+ std::locale const& loc; >+}; > > /** \c KD_ArchiveReader is a generic abstract class which reads a specific kind of archive > (`.zip' for instance) >--- krystaldrop/Sources/KDpp/Resources/ArchiveManager.cpp.old 2008-07-30 20:53:19.000000000 -0500 >+++ krystaldrop/Sources/KDpp/Resources/ArchiveManager.cpp 2008-07-30 22:35:54.000000000 -0500 >@@ -1,10 +1,11 @@ >-#include <assert.h> >+#include <cassert> >+#include <algorithm> > > #include "ArchiveManager.h" > #include "../Tools/Logfile.h" > > #ifndef _WIN32 >-#include <ctype.h> >+#include <cctype> > #endif > > std::map<std::string,KD_ArchiveReader*> KD_ArchiveManager::opened_archives; >@@ -25,7 +26,6 @@ > opened_archives.clear(); > } > >- > void KD_ArchiveManager::RegisterArchiveFormat (std::string suffix, T_ArchiveReaderFactory reader_factory) > { > NormalizeSuffix (suffix); >@@ -36,9 +36,10 @@ > > > void KD_ArchiveManager::NormalizeSuffix (std::string& suffix) >-{ >+{ >+ ToLower __tolower(std::locale::classic()); > // stores the suffix lower-case >- transform (suffix.begin(), suffix.end(), suffix.begin(), tolower); >+ transform (suffix.begin(), suffix.end(), suffix.begin(), __tolower); > > // add the dot character `.' if it is missing > if (suffix[0]!= '.') suffix= '.'+ suffix; >--- krystaldrop/Sources/KDpp/Tools/FilePath.cpp.old 2008-07-30 20:55:13.000000000 -0500 >+++ krystaldrop/Sources/KDpp/Tools/FilePath.cpp 2008-07-30 22:37:05.000000000 -0500 >@@ -1,12 +1,12 @@ > #include "FilePath.h" > >-#include <stdio.h> >+#include <cstdio> >+#include <algorithm> > > #ifndef _WIN32 >-#include <ctype.h> >+#include <cctype> > #endif > >- > KD_FilePath::KD_FilePath() : fileName("") , filePath(""), archiveName(""), archiveSuffix("") > { > } >@@ -165,8 +165,9 @@ > // (*not* the first one found scanning from left to right) > > // the search is case-insensitive -> lower-casificator in action >+ ToLower __tolower(std::locale::classic()); > string copy_directory = directory; >- transform (copy_directory.begin(), copy_directory.end(), copy_directory.begin(), tolower); >+ transform (copy_directory.begin(), copy_directory.end(), copy_directory.begin(), __tolower); > > map<string,T_ArchiveReaderFactory>::iterator suffix_iter= > KD_ArchiveManager::known_suffixes.begin(); >@@ -271,6 +272,7 @@ > > string KD_FilePath::GetFileExtension() const > { >+ ToLower __tolower(std::locale::classic()); > size_t pos = fileName.rfind('.'); > if (pos == fileName.npos) > return ""; >@@ -280,7 +282,7 @@ > for (unsigned int i=0; i<ext.size(); i++) > ext[i] = tolower(ext[i]); > */ >- transform (ext.begin(), ext.end(), ext.begin(), tolower); >+ transform (ext.begin(), ext.end(), ext.begin(), __tolower); > return ext; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 233447
: 161801 |
161803