[Box Backup] compile problems on Fedora Core 4 / GCC 4

Alex Howansky boxbackup@fluffy.co.uk
Fri, 15 Jul 2005 16:06:07 -0500 (CDT)


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...

Cheers,

-- 
Alex Howansky
Wankwood Associates
http://wankwood.com/