From e198e10ffd710e9681635593dff65bf4abd45bda Mon Sep 17 00:00:00 2001 From: David Date: Tue, 24 Feb 2009 20:57:05 +0000 Subject: david - apparently the mingw compiler has a couple issues... 1) i had to make iterator and const_iterator friends of each other so they could see each other's private constructors 2) apparently there is a bug in the name-lookup related to inline typedef structs and the friend keyword... had to move the typedef struct const_iterator to after the actual struct. --- buildMinGW.conf | 2 +- src/fbasicstring.h | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/buildMinGW.conf b/buildMinGW.conf index 96968aa..0688e48 100644 --- a/buildMinGW.conf +++ b/buildMinGW.conf @@ -22,7 +22,7 @@ filesIn("src") filter regexp("^src/(.*)\\.h$", "bu/{re:1}.h"): target file, set "CXXFLAGS" += "-I.", #input filesIn("src") filter regexp("^.*\\.cpp$") - input ["src/array.cpp", "src/list.cpp", "src/exceptionbase.cpp", "src/fstring.cpp", "src/file.cpp", "src/set.cpp", "src/hash.cpp", "src/sptr.cpp", "src/tafnode.cpp", "src/tafreader.cpp", "src/tafwriter.cpp", "src/stdstream.cpp", "src/stream.cpp", "src/archive.cpp", "src/archival.cpp", "src/socket.cpp", "src/serversocket.cpp", "src/unitsuite.cpp", "src/win32_compatibility.cpp"] + input ["src/array.cpp", "src/list.cpp", "src/exceptionbase.cpp", "src/fbasicstring.cpp", "src/fstring.cpp", "src/file.cpp", "src/set.cpp", "src/hash.cpp", "src/sptr.cpp", "src/tafnode.cpp", "src/tafreader.cpp", "src/tafwriter.cpp", "src/stdstream.cpp", "src/stream.cpp", "src/archive.cpp", "src/archival.cpp", "src/socket.cpp", "src/serversocket.cpp", "src/unitsuite.cpp", "src/win32_compatibility.cpp", "src/membuf.cpp"] rule "exe": matches regexp("(.*)\\.win_o$"), diff --git a/src/fbasicstring.h b/src/fbasicstring.h index 8bbbe91..cac7dd7 100644 --- a/src/fbasicstring.h +++ b/src/fbasicstring.h @@ -124,9 +124,10 @@ namespace Bu } struct iterator; - typedef struct const_iterator + struct const_iterator { friend class FBasicString; + friend struct iterator; private: const_iterator( Chunk *pChunk, int iPos ) : pChunk( pChunk ), @@ -349,11 +350,12 @@ namespace Bu } return const_iterator( NULL, 0 ); } - } const_iterator; + }; typedef struct iterator { friend class FBasicString; + friend struct const_iterator; private: iterator( Chunk *pChunk, int iPos ) : pChunk( pChunk ), @@ -590,6 +592,8 @@ namespace Bu } } iterator; + typedef struct const_iterator const_iterator; + //typedef chr *iterator; // typedef const chr *const_iterator; // typedef iterator const_iterator; -- cgit v1.2.3