From 8a08e13f7367b9e3fbe5962630ba93513bced255 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 30 Oct 2012 16:30:02 +0530 Subject: [PATCH] Another fix for compiling with -fPIC --- src/sfntly/src/sfntly/font.cc | 11 +++++++++++ src/sfntly/src/sfntly/font.h | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/sfntly/src/sfntly/font.cc b/src/sfntly/src/sfntly/font.cc index 347e0c13e9..f326bccea2 100644 --- a/src/sfntly/src/sfntly/font.cc +++ b/src/sfntly/src/sfntly/font.cc @@ -54,6 +54,17 @@ bool Font::HasTable(int32_t tag) { 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) { if (!HasTable(tag)) { return NULL; diff --git a/src/sfntly/src/sfntly/font.h b/src/sfntly/src/sfntly/font.h index 975e8cc52c..ef8b97f854 100644 --- a/src/sfntly/src/sfntly/font.h +++ b/src/sfntly/src/sfntly/font.h @@ -232,17 +232,17 @@ class Font : public RefCounted { virtual ~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 // 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. - int64_t checksum() { return checksum_; } + int64_t checksum(); // 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. bool HasTable(int32_t tag);