Bug 1382509 - Part1. Align the calling convention with PDFium in PDFiumEngineShim. r=glandium draft
authorFarmer Tseng <fatseng@mozilla.com>
Sun, 20 Aug 2017 22:45:00 +0800
changeset 649694 c16704fce19bf4700f9a12f5251c292d8b03db39
parent 648622 441d72cd409e105337eed7d763a29ef329ba2d58
child 649695 8f0fc1be93fec1a61b732682fbc8449117042ca6
push id75104
push userbmo:fatseng@mozilla.com
push dateMon, 21 Aug 2017 06:23:04 +0000
reviewersglandium
bugs1382509
milestone57.0a1
Bug 1382509 - Part1. Align the calling convention with PDFium in PDFiumEngineShim. r=glandium MozReview-Commit-ID: GSci8sIHnYE
widget/windows/PDFiumEngineShim.h
--- a/widget/windows/PDFiumEngineShim.h
+++ b/widget/windows/PDFiumEngineShim.h
@@ -12,36 +12,37 @@
 //#define USE_EXTERNAL_PDFIUM
 
 /* include windows.h for the HDC definitions that we need. */
 #include <windows.h>
 
 namespace mozilla {
 namespace widget {
 
-typedef void (*FPDF_InitLibrary_Pfn)();
-typedef void (*FPDF_DestroyLibrary_Pfn)();
+typedef void (STDCALL *FPDF_InitLibrary_Pfn)();
+typedef void (STDCALL *FPDF_DestroyLibrary_Pfn)();
 
-typedef FPDF_DOCUMENT (*FPDF_LoadDocument_Pfn)(FPDF_STRING file_path,
-                                               FPDF_BYTESTRING password);
+typedef FPDF_DOCUMENT (STDCALL *FPDF_LoadDocument_Pfn)(FPDF_STRING file_path,
+                                                      FPDF_BYTESTRING password);
 
-typedef void(*FPDF_CloseDocument_Pfn)(FPDF_DOCUMENT aDocument);
+typedef void(STDCALL *FPDF_CloseDocument_Pfn)(FPDF_DOCUMENT aDocument);
 
-typedef int (*FPDF_GetPageCount_Pfn)(FPDF_DOCUMENT aDocument);
+typedef int (STDCALL *FPDF_GetPageCount_Pfn)(FPDF_DOCUMENT aDocument);
 
-typedef FPDF_PAGE (*FPDF_LoadPage_Pfn)(FPDF_DOCUMENT aDocument, int aPageIndex);
-typedef void (*FPDF_ClosePage_Pfn)(FPDF_PAGE aPage);
-typedef void (*FPDF_RenderPage_Pfn)(HDC aDC,
-                                    FPDF_PAGE aPage,
-                                    int aStartX,
-                                    int aStartY,
-                                    int aSizeX,
-                                    int aSizeY,
-                                    int aRotate,
-                                    int aFlags);
+typedef FPDF_PAGE (STDCALL *FPDF_LoadPage_Pfn)(FPDF_DOCUMENT aDocument,
+                                               int aPageIndex);
+typedef void (STDCALL *FPDF_ClosePage_Pfn)(FPDF_PAGE aPage);
+typedef void (STDCALL *FPDF_RenderPage_Pfn)(HDC aDC,
+                                            FPDF_PAGE aPage,
+                                            int aStartX,
+                                            int aStartY,
+                                            int aSizeX,
+                                            int aSizeY,
+                                            int aRotate,
+                                            int aFlags);
 
 /**
  * This class exposes an interface to the PDFium library and
  * takes care of loading and linking to the appropriate PDFium symbols.
  */
 class PDFiumEngineShim
 {
 public: