hb-uniscribe.cc: Re-enable build under Visual Studio
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 3 Jun 2013 09:49:37 +0000 (17:49 +0800)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 3 Jun 2013 22:32:59 +0000 (18:32 -0400)
-Declare hinstLib at the top of block
-Fix the definitions of the typedefs of ScriptItemizeOpenType,
 ScriptShapeOpenType and ScriptPlaceOpenType

src/hb-uniscribe.cc

index 4a77fc0..2582ac6 100644 (file)
@@ -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");