From 5923e20b7e217cd2dfb9cbb2ef1d09ea88899922 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 13 Sep 2002 22:57:04 +0000 Subject: [PATCH] Roll back MinGW 2.0 "fix" that still doesn't work, and breaks MSVC6. [SVN r15313] --- include/boost/python/dict.hpp | 38 +++++----- include/boost/python/list.hpp | 34 ++++----- include/boost/python/long.hpp | 12 ++-- include/boost/python/str.hpp | 124 ++++++++++++++++----------------- include/boost/python/tuple.hpp | 8 +-- 5 files changed, 108 insertions(+), 108 deletions(-) diff --git a/include/boost/python/dict.hpp b/include/boost/python/dict.hpp index 58d4635d..b593f902 100644 --- a/include/boost/python/dict.hpp +++ b/include/boost/python/dict.hpp @@ -8,15 +8,15 @@ namespace boost { namespace python { -class BOOST_PYTHON_DECL dict : public object +class dict : public object { public: // dict() -> new empty dictionary. // dict(mapping) -> new dictionary initialized from a mapping object's // (key, value) pairs. // dict(seq) -> new dictionary initialized as if via: - dict(); // new dict - explicit dict(object_cref data); + BOOST_PYTHON_DECL dict(); // new dict + explicit BOOST_PYTHON_DECL dict(object_cref data); template explicit dict(T const& data) @@ -25,13 +25,13 @@ class BOOST_PYTHON_DECL dict : public object } // D.clear() -> None. Remove all items from D. - void clear(); + BOOST_PYTHON_DECL void clear(); // D.copy() -> a shallow copy of D - dict copy(); + BOOST_PYTHON_DECL dict copy(); // D.get(k[,d]) -> D[k] if D.has_key(k), else d. d defaults to None. - object get(object_cref k) const; + BOOST_PYTHON_DECL object get(object_cref k) const; template object get(T const& k) const @@ -39,7 +39,7 @@ class BOOST_PYTHON_DECL dict : public object return this->get(object(k)); } - object get(object_cref k, object_cref d) const; + BOOST_PYTHON_DECL object get(object_cref k, object_cref d) const; template object get(T1 const& k, T2 const& d) const @@ -48,7 +48,7 @@ class BOOST_PYTHON_DECL dict : public object } // D.has_key(k) -> 1 if D has a key k, else 0 - bool has_key(object_cref k) const; + BOOST_PYTHON_DECL bool has_key(object_cref k) const; template bool has_key(T const& k) const @@ -57,26 +57,26 @@ class BOOST_PYTHON_DECL dict : public object } // D.items() -> list of D's (key, value) pairs, as 2-tuples - list items() const; + BOOST_PYTHON_DECL list items() const; // D.iteritems() -> an iterator over the (key, value) items of D - object iteritems() const; + BOOST_PYTHON_DECL object iteritems() const; // D.iterkeys() -> an iterator over the keys of D - object iterkeys() const; + BOOST_PYTHON_DECL object iterkeys() const; // D.itervalues() -> an iterator over the values of D - object itervalues() const; + BOOST_PYTHON_DECL object itervalues() const; // D.keys() -> list of D's keys - list keys() const; + BOOST_PYTHON_DECL list keys() const; // D.popitem() -> (k, v), remove and return some (key, value) pair as a // 2-tuple; but raise KeyError if D is empty - tuple popitem(); + BOOST_PYTHON_DECL tuple popitem(); // D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if not D.has_key(k) - object setdefault(object_cref k); + BOOST_PYTHON_DECL object setdefault(object_cref k); template object setdefault(T const& k) @@ -84,7 +84,7 @@ class BOOST_PYTHON_DECL dict : public object return this->setdefault(object(k)); } - object setdefault(object_cref k, object_cref d); + BOOST_PYTHON_DECL object setdefault(object_cref k, object_cref d); template object setdefault(T1 const& k, T2 const& d) @@ -93,7 +93,7 @@ class BOOST_PYTHON_DECL dict : public object } // D.update(E) -> None. Update D from E: for k in E.keys(): D[k] = E[k] - void update(object_cref E); + BOOST_PYTHON_DECL void update(object_cref E); template void update(T const& E) @@ -102,13 +102,13 @@ class BOOST_PYTHON_DECL dict : public object } // D.values() -> list of D's values - list values() const; + BOOST_PYTHON_DECL list values() const; public: // implementation detail -- for internal use only BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(dict) private: - static detail::new_reference call(object const&); + static BOOST_PYTHON_DECL detail::new_reference call(object const&); }; diff --git a/include/boost/python/list.hpp b/include/boost/python/list.hpp index f851a7f1..501eeed5 100644 --- a/include/boost/python/list.hpp +++ b/include/boost/python/list.hpp @@ -11,11 +11,11 @@ namespace boost { namespace python { -class BOOST_PYTHON_DECL list : public object +class list : public object { public: - list(); // new list - explicit list(object_cref sequence); // new list initialized from sequence's items + BOOST_PYTHON_DECL list(); // new list + explicit BOOST_PYTHON_DECL list(object_cref sequence); // new list initialized from sequence's items template explicit list(T const& sequence) @@ -23,7 +23,7 @@ class BOOST_PYTHON_DECL list : public object { } - void append(object_cref); // append object to end + BOOST_PYTHON_DECL void append(object_cref); // append object to end template void append(T const& x) @@ -31,7 +31,7 @@ class BOOST_PYTHON_DECL list : public object this->append(object(x)); } - long count(object_cref value) const; // return number of occurrences of value + BOOST_PYTHON_DECL long count(object_cref value) const; // return number of occurrences of value template long count(T const& value) const @@ -39,7 +39,7 @@ class BOOST_PYTHON_DECL list : public object return this->count(object(value)); } - void extend(object_cref sequence); // extend list by appending sequence elements + BOOST_PYTHON_DECL void extend(object_cref sequence); // extend list by appending sequence elements template void extend(T const& x) @@ -47,7 +47,7 @@ class BOOST_PYTHON_DECL list : public object this->extend(object(x)); } - long index(object_cref value) const; // return index of first occurrence of value + BOOST_PYTHON_DECL long index(object_cref value) const; // return index of first occurrence of value template long index(T const& x) const @@ -55,8 +55,8 @@ class BOOST_PYTHON_DECL list : public object return this->index(object(x)); } - void insert(int index, object_cref); // insert object before index - void insert(object const& index, object_cref); + BOOST_PYTHON_DECL void insert(int index, object_cref); // insert object before index + BOOST_PYTHON_DECL void insert(object const& index, object_cref); template void insert(int index, T const& x) // insert object before index @@ -70,11 +70,11 @@ class BOOST_PYTHON_DECL list : public object this->insert(index, object(x)); } - object pop(); // remove and return item at index (default last) - object pop(long index); - object pop(object const& index); + BOOST_PYTHON_DECL object pop(); // remove and return item at index (default last) + BOOST_PYTHON_DECL object pop(long index); + BOOST_PYTHON_DECL object pop(object const& index); - void remove(object_cref value); // remove first occurrence of value + BOOST_PYTHON_DECL void remove(object_cref value); // remove first occurrence of value template void remove(T const& value) @@ -82,10 +82,10 @@ class BOOST_PYTHON_DECL list : public object this->remove(object(value)); } - void reverse(); // reverse *IN PLACE* + BOOST_PYTHON_DECL void reverse(); // reverse *IN PLACE* - void sort(); // sort *IN PLACE*; if given, cmpfunc(x, y) -> -1, 0, 1 - void sort(object_cref cmpfunc); + BOOST_PYTHON_DECL void sort(); // sort *IN PLACE*; if given, cmpfunc(x, y) -> -1, 0, 1 + BOOST_PYTHON_DECL void sort(object_cref cmpfunc); template void sort(T const& value) @@ -97,7 +97,7 @@ class BOOST_PYTHON_DECL list : public object BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(list) private: - static detail::new_non_null_reference call(object const&); + static BOOST_PYTHON_DECL detail::new_non_null_reference call(object const&); }; // diff --git a/include/boost/python/long.hpp b/include/boost/python/long.hpp index 690a630b..3ba4f434 100644 --- a/include/boost/python/long.hpp +++ b/include/boost/python/long.hpp @@ -11,11 +11,11 @@ namespace boost { namespace python { -class BOOST_PYTHON_DECL long_ : public object +class long_ : public object { public: - long_(); // new long_ - explicit long_(object_cref rhs); + BOOST_PYTHON_DECL long_(); // new long_ + explicit BOOST_PYTHON_DECL long_(object_cref rhs); template explicit long_(T const& rhs) @@ -23,7 +23,7 @@ class BOOST_PYTHON_DECL long_ : public object { } - explicit long_(object_cref rhs, object_cref base); + explicit BOOST_PYTHON_DECL long_(object_cref rhs, object_cref base); template explicit long_(T const& rhs, U const& base) @@ -34,8 +34,8 @@ class BOOST_PYTHON_DECL long_ : public object BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_) private: - static detail::new_non_null_reference call(object const&); - static detail::new_non_null_reference call(object const&, object const&); + static BOOST_PYTHON_DECL detail::new_non_null_reference call(object const&); + static BOOST_PYTHON_DECL detail::new_non_null_reference call(object const&, object const&); }; // diff --git a/include/boost/python/str.hpp b/include/boost/python/str.hpp index 2a0e0e97..fb8bfe58 100644 --- a/include/boost/python/str.hpp +++ b/include/boost/python/str.hpp @@ -15,13 +15,13 @@ namespace boost { namespace python { -class BOOST_PYTHON_DECL str : public object +class str : public object { public: - str(); // new str + BOOST_PYTHON_DECL str(); // new str - str(const char* s); // new str - explicit str(object_cref other); + BOOST_PYTHON_DECL str(const char* s); // new str + explicit BOOST_PYTHON_DECL str(object_cref other); template explicit str(T const& other) @@ -29,9 +29,9 @@ class BOOST_PYTHON_DECL str : public object { } - str capitalize() const ; + BOOST_PYTHON_DECL str capitalize() const ; - str center(object_cref width) const ; + BOOST_PYTHON_DECL str center(object_cref width) const ; template str center(T const& width) const @@ -39,7 +39,7 @@ class BOOST_PYTHON_DECL str : public object return this->center(object(width)); } - long count(object_cref sub) const; + BOOST_PYTHON_DECL long count(object_cref sub) const; template long count(T const& sub) const @@ -47,7 +47,7 @@ class BOOST_PYTHON_DECL str : public object return this->count(object(sub)); } - long count(object_cref sub, object_cref start) const; + BOOST_PYTHON_DECL long count(object_cref sub, object_cref start) const; template long count(T1 const& sub,T2 const& start) const @@ -55,7 +55,7 @@ class BOOST_PYTHON_DECL str : public object return this->count(object(sub), object(start)); } - long count(object_cref sub, object_cref start, object_cref end) const; + BOOST_PYTHON_DECL long count(object_cref sub, object_cref start, object_cref end) const; template long count(T1 const& sub,T2 const& start, T3 const& end) const @@ -63,8 +63,8 @@ class BOOST_PYTHON_DECL str : public object return this->count(object(sub), object(start)); } - object decode() const; - object decode(object_cref encoding) const; + BOOST_PYTHON_DECL object decode() const; + BOOST_PYTHON_DECL object decode(object_cref encoding) const; template object decode(T const& encoding) const @@ -72,7 +72,7 @@ class BOOST_PYTHON_DECL str : public object return this->decode(object(encoding)); } - object decode(object_cref encoding, object_cref errors) const; + BOOST_PYTHON_DECL object decode(object_cref encoding, object_cref errors) const; template object decode(T1 const& encoding, T2 const& errors) const @@ -80,8 +80,8 @@ class BOOST_PYTHON_DECL str : public object return this->decode(object(encoding),object(errors)); } - object encode() const; - object encode(object_cref encoding) const; + BOOST_PYTHON_DECL object encode() const; + BOOST_PYTHON_DECL object encode(object_cref encoding) const; template object encode(T const& encoding) const @@ -89,7 +89,7 @@ class BOOST_PYTHON_DECL str : public object return this->encode(object(encoding)); } - object encode(object_cref encoding, object_cref errors) const; + BOOST_PYTHON_DECL object encode(object_cref encoding, object_cref errors) const; template object encode(T1 const& encoding, T2 const& errors) const @@ -97,7 +97,7 @@ class BOOST_PYTHON_DECL str : public object return this->encode(object(encoding),object(errors)); } - bool endswith(object_cref suffix) const; + BOOST_PYTHON_DECL bool endswith(object_cref suffix) const; template bool endswith(T const& suffix) const @@ -105,7 +105,7 @@ class BOOST_PYTHON_DECL str : public object return this->endswith(object(suffix)); } - bool endswith(object_cref suffix, object_cref start) const; + BOOST_PYTHON_DECL bool endswith(object_cref suffix, object_cref start) const; template bool endswith(T1 const& suffix, T2 const& start) const @@ -113,7 +113,7 @@ class BOOST_PYTHON_DECL str : public object return this->endswith(object(suffix), object(start)); } - bool endswith(object_cref suffix, object_cref start, object_cref end) const; + BOOST_PYTHON_DECL bool endswith(object_cref suffix, object_cref start, object_cref end) const; template bool endswith(T1 const& suffix, T2 const& start, T3 const& end) const @@ -121,8 +121,8 @@ class BOOST_PYTHON_DECL str : public object return this->endswith(object(suffix), object(start), object(end)); } - str expandtabs() const; - str expandtabs(object_cref tabsize) const; + BOOST_PYTHON_DECL str expandtabs() const; + BOOST_PYTHON_DECL str expandtabs(object_cref tabsize) const; template str expandtabs(T const& tabsize) const @@ -130,7 +130,7 @@ class BOOST_PYTHON_DECL str : public object return this->expandtabs(object(tabsize)); } - long find(object_cref sub) const; + BOOST_PYTHON_DECL long find(object_cref sub) const; template long find(T const& sub) const @@ -138,7 +138,7 @@ class BOOST_PYTHON_DECL str : public object return this->find(object(sub)); } - long find(object_cref sub, object_cref start) const; + BOOST_PYTHON_DECL long find(object_cref sub, object_cref start) const; template long find(T1 const& sub, T2 const& start) const @@ -146,7 +146,7 @@ class BOOST_PYTHON_DECL str : public object return this->find(object(sub), object(start)); } - long find(object_cref sub, object_cref start, object_cref end) const; + BOOST_PYTHON_DECL long find(object_cref sub, object_cref start, object_cref end) const; template long find(T1 const& sub, T2 const& start, T3 const& end) const @@ -154,7 +154,7 @@ class BOOST_PYTHON_DECL str : public object return this->find(object(sub), object(start), object(end)); } - long index(object_cref sub) const; + BOOST_PYTHON_DECL long index(object_cref sub) const; template long index(T const& sub) const @@ -162,7 +162,7 @@ class BOOST_PYTHON_DECL str : public object return this->index(object(sub)); } - long index(object_cref sub, object_cref start) const; + BOOST_PYTHON_DECL long index(object_cref sub, object_cref start) const; template long index(T1 const& sub, T2 const& start) const @@ -170,7 +170,7 @@ class BOOST_PYTHON_DECL str : public object return this->index(object(sub), object(start)); } - long index(object_cref sub, object_cref start, object_cref end) const; + BOOST_PYTHON_DECL long index(object_cref sub, object_cref start, object_cref end) const; template long index(T1 const& sub, T2 const& start, T3 const& end) const @@ -178,15 +178,15 @@ class BOOST_PYTHON_DECL str : public object return this->index(object(sub), object(start), object(end)); } - bool isalnum() const; - bool isalpha() const; - bool isdigit() const; - bool islower() const; - bool isspace() const; - bool istitle() const; - bool isupper() const; + BOOST_PYTHON_DECL bool isalnum() const; + BOOST_PYTHON_DECL bool isalpha() const; + BOOST_PYTHON_DECL bool isdigit() const; + BOOST_PYTHON_DECL bool islower() const; + BOOST_PYTHON_DECL bool isspace() const; + BOOST_PYTHON_DECL bool istitle() const; + BOOST_PYTHON_DECL bool isupper() const; - str join(object_cref sequence) const; + BOOST_PYTHON_DECL str join(object_cref sequence) const; template str join(T const& sequence) const @@ -194,7 +194,7 @@ class BOOST_PYTHON_DECL str : public object return this->join(object(sequence)); } - str ljust(object_cref width) const; + BOOST_PYTHON_DECL str ljust(object_cref width) const; template str ljust(T const& width) const @@ -202,10 +202,10 @@ class BOOST_PYTHON_DECL str : public object return this->ljust(object(width)); } - str lower() const; - str lstrip() const; + BOOST_PYTHON_DECL str lower() const; + BOOST_PYTHON_DECL str lstrip() const; - str replace(object_cref old, object_cref new_) const ; + BOOST_PYTHON_DECL str replace(object_cref old, object_cref new_) const ; template str replace(T1 const& old, T2 const& new_) const @@ -213,7 +213,7 @@ class BOOST_PYTHON_DECL str : public object return this->replace(object(old),object(new_)); } - str replace(object_cref old, object_cref new_, object_cref maxsplit) const ; + BOOST_PYTHON_DECL str replace(object_cref old, object_cref new_, object_cref maxsplit) const ; template str replace(T1 const& old, T2 const& new_, T3 const& maxsplit) const @@ -221,7 +221,7 @@ class BOOST_PYTHON_DECL str : public object return this->replace(object(old),object(new_),object(maxsplit)); } - long rfind(object_cref sub) const; + BOOST_PYTHON_DECL long rfind(object_cref sub) const; template long rfind(T const& sub) const @@ -229,7 +229,7 @@ class BOOST_PYTHON_DECL str : public object return this->rfind(object(sub)); } - long rfind(object_cref sub, object_cref start) const; + BOOST_PYTHON_DECL long rfind(object_cref sub, object_cref start) const; template long rfind(T1 const& sub, T2 const& start) const @@ -237,7 +237,7 @@ class BOOST_PYTHON_DECL str : public object return this->rfind(object(sub), object(start)); } - long rfind(object_cref sub, object_cref start, object_cref end) const; + BOOST_PYTHON_DECL long rfind(object_cref sub, object_cref start, object_cref end) const; template long rfind(T1 const& sub, T2 const& start, T3 const& end) const @@ -245,7 +245,7 @@ class BOOST_PYTHON_DECL str : public object return this->rfind(object(sub), object(start), object(end)); } - long rindex(object_cref sub) const; + BOOST_PYTHON_DECL long rindex(object_cref sub) const; template long rindex(T const& sub) const @@ -253,7 +253,7 @@ class BOOST_PYTHON_DECL str : public object return this->rindex(object(sub)); } - long rindex(object_cref sub, object_cref start) const; + BOOST_PYTHON_DECL long rindex(object_cref sub, object_cref start) const; template long rindex(T1 const& sub, T2 const& start) const @@ -261,7 +261,7 @@ class BOOST_PYTHON_DECL str : public object return this->rindex(object(sub), object(start)); } - long rindex(object_cref sub, object_cref start, object_cref end) const; + BOOST_PYTHON_DECL long rindex(object_cref sub, object_cref start, object_cref end) const; template long rindex(T1 const& sub, T2 const& start, T3 const& end) const @@ -269,7 +269,7 @@ class BOOST_PYTHON_DECL str : public object return this->rindex(object(sub), object(start), object(end)); } - str rjust(object_cref width) const; + BOOST_PYTHON_DECL str rjust(object_cref width) const; template str rjust(T const& width) const @@ -277,10 +277,10 @@ class BOOST_PYTHON_DECL str : public object return this->rjust(object(width)); } - str rstrip() const; + BOOST_PYTHON_DECL str rstrip() const; - list split() const; - list split(object_cref sep) const; + BOOST_PYTHON_DECL list split() const; + BOOST_PYTHON_DECL list split(object_cref sep) const; template list split(T const& sep) const @@ -288,7 +288,7 @@ class BOOST_PYTHON_DECL str : public object return this->split(object(sep)); } - list split(object_cref sep, object_cref maxsplit) const; + BOOST_PYTHON_DECL list split(object_cref sep, object_cref maxsplit) const; template list split(T1 const& sep, T2 const& maxsplit) const @@ -296,8 +296,8 @@ class BOOST_PYTHON_DECL str : public object return this->split(object(sep), object(maxsplit)); } - list splitlines() const; - list splitlines(object_cref keepends) const; + BOOST_PYTHON_DECL list splitlines() const; + BOOST_PYTHON_DECL list splitlines(object_cref keepends) const; template list splitlines(T const& keepends) const @@ -305,7 +305,7 @@ class BOOST_PYTHON_DECL str : public object return this->splitlines(object(keepends)); } - bool startswith(object_cref prefix) const ; + BOOST_PYTHON_DECL bool startswith(object_cref prefix) const ; template bool startswith(T const& prefix) const @@ -313,7 +313,7 @@ class BOOST_PYTHON_DECL str : public object return this->startswith(object(prefix)); } - bool startswith(object_cref prefix, object_cref start) const ; + BOOST_PYTHON_DECL bool startswith(object_cref prefix, object_cref start) const ; template bool startswidth(T1 const& prefix, T2 const& start) const @@ -321,7 +321,7 @@ class BOOST_PYTHON_DECL str : public object return this->startswidth(object(prefix), object(start)); } - bool startswith(object_cref prefix, object_cref start, object_cref end) const ; + BOOST_PYTHON_DECL bool startswith(object_cref prefix, object_cref start, object_cref end) const ; template bool startswidth(T1 const& prefix, T2 const& start, T3 const& end) const @@ -329,11 +329,11 @@ class BOOST_PYTHON_DECL str : public object return this->startswidth(object(prefix), object(start), object(end)); } - str strip() const ; - str swapcase() const ; - str title() const ; + BOOST_PYTHON_DECL str strip() const ; + BOOST_PYTHON_DECL str swapcase() const ; + BOOST_PYTHON_DECL str title() const ; - str translate(object_cref table) const; + BOOST_PYTHON_DECL str translate(object_cref table) const; template str translate(T const& table) const @@ -341,7 +341,7 @@ class BOOST_PYTHON_DECL str : public object return this->translate(object(table)); } - str translate(object_cref table, object_cref deletechars) const; + BOOST_PYTHON_DECL str translate(object_cref table, object_cref deletechars) const; template str translate(T1 const& table, T2 const& deletechars) const @@ -349,13 +349,13 @@ class BOOST_PYTHON_DECL str : public object return this->translate(object(table), object(deletechars)); } - str upper() const; + BOOST_PYTHON_DECL str upper() const; public: // implementation detail -- for internal use only BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(str) private: - static detail::new_reference call(object const&); + static BOOST_PYTHON_DECL detail::new_reference call(object const&); }; // diff --git a/include/boost/python/tuple.hpp b/include/boost/python/tuple.hpp index 133bc49b..38547696 100644 --- a/include/boost/python/tuple.hpp +++ b/include/boost/python/tuple.hpp @@ -6,14 +6,14 @@ namespace boost { namespace python { -class BOOST_PYTHON_DECL tuple : public object +class tuple : public object { public: // tuple() -> an empty tuple - tuple(); + BOOST_PYTHON_DECL tuple(); // tuple(sequence) -> tuple initialized from sequence's items - tuple(object_cref sequence); + BOOST_PYTHON_DECL tuple(object_cref sequence); template explicit tuple(T const& sequence) @@ -25,7 +25,7 @@ class BOOST_PYTHON_DECL tuple : public object BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(tuple) private: - static detail::new_reference call(object const&); + static BOOST_PYTHON_DECL detail::new_reference call(object const&); }; //