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.
pull/1/merge
Behdad Esfahbod 12 years ago
parent 6b389ddc36
commit 365f27ab5b
  1. 6
      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 */

Loading…
Cancel
Save