Bug 1382509 - part3. Align the calling convention with PDFium. draft
authorFarmer Tseng <fatseng@mozilla.com>
Fri, 28 Jul 2017 13:36:11 +0800
changeset 617252 4aefaea9488c8c3b11b75c3bbdcdf6c4cbf96cd7
parent 617251 b33c51d1230aa77d609ccde38c2e704986cdc84a
child 617253 4ad2bb7acd2420d573cccdd1c7b05960d7bf4154
push id70999
push userbmo:fatseng@mozilla.com
push dateFri, 28 Jul 2017 08:05:47 +0000
bugs1382509
milestone56.0a1
Bug 1382509 - part3. Align the calling convention with PDFium. 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: