This is the mail archive of the
mailing list for the libstdc++ project.
Re: gcc-3.1: problems with filebuf constructor for FILE*
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: "Scott Johnston" <scott at accom dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Wed, 24 Jul 2002 01:09:09 -0700
- Subject: Re: gcc-3.1: problems with filebuf constructor for FILE*
- Organization: Red Hat / San Francisco
- References: <3D3DEA56.firstname.lastname@example.org>
- Reply-to: bkoz at redhat dot com
> 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
> member variable that is no longer there, as shown below (at the bottom
> of this e-mail). Adding my own
> "#define _GLIBCPP_BASIC_FILE_ENCAPSULATION 1" seems to
> 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:
using namespace std;
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);