From b856379370809cca68cb97b737284ade2c44765c Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Wed, 20 Jun 2012 10:54:07 -0400 Subject: [PATCH] Portability issues: off_t, unlink --- examples/pdf-mod-info.cc | 7 +++++++ include/qpdf/QPDF.hh | 1 + include/qpdf/QPDFExc.hh | 1 + include/qpdf/QPDFObjectHandle.hh | 1 + include/qpdf/QPDFXRefEntry.hh | 1 + include/qpdf/Types.h | 16 ++++++++++++++++ 6 files changed, 27 insertions(+), 0 deletions(-) create mode 100644 include/qpdf/Types.h diff --git a/examples/pdf-mod-info.cc b/examples/pdf-mod-info.cc index ef5a280..84cc841 100644 --- a/examples/pdf-mod-info.cc +++ b/examples/pdf-mod-info.cc @@ -8,6 +8,13 @@ #include #include #include +#ifdef _WIN32 +#include +#include +#include +#else +#include +#endif static char const* version = "1.1"; static char const* whoami = 0; diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index dc2b4c2..6a9728b 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -15,6 +15,7 @@ #include #include +#include #include #include diff --git a/include/qpdf/QPDFExc.hh b/include/qpdf/QPDFExc.hh index 3d04c60..26d0a31 100644 --- a/include/qpdf/QPDFExc.hh +++ b/include/qpdf/QPDFExc.hh @@ -10,6 +10,7 @@ #include #include +#include #include class QPDFExc: public std::runtime_error diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index 9873da7..6213ff1 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -14,6 +14,7 @@ #include #include +#include #include #include diff --git a/include/qpdf/QPDFXRefEntry.hh b/include/qpdf/QPDFXRefEntry.hh index a828a4e..3584397 100644 --- a/include/qpdf/QPDFXRefEntry.hh +++ b/include/qpdf/QPDFXRefEntry.hh @@ -9,6 +9,7 @@ #define __QPDFXREFENTRY_HH__ #include +#include class QPDFXRefEntry { diff --git a/include/qpdf/Types.h b/include/qpdf/Types.h new file mode 100644 index 0000000..4041ce3 --- /dev/null +++ b/include/qpdf/Types.h @@ -0,0 +1,16 @@ +#ifndef __QPDFTYPES_H__ +#define __QPDFTYPES_H__ + +/* Attempt to provide off_t and size_t on any recent platform. To + * make cross compilation easier and to be more portable across + * platforms, QPDF avoids having any public header files use the + * results of autoconf testing, so we have to handle this ourselves in + * a static way. + */ + +#define _FILE_OFFSET_BITS 64 +#include +#include +#include + +#endif /* __QPDFTYPES_H__ */ -- libgit2 0.21.4