Re: Wrong placement of conditional definition of missing types

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sun, 23 Aug 2009 00:57:49 +1200

Guido Serassio wrote:
> Hi,
>
> I have just found a logical problem in the placement of the conditional definition of missing types (int8_t, int16_t, etc):
>
> Currently is placed in the final section of config.h, but it's too late:
>
> config.h includes compact.h
> compact.h includes compat_shared.h
> compat_shared.h conditionally includes strtoll.h that needs int64_t definition still undefined at this time, so the build using Visual Studio fails.
>
> Where move this definition block ?
> Some proposal:
>
> 1. include/squid_types.h

yes please, after the all file includes.

> 2. a new compat/compat_types.h file included before compat/os/xxxx.h inclusion

NP: squid_types.h is due to be moved/renamed to compat/types.h but still
has pending some final shuffles and testing of everything that depends
on it to linking with libcompat.

> 3. compat.h itself before compat/os/xxxx.h inclusion

The squid_types.h bits are already included by compat.h before the os/*
files.

Also, note that the FD logics are kind of special and happen in
compat/fdsetsize.h before even types are included.

This is relevant because mswin.h currently has a too-late definition of
logics for it FDSETSIZE as well.

>
> compat_shared.h is not a good candidate, because some definition are already done (and duplicated) into mswin.h that needs they.
>

Regarding the duplicate type definitions in mswin.h: Please remove the
ones which are not actually needed now (if you find any) and shuffle the
ones which are or can be made generic conditional definitions to
squid_types.h as well.

Another note on compat/os/* (this goes for everyone): Please only
#include files there which have a specific problem/requirement specific
to that OS. And don't forget to comment exactly what that requirement is
so we know if/when the hacks can be dropped in future.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE6 or 3.0.STABLE18
   Current Beta Squid 3.1.0.13
Received on Sat Aug 22 2009 - 12:58:02 MDT

This archive was generated by hypermail 2.2.0 : Sat Aug 22 2009 - 12:00:05 MDT