[HarfBuzz] harfbuzz: Branch 'master' - 4 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Mon Jun 3 15:51:07 PDT 2013


 src/hb-ucdn/ucdn.c     |    1 -
 src/hb-uniscribe.cc    |    9 +++++----
 test/api/test-buffer.c |    2 +-
 util/ansi-print.cc     |   11 +++++++++++
 4 files changed, 17 insertions(+), 6 deletions(-)

New commits:
commit b4c5c52944a44ba863a22a53035ff561af7318ca
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date:   Mon Jun 3 17:55:29 2013 +0800

    util/ansi-print.cc: Use fallback implementation for lround on MSVC
    
    Unfortuately Visual Studio (still) does not support the C99 function
    lround, so provide a fallback implementation for it.

diff --git a/util/ansi-print.cc b/util/ansi-print.cc
index 873bee8..e166c91 100644
--- a/util/ansi-print.cc
+++ b/util/ansi-print.cc
@@ -41,6 +41,17 @@
 #include <unistd.h> /* for isatty() */
 #endif
 
+#ifdef _MSC_VER
+static inline long int
+lround (double x)
+{
+  if (x >= 0)
+    return floor (x + 0.5);
+  else
+    return ceil (x - 0.5);
+}
+#endif
+
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 
 #define CELL_W 8
commit a4446b10bfe0a9e7236bf941fa69a96697939e11
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jun 3 18:39:14 2013 -0400

    Fix build for C89 compilers

diff --git a/test/api/test-buffer.c b/test/api/test-buffer.c
index 82fdaae..77fa786 100644
--- a/test/api/test-buffer.c
+++ b/test/api/test-buffer.c
@@ -704,7 +704,7 @@ static const utf16_conversion_test_t utf16_conversion_tests[] = {
   {{0x41, 0xD800, 0xDF02}, {-1}},
   {{0x41, 0x61, 0xD800, 0xDF02}, {0x61, -1}},
   {{0x41, 0xD800, 0x61, 0xDF02}, {-1, 0x61}},
-  {{0x41, 0x61}, {}}
+  {{0x41, 0x61}, {0}}
 };
 
 static void
commit 4ddf937242048c4a044ada4559e26664a0c09b48
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jun 3 18:36:26 2013 -0400

    Remove unnecessary stdint.h include

diff --git a/src/hb-ucdn/ucdn.c b/src/hb-ucdn/ucdn.c
index b61e34a..c79907a 100644
--- a/src/hb-ucdn/ucdn.c
+++ b/src/hb-ucdn/ucdn.c
@@ -16,7 +16,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdint.h>
 #include "ucdn.h"
 
 typedef struct {
commit 93a04b8b5e6d8067cb925fdf532aadc24c1d4861
Author: Chun-wei Fan <fanchunwei at src.gnome.org>
Date:   Mon Jun 3 17:49:37 2013 +0800

    hb-uniscribe.cc: Re-enable build under Visual Studio
    
    -Declare hinstLib at the top of block
    -Fix the definitions of the typedefs of ScriptItemizeOpenType,
     ScriptShapeOpenType and ScriptPlaceOpenType

diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc
index 4a77fc0..2582ac6 100644
--- a/src/hb-uniscribe.cc
+++ b/src/hb-uniscribe.cc
@@ -44,7 +44,7 @@
 #endif
 
 
-typedef HRESULT WINAPI (*SIOT) /*ScriptItemizeOpenType*/(
+typedef HRESULT (WINAPI *SIOT) /*ScriptItemizeOpenType*/(
   const WCHAR *pwcInChars,
   int cInChars,
   int cMaxItems,
@@ -55,7 +55,7 @@ typedef HRESULT WINAPI (*SIOT) /*ScriptItemizeOpenType*/(
   int *pcItems
 );
 
-typedef HRESULT WINAPI (*SSOT) /*ScriptShapeOpenType*/(
+typedef HRESULT (WINAPI *SSOT) /*ScriptShapeOpenType*/(
   HDC hdc,
   SCRIPT_CACHE *psc,
   SCRIPT_ANALYSIS *psa,
@@ -74,7 +74,7 @@ typedef HRESULT WINAPI (*SSOT) /*ScriptShapeOpenType*/(
   int *pcGlyphs
 );
 
-typedef HRESULT WINAPI (*SPOT) /*ScriptPlaceOpenType*/(
+typedef HRESULT (WINAPI *SPOT) /*ScriptPlaceOpenType*/(
   HDC hdc,
   SCRIPT_CACHE *psc,
   SCRIPT_ANALYSIS *psa,
@@ -196,11 +196,12 @@ struct hb_uniscribe_shaper_funcs_t {
 
   inline void init (void)
   {
+    HMODULE hinstLib;
     this->ScriptItemizeOpenType = NULL;
     this->ScriptShapeOpenType   = NULL;
     this->ScriptPlaceOpenType   = NULL;
 
-    HMODULE hinstLib = GetModuleHandle("usp10.dll");
+    hinstLib = GetModuleHandle("usp10.dll");
     if (hinstLib)
     {
       this->ScriptItemizeOpenType = (SIOT) GetProcAddress (hinstLib, "ScriptItemizeOpenType");



More information about the HarfBuzz mailing list