Re: globals.c->globals.cc

From: Robert Collins <robertc@dont-contact.us>
Date: 15 Dec 2002 22:37:23 +1100

On Sun, 2002-12-15 at 20:33, Guido Serassio wrote:
> Hi Robert,

> There is only a problem:
>
> Microsoft Visual Studio apply "name decoration" or "name mangling" to C++
> object files, so, if all global variables defined in globals.c are
> referenced from other C++ object files, Squid links fine. But at line 95
> in MemPool.c:
>
> /*
> * XXX This is a boundary violation between lib and src.. would be good
> * if it could be solved otherwise, but left for now.
> */
> extern time_t squid_curtime;
>
> The result is an "squid_curtime unresolved external" error in MemPool.obj
> when linking.

Hmm, strange that I haven't seen this here, as G++ mangles names too.
 
> Previously I have resolved the issue compiling globals.c as a C source and
> declaring globals.h as extern "C", but now the squid_curtime problem must
> be fixed.

Simply continue declaring everything in globals.h as SQUIDCEXTERN, that
should solve it fine.

Cheers,
Rob

Received on Sun Dec 15 2002 - 04:38:04 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:01 MST