]> git.saurik.com Git - apt.git/commitdiff
revert 2184.1.2: do not pollute namespace in headers
authorDavid Kalnischkies <kalnischkies@gmail.com>
Mon, 12 Dec 2011 23:54:37 +0000 (00:54 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Mon, 12 Dec 2011 23:54:37 +0000 (00:54 +0100)
The breakage is just to big for now, so guard the change with
#ifndef APT_8_CLEANER_HEADERS and be nice to library users

26 files changed:
apt-inst/contrib/extracttar.h
apt-pkg/acquire.h
apt-pkg/algorithms.h
apt-pkg/cdrom.h
apt-pkg/contrib/cdromutl.h
apt-pkg/contrib/configuration.h
apt-pkg/contrib/fileutl.h
apt-pkg/contrib/hashes.h
apt-pkg/contrib/hashsum_template.h
apt-pkg/contrib/md5.h
apt-pkg/contrib/mmap.h
apt-pkg/contrib/progress.h
apt-pkg/contrib/sha1.h
apt-pkg/contrib/strutl.h
apt-pkg/deb/dpkgpm.h
apt-pkg/indexcopy.h
apt-pkg/indexfile.h
apt-pkg/metaindex.h
apt-pkg/packagemanager.h
apt-pkg/pkgcache.h
apt-pkg/policy.h
apt-pkg/srcrecords.h
apt-pkg/vendor.h
apt-pkg/vendorlist.h
apt-pkg/version.h
apt-pkg/versionmatch.h

index 8754e8dcc0166399c438dc2af20dcb3aaef929a4..e104417c12890fdff4b7b8d09b02dada51be5960 100644 (file)
 
 #include <string>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::min;
+#endif
+
 class pkgDirStream;
 
 class ExtractTar
index 93772403d5c37e8b369698d3ef05e726636fd261..3d5d7a4b78a9aa522af324e04537f52289995213 100644 (file)
 #include <sys/time.h>
 #include <unistd.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::vector;
+using std::string;
+#endif
+
 class pkgAcquireStatus;
 
 /** \brief The core download scheduler.                                        {{{
index 948fe110312689e06d05130a5e1e849a388d5692..fdb64fc5970ab6e866a1e050090b94d2e824e3c5 100644 (file)
 
 #include <iostream>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::ostream;
+#endif
+
 class pkgAcquireStatus;
 
 class pkgSimulate : public pkgPackageManager                           /*{{{*/
index 319254fd0b212983361226d85a8fc7fe8623ce7f..4fcf5abcd6965a490ccf064fde578073f4c35162 100644 (file)
@@ -4,6 +4,10 @@
 #include<string>
 #include<vector>
 
+#ifndef APT_8_CLEANER_HEADERS
+using namespace std;
+#endif
+
 class Configuration;
 class OpProgress;
 
index 2c6afac0fbe7f97841d941a8b56a41478b5bb9bf..e94045b5c8cec8e56c610d761a8dda6a3e6c2d2c 100644 (file)
 
 #include <string>
 
+#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);
index f6f2a3c1d7e5a46c19b90b23e1c141c40903874e..4c2e750413852e32586b73410452d78bded66d04 100644 (file)
 #include <vector>
 #include <iostream>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class Configuration
 {
    public:
index f96dc72dcbd7961d1ffe5fc48fae41278d26a2ff..8a986b82b805fce6129d251a347ea4c2009291ac 100644 (file)
 
 #include <zlib.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 /* Define this for python-apt */
 #define APT_HAS_GZIP 1
 
index 81851dedeb2d3b0f47c6de3a9f06ccedf24394c4..b206eccb81ff1cc1d786565a28f4b63f96251872 100644 (file)
 #include <vector>
 #include <cstring>
 
+
+#ifndef APT_8_CLEANER_HEADERS
+using std::min;
+using std::vector;
+#endif
+
 // helper class that contains hash function name
 // and hash
 class HashString
index 27d192b82ad92e61c3226bd2b00d30961ed928ad..6301ac9d0aca324c967a77ac62767ce4c36bfb5b 100644 (file)
 #include <algorithm>
 #include <stdint.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::min;
+#endif
+
 template<int N>
 class HashSumValue
 {
index a207da4e4f8d6615379549cf900f1d8ea4cfbe8e..25631b1668058749ba0dc7e93e729e055f3e6ea1 100644 (file)
 
 #include "hashsum_template.h"
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::min;
+#endif
+
 typedef HashSumValue<128> MD5SumValue;
 
 class MD5Summation : public SummationImplementation
index 2ed4a95f8be576335b30cdc796911b3ebd3a9c90..602de94f8fffca140504d99a5d7ead27aedf5653 100644 (file)
 
 #include <string>
 
+#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
index 7635719bc348a4a08d8eb5d64d9a87c6f287c784..3a6943aee5731325a70b1913b3a29aabc0fab76a 100644 (file)
 #include <string>
 #include <sys/time.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class Configuration;
 class OpProgress
 {
index b4b139a222bdf2194b69a15356e257842aa3e072..a8d55eb13d5a77e5f2e5fd0313ae48be29bab47d 100644 (file)
 
 #include "hashsum_template.h"
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::min;
+#endif
+
 typedef  HashSumValue<160> SHA1SumValue;
 
 class SHA1Summation : public SummationImplementation
index 93f4bef4f383cb04e923199cbaaa969607de0910..337139d5d53050ff746221f23d2e714ef54da590 100644 (file)
 
 #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);
index 6b62360b7a14797a440eab7054b11153aed00c80..aab39f633a9a1e4c3a5018102d939899deadb98c 100644 (file)
 #include <map>
 #include <stdio.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::vector;
+using std::map;
+#endif
+
 class pkgDPkgPMPrivate;
 
 class pkgDPkgPM : public pkgPackageManager
index 21294ae7ed29ee49ded2a6089c1477b03c6a0da6..e3de1afd97f1f6454d1a20ec43bd8802fadbc164 100644 (file)
 #include <string>
 #include <stdio.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::vector;
+#endif
+
 class pkgTagSection;
 class FileFd;
 class indexRecords;
index 5e162a846847e1e020f643e55177e9bb7cc72d1d..1d34dc773bb3123cfef7681d76dc45b96568e93b 100644 (file)
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/macros.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class pkgAcquire;
 class pkgCacheGenerator;
 class OpProgress;
index 9cc79a7a62a43f0e041d6803361ce2d7eecaf1df..0f95257e07ee41e116acef75e7ba3134db3df7d2 100644 (file)
@@ -6,6 +6,10 @@
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/indexfile.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class pkgAcquire;
 class pkgCacheGenerator;
 class OpProgress;
index d4989a6e04e3ef4ad6e11163a697c427571e1b07..1d807795d30f4f74cd35ced50f3fd0ab44359d5e 100644 (file)
 #include <iostream>
 #include <set>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class pkgAcquire;
 class pkgDepCache;
 class pkgSourceList;
index fd1a021492b8c64ad3843fe4c514f90783d01151..1a7013551a5c9c57ae7a7733277e076042ba017e 100644 (file)
 #ifndef PKGLIB_PKGCACHE_H
 #define PKGLIB_PKGCACHE_H
 
-
 #include <string>
 #include <time.h>
 #include <apt-pkg/mmap.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class pkgVersioningSystem;
 class pkgCache                                                         /*{{{*/
 {
index 3c8246e3b179efc3884924678401b4d70a7a2394..5172a3c3b9419b5759e8ea701d503c659984c6c5 100644 (file)
 #include <apt-pkg/versionmatch.h>
 #include <vector>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::vector;
+#endif
+
 class pkgPolicy : public pkgDepCache::Policy
 {
    protected:
index a55bc74fa2cd2c94d63c2958a21bdb05d371514e..06f0dce6c02ff5a8fbc94d4b999e4646919522ca 100644 (file)
 #include <string>
 #include <vector>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::vector;
+#endif
+
 class pkgSourceList;
 class pkgIndexFile;
 class pkgSrcRecords
index 9b157378cc47d63c2d4f8fe269ecc7cb27fb0810..6484adf9b0e54845a0cec03a53164ba30b081721 100644 (file)
@@ -6,6 +6,10 @@
 
 #include <apt-pkg/macros.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 // A class representing a particular software provider.
 class __deprecated Vendor
 {
index 733d23a320ac239e12d242ee8dd69c5b1e144df8..4e050477f039e9a1ae2c30d407d36a8b32609cca 100644 (file)
 #include <vector>
 #include <apt-pkg/macros.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+using std::vector;
+#endif
+
 class Vendor;
 class Configuration;
 
index 92dbc2576732edde7bd8c17bdf3375f000b8c185..e0e0e6c1410f87f86d1aa41527306bc3c4ea907f 100644 (file)
 #include <apt-pkg/strutl.h>
 #include <string>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class pkgVersioningSystem
 {
    public:
index da103fc5b5fec0c438e3afc1b5523ea04a2a7a79..433396fc957885d6aa18ef5069dd31ec60f410ed 100644 (file)
 #include <string>
 #include <apt-pkg/pkgcache.h>
 
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
 class pkgVersionMatch
 {   
    // Version Matching