From 7e805d1a6f3bf7ddd04b2c1ce857a2cf6d9ff873 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Thu, 10 Aug 2017 15:13:19 +0000 Subject: Revert "Add a build target and a proper export header for shared library builds." This reverts commit 00334675c18a0203f313cceb670c970a77280f49. Reason for revert: Breaking the deps roller - https://chromium-review.googlesource.com/c/609307 Original change's description: > Add a build target and a proper export header for shared library builds. > > This CL adds support for Chromium's component build feature to pdfium. > > The export header stub in fpdfview.h is expanded to match Chromium's > export mechanisms and patterns (fixes pdfium:825). > > A component/shared library build can be triggered by adding > > is_component_build = true > > as a gn argument. Please note that setting this will also affect some > of pdfiums dependencies like v8, which will be build as components > too. > > Additionally, this CL provides a "pdf_source_set" template which > dynamically enables the use of "source_set" when building a complete > static library or a shared library to reduce build time. > > When testing this it is recommended to only build the pdfium target as > most of pdfiums test rely on non-public functions which aren't exported > by the shared library. > > Bug: pdfium:825,pdfium:826 > Change-Id: Icedc538ec535e11d1e53c4d5fabc8c064b275752 > Reviewed-on: https://pdfium-review.googlesource.com/8970 > Reviewed-by: dsinclair > Commit-Queue: dsinclair TBR=thestig@chromium.org,tsepez@chromium.org,brucedawson@chromium.org,dsinclair@google.com,dsinclair@chromium.org,licorn@gmail.com Change-Id: Ib02af2298932481293f50d362ae87bfedf284821 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: pdfium:825, pdfium:826 Reviewed-on: https://pdfium-review.googlesource.com/10550 Reviewed-by: Henrique Nakashima Commit-Queue: Henrique Nakashima --- fpdfsdk/fpdfattachment.cpp | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'fpdfsdk/fpdfattachment.cpp') diff --git a/fpdfsdk/fpdfattachment.cpp b/fpdfsdk/fpdfattachment.cpp index b759ae2655..5bdb3bd4a2 100644 --- a/fpdfsdk/fpdfattachment.cpp +++ b/fpdfsdk/fpdfattachment.cpp @@ -45,8 +45,7 @@ CFX_ByteString GenerateMD5Base16(const void* contents, } // namespace -FPDF_EXPORT int FPDF_CALLCONV -FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document) { +DLLEXPORT int STDCALL FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return 0; @@ -54,8 +53,8 @@ FPDFDoc_GetAttachmentCount(FPDF_DOCUMENT document) { return CPDF_NameTree(pDoc, "EmbeddedFiles").GetCount(); } -FPDF_EXPORT FPDF_ATTACHMENT FPDF_CALLCONV -FPDFDoc_AddAttachment(FPDF_DOCUMENT document, FPDF_WIDESTRING name) { +DLLEXPORT FPDF_ATTACHMENT STDCALL FPDFDoc_AddAttachment(FPDF_DOCUMENT document, + FPDF_WIDESTRING name) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); CFX_WideString wsName = CFX_WideString::FromUTF16LE(name, CFX_WideString::WStringLength(name)); @@ -98,8 +97,8 @@ FPDFDoc_AddAttachment(FPDF_DOCUMENT document, FPDF_WIDESTRING name) { return pFile; } -FPDF_EXPORT FPDF_ATTACHMENT FPDF_CALLCONV -FPDFDoc_GetAttachment(FPDF_DOCUMENT document, int index) { +DLLEXPORT FPDF_ATTACHMENT STDCALL FPDFDoc_GetAttachment(FPDF_DOCUMENT document, + int index) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc || index < 0) return nullptr; @@ -112,8 +111,8 @@ FPDFDoc_GetAttachment(FPDF_DOCUMENT document, int index) { return nameTree.LookupValueAndName(index, &csName); } -FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV -FPDFDoc_DeleteAttachment(FPDF_DOCUMENT document, int index) { +DLLEXPORT FPDF_BOOL STDCALL FPDFDoc_DeleteAttachment(FPDF_DOCUMENT document, + int index) { CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc || index < 0) return false; @@ -125,7 +124,7 @@ FPDFDoc_DeleteAttachment(FPDF_DOCUMENT document, int index) { return nameTree.DeleteValueAndName(index); } -FPDF_EXPORT unsigned long FPDF_CALLCONV +DLLEXPORT unsigned long STDCALL FPDFAttachment_GetName(FPDF_ATTACHMENT attachment, void* buffer, unsigned long buflen) { @@ -137,8 +136,8 @@ FPDFAttachment_GetName(FPDF_ATTACHMENT attachment, buffer, buflen); } -FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV -FPDFAttachment_HasKey(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key) { +DLLEXPORT FPDF_BOOL STDCALL FPDFAttachment_HasKey(FPDF_ATTACHMENT attachment, + FPDF_WIDESTRING key) { CPDF_Object* pFile = CPDFObjectFromFPDFAttachment(attachment); if (!pFile) return 0; @@ -150,7 +149,7 @@ FPDFAttachment_HasKey(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key) { return pParamsDict->KeyExist(CFXByteStringFromFPDFWideString(key)); } -FPDF_EXPORT FPDF_OBJECT_TYPE FPDF_CALLCONV +DLLEXPORT FPDF_OBJECT_TYPE STDCALL FPDFAttachment_GetValueType(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key) { if (!FPDFAttachment_HasKey(attachment, key)) return FPDF_OBJECT_UNKNOWN; @@ -164,7 +163,7 @@ FPDFAttachment_GetValueType(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key) { return pObj->GetType(); } -FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV +DLLEXPORT FPDF_BOOL STDCALL FPDFAttachment_SetStringValue(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key, FPDF_WIDESTRING value) { @@ -186,7 +185,7 @@ FPDFAttachment_SetStringValue(FPDF_ATTACHMENT attachment, return true; } -FPDF_EXPORT unsigned long FPDF_CALLCONV +DLLEXPORT unsigned long STDCALL FPDFAttachment_GetStringValue(FPDF_ATTACHMENT attachment, FPDF_WIDESTRING key, void* buffer, @@ -214,11 +213,10 @@ FPDFAttachment_GetStringValue(FPDF_ATTACHMENT attachment, return Utf16EncodeMaybeCopyAndReturnLength(value, buffer, buflen); } -FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV -FPDFAttachment_SetFile(FPDF_ATTACHMENT attachment, - FPDF_DOCUMENT document, - const void* contents, - const unsigned long len) { +DLLEXPORT FPDF_BOOL STDCALL FPDFAttachment_SetFile(FPDF_ATTACHMENT attachment, + FPDF_DOCUMENT document, + const void* contents, + const unsigned long len) { CPDF_Object* pFile = CPDFObjectFromFPDFAttachment(attachment); CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pFile || !pFile->IsDictionary() || !pDoc || len > INT_MAX) @@ -262,7 +260,7 @@ FPDFAttachment_SetFile(FPDF_ATTACHMENT attachment, return true; } -FPDF_EXPORT unsigned long FPDF_CALLCONV +DLLEXPORT unsigned long STDCALL FPDFAttachment_GetFile(FPDF_ATTACHMENT attachment, void* buffer, unsigned long buflen) { -- cgit v1.2.3