From a4f6bdc8bd91c7282ae9ac60c44844c6f0058a65 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 13 Dec 2011 00:54:37 +0100 Subject: revert 2184.1.2: do not pollute namespace in headers The breakage is just to big for now, so guard the change with #ifndef APT_8_CLEANER_HEADERS and be nice to library users --- apt-pkg/acquire.h | 5 +++++ apt-pkg/algorithms.h | 4 ++++ apt-pkg/cdrom.h | 4 ++++ apt-pkg/contrib/cdromutl.h | 4 ++++ apt-pkg/contrib/configuration.h | 4 ++++ apt-pkg/contrib/fileutl.h | 4 ++++ apt-pkg/contrib/hashes.h | 6 ++++++ apt-pkg/contrib/hashsum_template.h | 5 +++++ apt-pkg/contrib/md5.h | 5 +++++ apt-pkg/contrib/mmap.h | 4 ++++ apt-pkg/contrib/progress.h | 4 ++++ apt-pkg/contrib/sha1.h | 5 +++++ apt-pkg/contrib/strutl.h | 6 ++++++ apt-pkg/deb/dpkgpm.h | 5 +++++ apt-pkg/indexcopy.h | 5 +++++ apt-pkg/indexfile.h | 4 ++++ apt-pkg/metaindex.h | 4 ++++ apt-pkg/packagemanager.h | 4 ++++ apt-pkg/pkgcache.h | 5 ++++- apt-pkg/policy.h | 4 ++++ apt-pkg/srcrecords.h | 5 +++++ apt-pkg/vendor.h | 4 ++++ apt-pkg/vendorlist.h | 5 +++++ apt-pkg/version.h | 4 ++++ apt-pkg/versionmatch.h | 4 ++++ 25 files changed, 112 insertions(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h index 93772403d..3d5d7a4b7 100644 --- a/apt-pkg/acquire.h +++ b/apt-pkg/acquire.h @@ -75,6 +75,11 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::vector; +using std::string; +#endif + class pkgAcquireStatus; /** \brief The core download scheduler. {{{ diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index 948fe1103..fdb64fc59 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -36,6 +36,10 @@ #include +#ifndef APT_8_CLEANER_HEADERS +using std::ostream; +#endif + class pkgAcquireStatus; class pkgSimulate : public pkgPackageManager /*{{{*/ diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h index 319254fd0..4fcf5abcd 100644 --- a/apt-pkg/cdrom.h +++ b/apt-pkg/cdrom.h @@ -4,6 +4,10 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using namespace std; +#endif + class Configuration; class OpProgress; diff --git a/apt-pkg/contrib/cdromutl.h b/apt-pkg/contrib/cdromutl.h index 2c6afac0f..e94045b5c 100644 --- a/apt-pkg/contrib/cdromutl.h +++ b/apt-pkg/contrib/cdromutl.h @@ -12,6 +12,10 @@ #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +#endif + // mount cdrom, DeviceName (e.g. /dev/sr0) is optional bool MountCdrom(std::string Path, std::string DeviceName=""); bool UnmountCdrom(std::string Path); diff --git a/apt-pkg/contrib/configuration.h b/apt-pkg/contrib/configuration.h index f6f2a3c1d..4c2e75041 100644 --- a/apt-pkg/contrib/configuration.h +++ b/apt-pkg/contrib/configuration.h @@ -34,6 +34,10 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +#endif + class Configuration { public: diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index f96dc72dc..8a986b82b 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -29,6 +29,10 @@ #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +#endif + /* Define this for python-apt */ #define APT_HAS_GZIP 1 diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index 81851dede..b206eccb8 100644 --- a/apt-pkg/contrib/hashes.h +++ b/apt-pkg/contrib/hashes.h @@ -22,6 +22,12 @@ #include #include + +#ifndef APT_8_CLEANER_HEADERS +using std::min; +using std::vector; +#endif + // helper class that contains hash function name // and hash class HashString diff --git a/apt-pkg/contrib/hashsum_template.h b/apt-pkg/contrib/hashsum_template.h index 27d192b82..6301ac9d0 100644 --- a/apt-pkg/contrib/hashsum_template.h +++ b/apt-pkg/contrib/hashsum_template.h @@ -15,6 +15,11 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +using std::min; +#endif + template class HashSumValue { diff --git a/apt-pkg/contrib/md5.h b/apt-pkg/contrib/md5.h index a207da4e4..25631b166 100644 --- a/apt-pkg/contrib/md5.h +++ b/apt-pkg/contrib/md5.h @@ -31,6 +31,11 @@ #include "hashsum_template.h" +#ifndef APT_8_CLEANER_HEADERS +using std::string; +using std::min; +#endif + typedef HashSumValue<128> MD5SumValue; class MD5Summation : public SummationImplementation diff --git a/apt-pkg/contrib/mmap.h b/apt-pkg/contrib/mmap.h index 2ed4a95f8..602de94f8 100644 --- a/apt-pkg/contrib/mmap.h +++ b/apt-pkg/contrib/mmap.h @@ -28,6 +28,10 @@ #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +#endif + class FileFd; /* This should be a 32 bit type, larger tyes use too much ram and smaller diff --git a/apt-pkg/contrib/progress.h b/apt-pkg/contrib/progress.h index 7635719bc..3a6943aee 100644 --- a/apt-pkg/contrib/progress.h +++ b/apt-pkg/contrib/progress.h @@ -25,6 +25,10 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +#endif + class Configuration; class OpProgress { diff --git a/apt-pkg/contrib/sha1.h b/apt-pkg/contrib/sha1.h index b4b139a22..a8d55eb13 100644 --- a/apt-pkg/contrib/sha1.h +++ b/apt-pkg/contrib/sha1.h @@ -20,6 +20,11 @@ #include "hashsum_template.h" +#ifndef APT_8_CLEANER_HEADERS +using std::string; +using std::min; +#endif + typedef HashSumValue<160> SHA1SumValue; class SHA1Summation : public SummationImplementation diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index 93f4bef4f..337139d5d 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -27,6 +27,12 @@ #include "macros.h" +#ifndef APT_8_CLEANER_HEADERS +using std::string; +using std::vector; +using std::ostream; +#endif + bool UTF8ToCodeset(const char *codeset, const std::string &orig, std::string *dest); char *_strstrip(char *String); char *_strtabexpand(char *String,size_t Len); diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h index 6b62360b7..aab39f633 100644 --- a/apt-pkg/deb/dpkgpm.h +++ b/apt-pkg/deb/dpkgpm.h @@ -15,6 +15,11 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::vector; +using std::map; +#endif + class pkgDPkgPMPrivate; class pkgDPkgPM : public pkgPackageManager diff --git a/apt-pkg/indexcopy.h b/apt-pkg/indexcopy.h index 21294ae7e..e3de1afd9 100644 --- a/apt-pkg/indexcopy.h +++ b/apt-pkg/indexcopy.h @@ -14,6 +14,11 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +using std::vector; +#endif + class pkgTagSection; class FileFd; class indexRecords; diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index 5e162a846..1d34dc773 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -29,6 +29,10 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +#endif + class pkgAcquire; class pkgCacheGenerator; class OpProgress; diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 9cc79a7a6..0f95257e0 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -6,6 +6,10 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +#endif + class pkgAcquire; class pkgCacheGenerator; class OpProgress; diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h index d4989a6e0..1d807795d 100644 --- a/apt-pkg/packagemanager.h +++ b/apt-pkg/packagemanager.h @@ -29,6 +29,10 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +#endif + class pkgAcquire; class pkgDepCache; class pkgSourceList; diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index fd1a02149..1a7013551 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -74,11 +74,14 @@ #ifndef PKGLIB_PKGCACHE_H #define PKGLIB_PKGCACHE_H - #include #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +#endif + class pkgVersioningSystem; class pkgCache /*{{{*/ { diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h index 3c8246e3b..5172a3c3b 100644 --- a/apt-pkg/policy.h +++ b/apt-pkg/policy.h @@ -38,6 +38,10 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::vector; +#endif + class pkgPolicy : public pkgDepCache::Policy { protected: diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h index a55bc74fa..06f0dce6c 100644 --- a/apt-pkg/srcrecords.h +++ b/apt-pkg/srcrecords.h @@ -17,6 +17,11 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +using std::vector; +#endif + class pkgSourceList; class pkgIndexFile; class pkgSrcRecords diff --git a/apt-pkg/vendor.h b/apt-pkg/vendor.h index 9b157378c..6484adf9b 100644 --- a/apt-pkg/vendor.h +++ b/apt-pkg/vendor.h @@ -6,6 +6,10 @@ #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +#endif + // A class representing a particular software provider. class __deprecated Vendor { diff --git a/apt-pkg/vendorlist.h b/apt-pkg/vendorlist.h index 733d23a32..4e050477f 100644 --- a/apt-pkg/vendorlist.h +++ b/apt-pkg/vendorlist.h @@ -17,6 +17,11 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +using std::vector; +#endif + class Vendor; class Configuration; diff --git a/apt-pkg/version.h b/apt-pkg/version.h index 92dbc2576..e0e0e6c14 100644 --- a/apt-pkg/version.h +++ b/apt-pkg/version.h @@ -23,6 +23,10 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +#endif + class pkgVersioningSystem { public: diff --git a/apt-pkg/versionmatch.h b/apt-pkg/versionmatch.h index da103fc5b..433396fc9 100644 --- a/apt-pkg/versionmatch.h +++ b/apt-pkg/versionmatch.h @@ -39,6 +39,10 @@ #include #include +#ifndef APT_8_CLEANER_HEADERS +using std::string; +#endif + class pkgVersionMatch { // Version Matching -- cgit v1.2.3