Another fix for compiling with -fPIC

This commit is contained in:
Kovid Goyal 2012-10-30 16:30:02 +05:30
parent c3c64c452a
commit 8a08e13f73
2 changed files with 15 additions and 4 deletions

View File

@ -54,6 +54,17 @@ bool Font::HasTable(int32_t tag) {
return (result != end); return (result != end);
} }
// Changed by Kovid: these four methods cannot be inlined, if they are they
// return incorrect values when compiled with -fPIC
int32_t Font::sfnt_version() { return sfnt_version_; }
ByteVector* Font::digest() { return &digest_; }
int64_t Font::checksum() { return checksum_; }
int32_t Font::num_tables() { return (int32_t)tables_.size(); }
Table* Font::GetTable(int32_t tag) { Table* Font::GetTable(int32_t tag) {
if (!HasTable(tag)) { if (!HasTable(tag)) {
return NULL; return NULL;

View File

@ -232,17 +232,17 @@ class Font : public RefCounted<Font> {
virtual ~Font(); virtual ~Font();
// Gets the sfnt version set in the sfnt wrapper of the font. // Gets the sfnt version set in the sfnt wrapper of the font.
int32_t sfnt_version() { return sfnt_version_; } int32_t sfnt_version();
// Gets a copy of the fonts digest that was created when the font was read. If // Gets a copy of the fonts digest that was created when the font was read. If
// no digest was set at creation time then the return result will be null. // no digest was set at creation time then the return result will be null.
ByteVector* digest() { return &digest_; } ByteVector* digest();
// Get the checksum for this font. // Get the checksum for this font.
int64_t checksum() { return checksum_; } int64_t checksum();
// Get the number of tables in this font. // Get the number of tables in this font.
int32_t num_tables() { return (int32_t)tables_.size(); } int32_t num_tables();
// Whether the font has a particular table. // Whether the font has a particular table.
bool HasTable(int32_t tag); bool HasTable(int32_t tag);