[Box Backup] compile problems on Fedora Core 4 / GCC 4
Ben Summers
boxbackup@fluffy.co.uk
Mon, 18 Jul 2005 14:12:56 +0100
On 15 Jul 2005, at 22:06, Alex Howansky wrote:
>
> Can't seem to get it compiled on FC4. The configure runs ok, but
> make bombs
> with a ton of errors, starting with:
>
> In file included from Protocol.cpp:59:
> ProtocolWire.h:58: error: stray '#' in program
> ProtocolWire.h:78: error: stray '#' in program
> ProtocolWire.h:58: error: 'pragma' does not name a type
> ProtocolWire.h:64: error: expected constructor, destructor, or type
> conversion before ';' token
> ProtocolWire.h:78: error: 'pragma' does not name a type
>
> After fiddling with it a bit, it seems that the file lib/common/
> BoxPlatform.h
> checks explicitly for gcc v3:
>
> // GCC v3 doesn't like pragmas in #defines
> #ifdef PLATFORM_GCC3
>
> Since FC4 uses gcc v4, the other part of that conditional is
> firing, and since
> the compile is failing, it seems that gcc v4 doesn't like pragmas
> in #defines
> either. So, I changed line 58 of infrastructure/BoxPlatform.pm from
> this:
>
> $gcc_v3 = 1 if (m/version gcc 3/ || m/gcc version 3/ || m/gcc \(GCC
> \) 3/i || m/gcc.Version\s+3/i);
>
> to this:
>
> $gcc_v3 = 1 if (m/version gcc [34]/ || m/gcc version [34]/ || m/gcc
> \(GCC\) [34]/i || m/gcc.Version\s+[34]/i);
>
> Not the most elgant solution, but it got me compiled at least.
>
> I didn't find any related problems in the archives, so hopefully I
> didn't
> repeat a bunch of debugging that was already done...
This patch works fine. I have a private version which works with
GCCv4 (created for Mac OS X 10.4) which does it it a slightly better
way, but for now, this is perfect.
Ben