summaryrefslogtreecommitdiff
path: root/samples/pdfium_test.cc
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-23 21:59:33 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-23 21:59:33 +0000
commita41801ee0e7c0d76feca2dfe20103d8b82391026 (patch)
treea50ee9dd4eeecd123ad03258898dee549b78d506 /samples/pdfium_test.cc
parent3a3a3690bc4c0b8d50756014dbe2ea85f3075fdc (diff)
downloadpdfium-a41801ee0e7c0d76feca2dfe20103d8b82391026.tar.xz
Fix GCC build with V8 disabled.
- Remove set, but otherwise unused variables. - Mark some pdfium_test code as V8-enabled only. - Do not build one unit test with GCC. Change-Id: I3f04273a7731086e08386478a62769bf06f6d8a4 Reviewed-on: https://pdfium-review.googlesource.com/41271 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'samples/pdfium_test.cc')
-rw-r--r--samples/pdfium_test.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index b7538a8c6f..e808d640f2 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -157,6 +157,7 @@ void OutputMD5Hash(const char* file_name, const char* buffer, int len) {
printf("MD5:%s:%s\n", file_name, hash.c_str());
}
+#ifdef PDF_ENABLE_V8
// These example JS platform callback handlers are entirely optional,
// and exist here to show the flow of information from a document back
// to the embedder.
@@ -217,6 +218,7 @@ void ExampleDocMail(IPDF_JSPLATFORM*,
GetPlatformWString(BCC).c_str(), GetPlatformWString(Subject).c_str(),
GetPlatformWString(Msg).c_str());
}
+#endif // PDF_ENABLE_V8
void ExampleUnsupportedHandler(UNSUPPORT_INFO*, int type) {
std::string feature = "Unknown";
@@ -702,6 +704,7 @@ void RenderPdf(const std::string& name,
if (options.save_attachments)
WriteAttachments(doc.get(), name);
+#ifdef PDF_ENABLE_V8
IPDF_JSPLATFORM platform_callbacks = {};
platform_callbacks.version = 3;
platform_callbacks.app_alert = ExampleAppAlert;
@@ -709,6 +712,7 @@ void RenderPdf(const std::string& name,
platform_callbacks.app_beep = ExampleAppBeep;
platform_callbacks.Doc_gotoPage = ExampleDocGotoPage;
platform_callbacks.Doc_mail = ExampleDocMail;
+#endif // PDF_ENABLE_V8
FPDF_FORMFILLINFO_PDFiumTest form_callbacks = {};
#ifdef PDF_ENABLE_XFA