[harfbuzz.cc] Fix OffsetTable name clash with Mac headers
There's no easy way to undo a "using namespace" in our sources, so by the time
we get to include hb-coretext.cc from harfbuzz.cc, we already have "using namespace OT"
active, which clashes with Mac headers.
Error was:
$ gcc -O3 -Wall -arch i386 -DHAVE_CORETEXT=1 -c harfbuzz.cc -o harfbuzz.o -std=c++11
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h:288:3: error:
reference to 'OffsetTable' is ambiguous
OffsetTable offsets,
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/IntlResources.h:115:41: note:
candidate found by name lookup is 'OffsetTable'
typedef OffPair OffsetTable[3];
^
./hb-open-file.hh:81:16: note: candidate found by name lookup is 'OT::OffsetTable'
typedef struct OffsetTable
^
1 error generated.
diff --git a/src/hb-open-file.hh b/src/hb-open-file.hh
index ac13dd2..54c07ff 100644
--- a/src/hb-open-file.hh
+++ b/src/hb-open-file.hh
@@ -48,7 +48,7 @@
*/
struct OpenTypeFontFile;
-struct OffsetTable;
+struct OpenTypeOffsetTable;
struct TTCHeader;
@@ -78,7 +78,7 @@
DEFINE_SIZE_STATIC (16);
} OpenTypeTable;
-typedef struct OffsetTable
+typedef struct OpenTypeOffsetTable
{
friend struct OpenTypeFontFile;
@@ -218,7 +218,7 @@
Tag ttcTag; /* TrueType Collection ID string: 'ttcf' */
FixedVersion<>version; /* Version of the TTC Header (1.0),
* 0x00010000u */
- LArrayOf<LOffsetTo<OffsetTable>>
+ LArrayOf<LOffsetTo<OpenTypeOffsetTable>>
table; /* Array of offsets to the OffsetTable for each font
* from the beginning of the file */
public:
diff --git a/src/hb-ot-head-table.hh b/src/hb-ot-head-table.hh
index 5613a96..ac588e3 100644
--- a/src/hb-ot-head-table.hh
+++ b/src/hb-ot-head-table.hh
@@ -43,7 +43,7 @@
struct head
{
- friend struct OffsetTable;
+ friend struct OpenTypeOffsetTable;
static constexpr hb_tag_t tableTag = HB_OT_TAG_head;