From 3de65a5156753c6a791ae608ba5898b11d24d95e Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sun, 9 Sep 2012 13:58:15 +0800 Subject: [PATCH] working on relaxing c++11 dependency --- CMakeLists.txt | 1 - src/Consts.h | 6 ++++-- src/HTMLRenderer/text.cc | 2 +- src/util.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38f893e..f081a76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,6 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wunused-function") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wunused-function") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") diff --git a/src/Consts.h b/src/Consts.h index cd1cf47..bfc5194 100644 --- a/src/Consts.h +++ b/src/Consts.h @@ -11,10 +11,12 @@ #include #include -static constexpr double EPS = 1e-6; +static const void * nullptr = NULL; + +static const double EPS = 1e-6; extern const double id_matrix[6]; -static constexpr double DEFAULT_DPI = 72.0; +static const double DEFAULT_DPI = 72.0; extern const std::map BASE_14_FONT_CSS_FONT_MAP; extern const std::map GB_ENCODED_FONT_NAME_MAP; diff --git a/src/HTMLRenderer/text.cc b/src/HTMLRenderer/text.cc index a6b9bc5..0345bfa 100644 --- a/src/HTMLRenderer/text.cc +++ b/src/HTMLRenderer/text.cc @@ -173,7 +173,7 @@ void HTMLRenderer::embed_font(const path & filepath, GfxFont * font, FontInfo & Gfx8BitFont * font_8bit = nullptr; - info.use_tounicode = ((suffix == ".ttf") || (param->always_apply_tounicode)); + info.use_tounicode = ((suffix == ".ttf") || (param->tounicode >= 0)); if(!get_metric_only) { diff --git a/src/util.h b/src/util.h index 0b8ae4b..9a7d994 100644 --- a/src/util.h +++ b/src/util.h @@ -256,7 +256,7 @@ public: } private: - static constexpr const char * base64_encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + static const char * base64_encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; istream * in; };