From 365f27ab5ba025bf1be6a882ed213c695cbfed7e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 12 Nov 2012 11:16:57 -0800 Subject: [PATCH] Work around older compilers As reported on the list: I am seeing a similar problem building harfbuzz 0.9.5 with Apple gcc 4.0.1 on OS X 10.5 Leopard: hb-ot-layout-common-private.hh:406: error: 'struct OT::CoverageFormat1::Iter' is private hb-ot-layout-common-private.hh:646: error: within this context hb-ot-layout-common-private.hh:500: error: 'struct OT::CoverageFormat2::Iter' is private hb-ot-layout-common-private.hh:647: error: within this context make[4]: *** [libharfbuzz_la-hb-ot-layout.lo] Error 1 Also reported as happening with MSVC 2005. --- src/hb-ot-layout-common-private.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index f5a067aec..bfb3bdbfd 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -403,6 +403,8 @@ struct CoverageFormat1 glyphs->add (glyphArray[i]); } + public: + /* Older compilers need this to be public. */ struct Iter { inline void init (const struct CoverageFormat1 &c_) { c = &c_; i = 0; }; inline bool more (void) { return i < c->glyphArray.len; } @@ -414,6 +416,7 @@ struct CoverageFormat1 const struct CoverageFormat1 *c; unsigned int i; }; + private: protected: USHORT coverageFormat; /* Format identifier--format = 1 */ @@ -497,6 +500,8 @@ struct CoverageFormat2 rangeRecord[i].add_coverage (glyphs); } + public: + /* Older compilers need this to be public. */ struct Iter { inline void init (const CoverageFormat2 &c_) { c = &c_; @@ -522,6 +527,7 @@ struct CoverageFormat2 const struct CoverageFormat2 *c; unsigned int i, j, coverage; }; + private: protected: USHORT coverageFormat; /* Format identifier--format = 2 */