R: R: R: R: R: Squid 3 build errors on Visual Studio - problem still present

2009-09-14 Thread Guido Serassio
Hi Henrik,

 
 Can you produce a preprocessed source? That's the output of just the
 preprocessor, not actual compilarion, comparable to gcc -E option.
 
 Easier to identify what the compiler actually saw that way...


Done. Sorry for the delay, but I'm very busy (as usual ...)

I have placed the preprocessed source of two failing files
(IpIntercept.cc and QosConfig.cc) here:

http://www.acmeconsulting.it/libip.zip

Regards

Guido


Guido Serassio
Acme Consulting S.r.l.
Microsoft Gold Certified Partner
Via Lucia Savarino, 110098 - Rivoli (TO) - ITALY
Tel. : +39.011.9530135   Fax. : +39.011.9781115
Email: guido.seras...@acmeconsulting.it
WWW: http://www.acmeconsulting.it





Re: R: R: R: R: R: Squid 3 build errors on Visual Studio - problem still present

2009-09-14 Thread Henrik Nordstrom
mån 2009-09-14 klockan 11:27 +0200 skrev Guido Serassio:

 Done. Sorry for the delay, but I'm very busy (as usual ...)
 
 I have placed the preprocessed source of two failing files
 (IpIntercept.cc and QosConfig.cc) here:
 
 http://www.acmeconsulting.it/libip.zip

Odd... std::string::npos is declared as follows:

namespace std;

templateclass _Elem,
class _Traits,
class _Ax
class basic_string
: public _String_val_Elem, _Ax
{   
public:
 static const size_type npos;   
};

templateclass _Elem,
class _Traits,
class _Alloc
 const typename basic_string_Elem, _Traits, _Alloc::size_type
basic_string_Elem, _Traits, _Alloc::npos =
(typename basic_string_Elem, _Traits, 
_Alloc::size_type)(-1);

typedef basic_stringchar, char_traitschar, allocatorchar 
string;



Maybe Visual Studio drops the const attribute when trying to convert the
value from const std::string:size_type to const String::size_type
and gets lost somehow, even with the value as such being a simple size_t
integer.. 

What does it say about the attached code? My attempt in isolating the
String npos = std::string::npos code with as little change as possible
(had to kill the char_traits thing as that used template syntax not
accepted by G++ which slightly changes how size_type is declared)

Regards
Henrik
typedef long size_t;

namespace std {

templateclass _Ty class allocator
{
public:
typedef size_t size_type;
};

templateclass _Elem,
class _Traits,
class _Ax
class basic_string
{   
public:
	typedef typename _Ax::size_type size_type;
static const size_type npos;   
};

templateclass _Elem,
class _Traits,
class _Alloc
 const typename basic_string_Elem, _Traits, _Alloc::size_type
basic_string_Elem, _Traits, _Alloc::npos =
(typename basic_string_Elem, _Traits, _Alloc::size_type)(-1);

typedef basic_stringchar, char, allocatorchar 
string;
};

class String {
	typedef size_t size_type;
	static const size_type npos = std::string::npos;
};


R: R: R: R: Squid 3 build errors on Visual Studio - problem still present

2009-09-02 Thread Guido Serassio
Hi,

OK, but what next ?

Regards

Guido Serassio
Acme Consulting S.r.l.
Microsoft Gold Certified Partner
Via Lucia Savarino, 110098 - Rivoli (TO) - ITALY
Tel. : +39.011.9530135   Fax. : +39.011.9781115
Email: guido.seras...@acmeconsulting.it
WWW: http://www.acmeconsulting.it



 -Messaggio originale-
 Da: Amos Jeffries [mailto:squ...@treenet.co.nz]
 Inviato: martedì 1 settembre 2009 10.43
 A: Henrik Nordstrom
 Cc: Guido Serassio; Robert Collins; squid-dev@squid-cache.org
 Oggetto: Re: R: R: R: Squid 3 build errors on Visual Studio - problem
 still present
 
 Henrik Nordstrom wrote:
  mån 2009-08-31 klockan 13:40 +0200 skrev Guido Serassio:
  Hi,
 
  I have found this definition:
 
  http://msdn.microsoft.com/en-us/library/tbbk8hs6(VS.80).aspx
 
  Hoping that helps.
 
  Matches the standard definition from what I can tell, and should not
  cause any errors...
 
  Regards
  Henrik
 
 
 Ah, well. It seems that npos may not work if its int or unsigned
 
 We do this:
include/config.h:typedef unsigned int size_t;
src/SquidString.h:typedef size_t size_type;
src/SquidString.h:const static size_type npos = std::string::npos;
 
 making   SquidString::size_type == size_t == unsigned int
 
 
 But, the complaint is about constant expression being expected?
 
 Amos
 --
 Please be using
Current Stable Squid 2.7.STABLE6 or 3.0.STABLE18
Current Beta Squid 3.1.0.13


Re: R: R: R: R: Squid 3 build errors on Visual Studio - problem still present

2009-09-02 Thread Henrik Nordstrom
ons 2009-09-02 klockan 21:11 +0200 skrev Guido Serassio:
 Hi,
 
 OK, but what next ?

Can you produce a preprocessed source? That's the output of just the
preprocessor, not actual compilarion, comparable to gcc -E option. 

Easier to identify what the compiler actually saw that way... 

Regards
Henrik