From: Alexey Dyachenko <dyachenko@fromru.com>
To: ALT Linux Mailing List <devel@altlinux.ru>
Subject: [devel] synaptic и g++ 3.2.1 строки и итераторы
Date: Wed, 25 Sep 2002 11:47:33 +0200
Message-ID: <20020925094733.GB31139@deepblue.prokent.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 932 bytes --]
Добрый день всем!
Мне тут понадобился работающий графический клиент для apt и я немного
похакал synaptic для сборки gcc 3.2.
Патч прилагается.
Вот только при этом получил я ОЧЕНЬ неприятную новость.
std::string::iterator != const char *
То есть в gcc 3.2 basic_string::iterator объявлен как
typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator;
В stlport это объявлеятся как
typedef const value_type* const_iterator;
typedef value_type* iterator;
и по моему здесь прав stlport.
Сейчас у меня с собой нет ни страуструпа, ни стандарта, так что точно
посмотреть не могу. Кто точно знает -- киньте пожалуйста кусок из
стандарта или просто скажите, кто из них прав.
Если прав stlport -- тогда срочно сяду собирать пакет для сизифа.
Хотя это надо бы сделать в любом случае -- вещь полезная.
С уважением, Алексей Дьяченко.
[-- Attachment #2: synaptic-0.16-alt-gcc32.patch --]
[-- Type: text/plain, Size: 4388 bytes --]
diff -Naur synaptic-0.16/common/i18n.h synaptic-0.16-gcc32/common/i18n.h
--- synaptic-0.16/common/i18n.h 2001-01-26 01:19:12 +0100
+++ synaptic-0.16-gcc32/common/i18n.h 2002-09-25 10:17:24 +0200
@@ -13,8 +13,8 @@
#else
/* Stubs that do something close enough. */
# define textdomain(String) (String)
-# define gettext(String) (String)
-# define dgettext(Domain,Message) (Message)
+//# define gettext(String) (String)
+//# define dgettext(Domain,Message) (Message)
# define dcgettext(Domain,Message,Type) (Message)
# define bindtextdomain(Domain,Directory) (Domain)
# define _(String) (String)
diff -Naur synaptic-0.16/common/indexcopy.cc synaptic-0.16-gcc32/common/indexcopy.cc
--- synaptic-0.16/common/indexcopy.cc 2001-08-15 21:44:09 +0200
+++ synaptic-0.16-gcc32/common/indexcopy.cc 2002-09-25 10:28:33 +0200
@@ -402,7 +402,7 @@
return;
// Not a dists type.
- if (stringcmp(Path.begin(),Path.begin()+strlen("dists/"),"dists/") != 0)
+ if (stringcmp( &( *Path.begin() ),&*( Path.begin()+strlen("dists/"),"dists/" ) ) != 0)
return;
// Isolate the dist
diff -Naur synaptic-0.16/common/indexcopy.h synaptic-0.16-gcc32/common/indexcopy.h
--- synaptic-0.16/common/indexcopy.h 2001-07-24 00:01:08 +0200
+++ synaptic-0.16-gcc32/common/indexcopy.h 2002-09-25 10:27:24 +0200
@@ -16,6 +16,9 @@
class pkgTagSection;
class FileFd;
+using std::string;
+using std::vector;
+
class IndexCopy
{
protected:
diff -Naur synaptic-0.16/common/rcdscanner.cc synaptic-0.16-gcc32/common/rcdscanner.cc
--- synaptic-0.16/common/rcdscanner.cc 2001-07-24 00:01:08 +0200
+++ synaptic-0.16-gcc32/common/rcdscanner.cc 2002-09-25 10:26:17 +0200
@@ -136,7 +136,7 @@
string File = _config->FindFile("Dir::Etc::sourcelist");
// Open the stream for reading
- ifstream F(File.c_str(),ios::in | ios::nocreate);
+ ifstream F(File.c_str(),ios::in );
if (!F != 0)
return _error->Errno("ifstream::ifstream","Opening %s",File.c_str());
diff -Naur synaptic-0.16/common/rconfiguration.h synaptic-0.16-gcc32/common/rconfiguration.h
--- synaptic-0.16/common/rconfiguration.h 2001-01-24 19:09:28 +0100
+++ synaptic-0.16-gcc32/common/rconfiguration.h 2002-09-25 10:30:38 +0200
@@ -11,7 +11,7 @@
bool RWriteConfigFile(Configuration &Conf);
-bool RInitConfiguration(string confFileName);
+bool RInitConfiguration(std::string confFileName);
bool RReadFilterData(Configuration &config);
bool RFilterDataOutFile(ofstream &out);
diff -Naur synaptic-0.16/common/rpackage.cc synaptic-0.16-gcc32/common/rpackage.cc
--- synaptic-0.16/common/rpackage.cc 2001-08-10 20:38:22 +0200
+++ synaptic-0.16-gcc32/common/rpackage.cc 2002-09-25 10:09:45 +0200
@@ -164,8 +164,10 @@
static char *parseDescription(string descr)
{
- const char *end;
- const char *p;
+// const char *end;
+// const char *p;
+ string::iterator end;
+ string::iterator p;
char *pp = (char*)descrBuffer;
int state = 0;
diff -Naur synaptic-0.16/common/rpackagelister.cc synaptic-0.16-gcc32/common/rpackagelister.cc
--- synaptic-0.16/common/rpackagelister.cc 2001-08-10 20:38:22 +0200
+++ synaptic-0.16-gcc32/common/rpackagelister.cc 2002-09-25 10:13:30 +0200
@@ -783,7 +783,7 @@
// Populate it with the source selection
for (I = List.begin(); I != List.end(); I++)
{
- new pkgAcqIndex(&Fetcher,I);
+ new pkgAcqIndex(&Fetcher,&(*I));
if (_error->PendingError() == true)
return false;
}
diff -Naur synaptic-0.16/wings/rwsummarywindow.cc synaptic-0.16-gcc32/wings/rwsummarywindow.cc
--- synaptic-0.16/wings/rwsummarywindow.cc 2001-08-10 20:38:22 +0200
+++ synaptic-0.16-gcc32/wings/rwsummarywindow.cc 2002-09-25 10:35:24 +0200
@@ -13,6 +13,8 @@
#include <WINGs/WINGs.h>
#include "rwsummarywindow.h"
+#include <iostream>
+
void RWSummaryWindow::handleKeyPress(XEvent *event, void *clientData)
@@ -255,7 +257,7 @@
lines++;
}
if (left <= 0) {
- cout << "BUFFER OVERFLOW DETECTED, ABORTING" << endl;
+ std::cout << "BUFFER OVERFLOW DETECTED, ABORTING" << std::endl;
abort();
}
diff -Naur synaptic-0.16/wings/rwwindow.h synaptic-0.16-gcc32/wings/rwwindow.h
--- synaptic-0.16/wings/rwwindow.h 2001-01-25 00:24:35 +0100
+++ synaptic-0.16-gcc32/wings/rwwindow.h 2002-09-25 10:32:43 +0200
@@ -7,6 +7,8 @@
#include <string>
+using std::string;
+
class RWWindow {
protected:
WMWindow *_win;
next reply other threads:[~2002-09-25 9:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-25 9:47 Alexey Dyachenko [this message]
2002-09-25 13:42 ` Dmitry V. Levin
2002-09-25 16:57 ` Alexey Dyachenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020925094733.GB31139@deepblue.prokent.de \
--to=dyachenko@fromru.com \
--cc=devel@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git