[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] compilation error on mingw
From: |
Thomas Keller |
Subject: |
Re: [Monotone-devel] compilation error on mingw |
Date: |
Fri, 27 Nov 2009 01:33:09 +0100 |
User-agent: |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; de; rv:1.9.1.4pre) Gecko/20090915 Lightning/1.0pre Thunderbird/3.0b4 |
Am 24.11.09 15:44, schrieb Stephen Leake:
> Stephen Leake <address@hidden> writes:
>
>> With nvm.monotone head (033d74ef283f7bc7c27068ce548687c08cfbbed8
>> address@hidden 2009-11-20T22:04:15) I'm getting compilation
>> errors on Mingw (g++.exe (GCC) 3.4.5 (mingw-vista special r3)) (after
>> a clean start from scratch):
>>
>> In file included from ../monotone/cmd_netsync.cc:14:
>> ../monotone/automate_ostream_demuxed.hh:24: error: declaration of
>> `_iob' as array of references
>
> I found the cause for this, and a fix (patch below).
>
> The code in automate_ostream_demuxed.hh is:
>
> class basic_automate_streambuf_demuxed : public std::basic_streambuf<_CharT,
> _Traits>
> {
> typedef _Traits traits_type;
> typedef typename _Traits::int_type int_type;
> size_t _bufsize;
> std::basic_ostream<_CharT, _Traits> *stdout;
> std::basic_ostream<_CharT, _Traits> *errout;
> int err_code;
> public:
>
> 'stdout' is implemented as a macro in c:/MinGW/include/stdio.h:
>
> #define stdout (&_iob[STDOUT_FILENO])
>
> so the syntax in the definition of the class member 'stdout' gets
> mangled, and the name of the member changed to _iob.
>
> moral; never use any identifiers that are defined in the C library;
> they could easily be macros.
>
> Changing 'stdout' to anything else that is not a macro fixes the
> problem.
Comitted in 24ab7ee7b0d9ae251e6f510cc988f4916e1f88ab, thanks!
> I used 'mystdout'; is there a convention for this sort of
> thing?
Well, its the most straightfoward var name I could think of in a second
as well, so its ok for now I guess :)
Thomas.
--
GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en
signature.asc
Description: OpenPGP digital signature