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.
This commit is contained in:
Jay Berkenbilt 2012-06-20 10:54:07 -04:00
parent 92c94e7df2
commit b856379370
6 changed files with 27 additions and 0 deletions

View File

@ -8,6 +8,13 @@
#include <iostream>
#include <string.h>
#include <stdlib.h>
#ifdef _WIN32
#include <Windows.h>
#include <direct.h>
#include <io.h>
#else
#include <unistd.h>
#endif
static char const* version = "1.1";
static char const* whoami = 0;

View File

@ -15,6 +15,7 @@
#include <iostream>
#include <qpdf/DLL.h>
#include <qpdf/Types.h>
#include <qpdf/QPDFXRefEntry.hh>
#include <qpdf/QPDFObjectHandle.hh>

View File

@ -10,6 +10,7 @@
#include <qpdf/DLL.h>
#include <qpdf/Constants.h>
#include <qpdf/Types.h>
#include <stdexcept>
class QPDFExc: public std::runtime_error

View File

@ -14,6 +14,7 @@
#include <map>
#include <qpdf/DLL.h>
#include <qpdf/Types.h>
#include <qpdf/PointerHolder.hh>
#include <qpdf/Buffer.hh>

View File

@ -9,6 +9,7 @@
#define __QPDFXREFENTRY_HH__
#include <qpdf/DLL.h>
#include <qpdf/Types.h>
class QPDFXRefEntry
{

16
include/qpdf/Types.h Normal file
View File

@ -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 <sys/types.h>
#include <stdio.h>
#include <string.h>
#endif /* __QPDFTYPES_H__ */