[uClibc-cvs] svn commit: trunk/uClibc++/include
gkajmowi at uclibc.org
gkajmowi at uclibc.org
Tue Jun 21 10:28:33 UTC 2005
Author: gkajmowi
Date: 2005-06-21 04:28:32 -0600 (Tue, 21 Jun 2005)
New Revision: 10558
Log:
Added more symbol export declarations to the appropriate files to deal with G++ export attributes.
Modified:
trunk/uClibc++/include/fstream
trunk/uClibc++/include/istream
trunk/uClibc++/include/vector
Changeset:
Modified: trunk/uClibc++/include/fstream
===================================================================
--- trunk/uClibc++/include/fstream 2005-06-21 01:45:32 UTC (rev 10557)
+++ trunk/uClibc++/include/fstream 2005-06-21 10:28:32 UTC (rev 10558)
@@ -65,7 +65,7 @@
//Constructors/destructor:
- basic_filebuf() : basic_streambuf<charT, traits>(), fp(0), pbuffer(0), gbuffer(0)
+ _UCXXEXPORT basic_filebuf() : basic_streambuf<charT, traits>(), fp(0), pbuffer(0), gbuffer(0)
{
pbuffer = new char_type[__UCLIBCXX_IOSTREAM_BUFSIZE__];
gbuffer = new char_type[__UCLIBCXX_IOSTREAM_BUFSIZE__];
@@ -77,7 +77,7 @@
}
- virtual ~basic_filebuf(){
+ _UCXXEXPORT virtual ~basic_filebuf(){
close();
delete [] pbuffer;
delete [] gbuffer;
@@ -88,14 +88,14 @@
//Members:
- bool is_open() const{
+ _UCXXEXPORT bool is_open() const{
if(fp == 0){
return false;
}
return true;
}
- basic_filebuf<charT,traits>* open(const char* s, ios_base::openmode mode){
+ _UCXXEXPORT basic_filebuf<charT,traits>* open(const char* s, ios_base::openmode mode){
bool move_end = (mode & ios_base::ate) != 0;
if(is_open() !=false){ //Must call close() first
return 0;
@@ -151,7 +151,7 @@
return this;
}
- basic_filebuf<charT,traits>* close(){
+ _UCXXEXPORT basic_filebuf<charT,traits>* close(){
if(fp != 0){
overflow();
int retval = fclose(fp);
@@ -163,15 +163,15 @@
return this;
}
protected:
- basic_filebuf(const basic_filebuf<charT,traits> &){ }
- basic_filebuf<charT,traits> & operator=(const basic_filebuf<charT,traits> &){ return *this; }
+ _UCXXEXPORT basic_filebuf(const basic_filebuf<charT,traits> &){ }
+ _UCXXEXPORT basic_filebuf<charT,traits> & operator=(const basic_filebuf<charT,traits> &){ return *this; }
//Overridden virtual functions:
- virtual int showmanyc(){
+ virtual _UCXXEXPORT int showmanyc(){
return basic_streambuf<charT,traits>::egptr() - basic_streambuf<charT,traits>::gptr();
}
- virtual int_type underflow(){
+ virtual _UCXXEXPORT int_type underflow(){
/* Some variables used internally:
Buffer pointers:
charT * mgbeg;
@@ -266,7 +266,7 @@
return traits::to_int_type(*basic_streambuf<charT,traits>::gptr());
}
- virtual int_type uflow(){
+ virtual _UCXXEXPORT int_type uflow(){
bool dobump = (basic_streambuf<charT,traits>::gptr() != 0);
int_type retval = underflow();
if(dobump){
@@ -274,7 +274,7 @@
}
return retval;
}
- virtual int_type pbackfail(int_type c = traits::eof()){
+ virtual _UCXXEXPORT int_type pbackfail(int_type c = traits::eof()){
if(is_open() == false ||
basic_streambuf<charT,traits>::gptr() == basic_streambuf<charT,traits>::eback())
{
@@ -294,7 +294,7 @@
}
}
- virtual int_type overflow (int_type c = traits::eof()){
+ virtual _UCXXEXPORT int_type overflow (int_type c = traits::eof()){
if(is_open() == false){
//Can't do much
return traits::eof();
@@ -351,7 +351,7 @@
return traits::not_eof(c);
}
- virtual basic_streambuf<charT,traits>* setbuf(char_type* s, streamsize n){
+ virtual _UCXXEXPORT basic_streambuf<charT,traits>* setbuf(char_type* s, streamsize n){
if(s == 0 && n == 0){ //Unbuffered
if(pbuffer !=0){
delete [] pbuffer;
@@ -369,7 +369,7 @@
}
return this;
}
- virtual pos_type seekoff(off_type off, ios_base::seekdir way,
+ virtual _UCXXEXPORT pos_type seekoff(off_type off, ios_base::seekdir way,
ios_base::openmode = ios_base::in | ios_base::out)
{
if(is_open() == false){
@@ -402,7 +402,7 @@
return retval;
}
- virtual pos_type seekpos(pos_type sp, ios_base::openmode = ios_base::in | ios_base::out){
+ virtual _UCXXEXPORT pos_type seekpos(pos_type sp, ios_base::openmode = ios_base::in | ios_base::out){
if(is_open() == false){
return -1;
}
@@ -417,7 +417,7 @@
}
return -1;
}
- virtual int sync(){
+ virtual _UCXXEXPORT int sync(){
if(pbuffer !=0){
if(overflow() == traits::eof()){
return -1;
@@ -428,12 +428,12 @@
}
return 0;
}
- virtual void imbue(const locale&){
+ virtual _UCXXEXPORT void imbue(const locale&){
return;
}
- virtual streamsize xsputn(const char_type* s, streamsize n){
+ virtual _UCXXEXPORT streamsize xsputn(const char_type* s, streamsize n){
if(is_open() == false){
return 0;
}
@@ -585,10 +585,10 @@
typedef typename traits::pos_type pos_type;
typedef typename traits::off_type off_type;
- basic_ifstream(): basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb){
+ _UCXXEXPORT basic_ifstream(): basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb){
//Passing the address of sb
}
- explicit basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in)
+ explicit _UCXXEXPORT basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in)
: basic_ios<charT, traits>(&sb), basic_istream<charT,traits>(&sb)
{
if(sb.open(s, mode) == 0){
@@ -596,24 +596,24 @@
}
}
- virtual ~basic_ifstream(){
+ virtual _UCXXEXPORT ~basic_ifstream(){
}
- basic_filebuf<charT,traits>* rdbuf() const{
+ _UCXXEXPORT basic_filebuf<charT,traits>* rdbuf() const{
return (basic_filebuf<charT,traits>*)&sb;
}
- bool is_open() const{
+ _UCXXEXPORT bool is_open() const{
return sb.is_open();
}
- void open(const char* s, ios_base::openmode mode = ios_base::in){
+ _UCXXEXPORT void open(const char* s, ios_base::openmode mode = ios_base::in){
sb.open(s, mode);
}
- void close(){
+ _UCXXEXPORT void close(){
sb.close();
}
private:
- basic_filebuf<charT,traits> sb;
+ _UCXXEXPORT basic_filebuf<charT,traits> sb;
};
@@ -626,13 +626,13 @@
typedef typename traits::pos_type pos_type;
typedef typename traits::off_type off_type;
- basic_ofstream() : basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb){
+ _UCXXEXPORT basic_ofstream() : basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb){
}
- virtual ~basic_ofstream();
+ virtual _UCXXEXPORT ~basic_ofstream();
- explicit basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out | ios_base::trunc) :
+ explicit _UCXXEXPORT basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out | ios_base::trunc) :
basic_ios<charT, traits>(&sb), basic_ostream<charT,traits>(&sb)
{
if(sb.open(s, mode) == 0){
@@ -640,17 +640,17 @@
}
}
- basic_filebuf<charT,traits>* rdbuf() const{
+ _UCXXEXPORT basic_filebuf<charT,traits>* rdbuf() const{
return (basic_filebuf<charT,traits>*)&sb;
}
- bool is_open() const{
+ _UCXXEXPORT bool is_open() const{
return sb.is_open();
}
- void open(const char* s, ios_base::openmode mode = ios_base::out | ios_base::trunc){
+ _UCXXEXPORT void open(const char* s, ios_base::openmode mode = ios_base::out | ios_base::trunc){
sb.open(s, mode);
}
- void close(){
+ _UCXXEXPORT void close(){
sb.close();
}
private:
@@ -671,24 +671,24 @@
typedef typename traits::pos_type pos_type;
typedef typename traits::off_type off_type;
- basic_fstream(): basic_ios<charT, traits>(&sb), basic_iostream<charT,traits>(&sb){ }
+ _UCXXEXPORT basic_fstream(): basic_ios<charT, traits>(&sb), basic_iostream<charT,traits>(&sb){ }
- explicit basic_fstream(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out):
+ explicit _UCXXEXPORT basic_fstream(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out):
basic_ios<charT, traits>(&sb), basic_iostream<charT,traits>(&sb)
{
sb.open(s, mode);
}
- basic_filebuf<charT,traits>* rdbuf() const{
+ _UCXXEXPORT basic_filebuf<charT,traits>* rdbuf() const{
return (basic_filebuf<charT,traits>*)&sb;
}
- bool is_open() const{
+ _UCXXEXPORT bool is_open() const{
return sb.is_open();
}
- void open(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out){
+ _UCXXEXPORT void open(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out){
sb.open(s, mode);
}
- void close(){
+ _UCXXEXPORT void close(){
sb.close();
}
private:
Modified: trunk/uClibc++/include/istream
===================================================================
--- trunk/uClibc++/include/istream 2005-06-21 01:45:32 UTC (rev 10557)
+++ trunk/uClibc++/include/istream 2005-06-21 10:28:32 UTC (rev 10558)
@@ -332,7 +332,7 @@
protected:
_UCXXEXPORT basic_istream(const basic_istream<charT,traits> &): basic_ios<charT, traits>() { }
- _UCXXEXPORT basic_streambuf<charT,traits>* sbuffer;
+ basic_streambuf<charT,traits>* sbuffer;
_UCXXEXPORT basic_istream<charT,traits> & operator=(const basic_istream<charT,traits> &){ return *this; }
streamsize count_last_ufmt_input;
@@ -371,7 +371,7 @@
//For code reduction
template <class charT, class traits>
- typename _UCXXEXPORT basic_istream<charT,traits>::int_type basic_istream<charT,traits>::get(){
+ _UCXXEXPORT typename basic_istream<charT,traits>::int_type basic_istream<charT,traits>::get(){
sentry(*this, true);
int_type retval = sbuffer->sgetc();
if(retval == traits::eof()){
Modified: trunk/uClibc++/include/vector
===================================================================
--- trunk/uClibc++/include/vector 2005-06-21 01:45:32 UTC (rev 10557)
+++ trunk/uClibc++/include/vector 2005-06-21 10:28:32 UTC (rev 10558)
@@ -66,13 +66,13 @@
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- explicit vector(const Allocator& al= Allocator()): data(0), //defaultValue(T()),
+ explicit _UCXXEXPORT vector(const Allocator& al= Allocator()): data(0), //defaultValue(T()),
data_size(__UCLIBCXX_STL_BUFFER_SIZE__), elements(0), a(al)
{
data = a.allocate(data_size);
}
- explicit vector(size_type n, const T& value = T(), const Allocator& al= Allocator()) :
+ explicit _UCXXEXPORT vector(size_type n, const T& value = T(), const Allocator& al= Allocator()) :
data(0),
data_size(0), elements(0), a(al)
{
@@ -82,15 +82,15 @@
resize(n, value);
}
- template <class InputIterator> vector(InputIterator first, InputIterator last, const Allocator& al = Allocator()):
- data(0),
- data_size(__UCLIBCXX_STL_BUFFER_SIZE__), elements(0), a(al)
+ template <class InputIterator> _UCXXEXPORT
+ vector(InputIterator first, InputIterator last, const Allocator& al = Allocator()):
+ data(0), data_size(__UCLIBCXX_STL_BUFFER_SIZE__), elements(0), a(al)
{
data = a.allocate(data_size);
assign(first, last);
}
- vector(const vector<T,Allocator>& x){
+ _UCXXEXPORT vector(const vector<T,Allocator>& x){
a = x.a;
elements = x.elements;
@@ -102,9 +102,9 @@
}
}
- ~vector(); //Below
+ _UCXXEXPORT ~vector(); //Below
- vector<T,Allocator>& operator=(const vector<T,Allocator>& x){
+ _UCXXEXPORT vector<T,Allocator>& operator=(const vector<T,Allocator>& x){
if(&x == this){
return *this;
}
@@ -137,12 +137,12 @@
return *this;
}
- template <class InputIterator> void assign(InputIterator first, InputIterator last){
+ template <class InputIterator> _UCXXEXPORT void assign(InputIterator first, InputIterator last){
clear();
insert(begin(), first, last);
}
- template <class Size, class U> void assign(Size n, const U& u = U()){
+ template <class Size, class U> _UCXXEXPORT void assign(Size n, const U& u = U()){
// void assign(size_type n, const T& u ){
clear();
resize(n, u);
@@ -188,7 +188,7 @@
return elements;
}
- size_type max_size() const{
+ _UCXXEXPORT size_type max_size() const{
return ((size_type)(-1)) / sizeof(T);
}
@@ -213,14 +213,14 @@
return data[n];
}
- const_reference at(size_type n) const{
+ _UCXXEXPORT const_reference at(size_type n) const{
if(n >= elements){
__throw_out_of_range("Invalid subscript");
}
return data[n];
}
- reference at(size_type n){
+ _UCXXEXPORT reference at(size_type n){
if(n >= elements){
__throw_out_of_range("Invalid subscript");
}
@@ -252,7 +252,7 @@
downsize(size() - 1);
}
- iterator insert(iterator position, const T& x = T()){
+ _UCXXEXPORT iterator insert(iterator position, const T& x = T()){
size_type index = position - data;
resize(size() + 1, x);
for(size_type i = elements - 1; i > index; --i){
@@ -262,7 +262,7 @@
return (data + index);
}
- void _insert_fill(iterator position, size_type n, const T & x){
+ _UCXXEXPORT void _insert_fill(iterator position, size_type n, const T & x){
size_type index = position - data;
resize(size() + n, x);
@@ -274,7 +274,9 @@
}
}
- template <class InputIterator> void _insert_from_iterator(iterator position, InputIterator first, InputIterator last){
+ template <class InputIterator> _UCXXEXPORT
+ void _insert_from_iterator(iterator position, InputIterator first, InputIterator last)
+ {
T temp;
while(first !=last){
temp = *first;
@@ -305,7 +307,7 @@
_dispatch_insert(position, first, last, __some_type());
}
- iterator erase(iterator position){
+ _UCXXEXPORT iterator erase(iterator position){
size_type index = position - data;
for(size_type i = index; i < (elements - 1); ++i){
data[i] = data[i+1];
@@ -314,7 +316,7 @@
return (data + index);
}
- iterator erase(iterator first, iterator last){
+ _UCXXEXPORT iterator erase(iterator first, iterator last){
size_type index = first - data;
size_type width = last - first;
for(size_type i = index; i < (elements - width) ;++i){
@@ -324,8 +326,7 @@
return (data + index);
}
-
- void swap(vector<T,Allocator>& v){
+ _UCXXEXPORT void swap(vector<T,Allocator>& v){
if(this == &v){ //Avoid dv.swap(v)
return;
}
@@ -348,7 +349,7 @@
v.data_size = temp;
}
- void clear(){
+ _UCXXEXPORT void clear(){
elements = 0;
}
@@ -363,7 +364,7 @@
//Here go template instantiations
- template<class T, class Allocator> vector<T, Allocator>::~vector(){
+ template<class T, class Allocator> _UCXXEXPORT vector<T, Allocator>::~vector(){
for(size_t i = 0; i < elements; ++i){
a.destroy(data + i);
}
@@ -374,7 +375,7 @@
}
- template<class T, class Allocator> void vector<T, Allocator>::reserve(size_type n){
+ template<class T, class Allocator> _UCXXEXPORT void vector<T, Allocator>::reserve(size_type n){
if(n > data_size){ //We never shrink...
T * temp_ptr = data;
size_type temp_size = data_size;
@@ -390,7 +391,7 @@
}
}
- template<class T, class Allocator> void vector<T, Allocator>::resize(size_type sz, const T & c){
+ template<class T, class Allocator> _UCXXEXPORT void vector<T, Allocator>::resize(size_type sz, const T & c){
if(sz > elements){ //Need to actually call constructor
if(sz > data_size){
reserve(sz + __UCLIBCXX_STL_BUFFER_SIZE__);
@@ -405,7 +406,7 @@
}
}
- template<class T, class Allocator> void vector<T, Allocator>::downsize(size_type sz){
+ template<class T, class Allocator> _UCXXEXPORT void vector<T, Allocator>::downsize(size_type sz){
if(sz < elements){ //Actually are downsizing
for(size_t i = sz; i< elements; ++i){
a.destroy(data+i);
More information about the uClibc-cvs
mailing list