$OpenBSD: patch-pdf_pdfium_pdfium_engine_cc,v 1.2 2015/05/26 17:37:40 robert Exp $
--- pdf/pdfium/pdfium_engine.cc.orig.port	Thu May 14 00:35:47 2015
+++ pdf/pdfium/pdfium_engine.cc	Wed May 20 08:34:56 2015
@@ -116,7 +116,7 @@ std::vector<uint32_t> GetPageNumbersFromPrintPageNumbe
   return page_numbers;
 }
 
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
 
 PP_Instance g_last_instance_id;
 
@@ -549,7 +549,7 @@ pp::VarDictionary TraverseBookmarks(FPDF_DOCUMENT doc,
 bool InitializeSDK() {
   FPDF_InitLibrary();
 
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
   // Font loading doesn't work in the renderer sandbox in Linux.
   FPDF_SetSystemFontInfo(&g_font_info);
 #endif
@@ -1452,7 +1452,7 @@ pp::Buffer_Dev PDFiumEngine::PrintPagesAsRasterPDF(
     FPDF_ClosePage(pdf_page);
   }
 
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
   g_last_instance_id = client_->GetPluginInstance()->pp_instance();
 #endif
 
@@ -2837,7 +2837,7 @@ bool PDFiumEngine::ContinuePaint(int progressive_index
   DCHECK_LT(static_cast<size_t>(progressive_index), progressive_paints_.size());
   DCHECK(image_data);
 
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
   g_last_instance_id = client_->GetPluginInstance()->pp_instance();
 #endif
 
@@ -3293,7 +3293,7 @@ void PDFiumEngine::SetCurrentPage(int index) {
     FORM_DoPageAAction(old_page, form_, FPDFPAGE_AACTION_CLOSE);
   }
   most_visible_page_ = index;
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
     g_last_instance_id = client_->GetPluginInstance()->pp_instance();
 #endif
   if (most_visible_page_ != -1 && called_do_document_action_) {
