This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc-3.1: problems with filebuf constructor for FILE*

> I find that __c_file_type (as used in <bits/basic_file.h>) is
> undefined when I
> compile code that includes <ext/stdio_filebuf.h>.  Introducing my own
> "#define __c_file_type std::__c_file" seems to fix that.
> Then I run into the problem that <bits/basic_file.h> is looking for 
> _M_cfile
> member variable that is no longer there, as shown below (at the bottom
> of this e-mail).  Adding my own
> alleviate that confusion.
> Now I'm struggling with a conflict between const is_open methods at
> one level
> that invoke non-const is_open methods, so I see the warning:

You'll need to provide a minimal testcase, please. 

This, for instance, works:

#include <ext/stdio_filebuf.h>

int main()
  using namespace std;
  using __gnu_cxx::stdio_filebuf;

  stdio_filebuf<char> one(0, ios_base::in, true, BUFSIZ);

  __c_file* f = fopen("tmp", "rw");
  stdio_filebuf<char> two(f, ios_base::in, BUFSIZ);

  return 0;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]