From b856379370809cca68cb97b737284ade2c44765c Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Wed, 20 Jun 2012 10:54:07 -0400 Subject: Portability issues: off_t, unlink New header qpdf/Types.h attempts to make sure size_t and off_t are defined on any platform and in a way that would work with large file support. Additionally, missing header files are included to get unlink. --- 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 ++++++++++++++++ 5 files changed, 20 insertions(+) create mode 100644 include/qpdf/Types.h (limited to 'include') diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index dc2b4c22..6a9728b1 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 3d04c601..26d0a315 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 9873da7b..6213ff10 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 a828a4ee..35843970 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 00000000..4041ce3a --- /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__ */ -- cgit v1.2.3-54-g00ecf