doctranslator: fix gcc7 build.

This commit is contained in:
Jerome Duval
2018-10-02 17:18:51 +02:00
parent 256a6399a0
commit 01aa408921
2 changed files with 42 additions and 1 deletions

View File

@@ -4,10 +4,11 @@ PDF using antiword."
HOMEPAGE="https://github.com/TwoFX/DOCTranslator"
COPYRIGHT="2014 Markus Himmel"
LICENSE="MIT"
REVISION="3"
REVISION="4"
SOURCE_URI="https://github.com/HaikuArchives/DOCTranslator/archive/7b8fa2b6d0ce027ce9e9b03cbdc21016190436de.zip"
CHECKSUM_SHA256="ce271927e70e49a2c00eb46df785202bb7de9c7abdaf1f96ef533d827e346588"
SOURCE_DIR="DOCTranslator-7b8fa2b6d0ce027ce9e9b03cbdc21016190436de"
PATCHES="doctranslator-$portVersion.patchset"
ARCHITECTURES="x86 x86_gcc2"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

View File

@@ -0,0 +1,40 @@
From 8448a0babc248cf22ba52e6beb7da231c8c625ec Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 2 Oct 2018 17:13:53 +0200
Subject: doctranslator: fix gcc7 build.
diff --git a/DOCTranslator.cpp b/DOCTranslator.cpp
index 4dc4720..34b2e95 100644
--- a/DOCTranslator.cpp
+++ b/DOCTranslator.cpp
@@ -15,6 +15,8 @@
#include <File.h>
#include <FindDirectory.h>
+using namespace std;
+
#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "DOCTranslator"
@@ -236,7 +238,7 @@ DOCTranslator::DerivedTranslate(BPositionIO *inSource,
// Read the whole input into a buffer
off_t *bufferSize;
inSource->GetSize(bufferSize);
- uint8 fileBuffer[*bufferSize];
+ char fileBuffer[*bufferSize];
inSource->Read(&fileBuffer, *bufferSize);
@@ -247,7 +249,7 @@ DOCTranslator::DerivedTranslate(BPositionIO *inSource,
{
return B_ERROR;
}
- inputFile.write(&fileBuffer, *bufferSize);
+ inputFile.write(fileBuffer, *bufferSize);
inputFile.close();
// Now execute antiword and have the shell dump stdout into a file
--
2.19.0