mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-22 10:58:58 +00:00
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:
parent
92c94e7df2
commit
b856379370
@ -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;
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <qpdf/DLL.h>
|
||||
#include <qpdf/Types.h>
|
||||
|
||||
#include <qpdf/QPDFXRefEntry.hh>
|
||||
#include <qpdf/QPDFObjectHandle.hh>
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include <qpdf/DLL.h>
|
||||
#include <qpdf/Constants.h>
|
||||
#include <qpdf/Types.h>
|
||||
#include <stdexcept>
|
||||
|
||||
class QPDFExc: public std::runtime_error
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <map>
|
||||
|
||||
#include <qpdf/DLL.h>
|
||||
#include <qpdf/Types.h>
|
||||
|
||||
#include <qpdf/PointerHolder.hh>
|
||||
#include <qpdf/Buffer.hh>
|
||||
|
@ -9,6 +9,7 @@
|
||||
#define __QPDFXREFENTRY_HH__
|
||||
|
||||
#include <qpdf/DLL.h>
|
||||
#include <qpdf/Types.h>
|
||||
|
||||
class QPDFXRefEntry
|
||||
{
|
||||
|
16
include/qpdf/Types.h
Normal file
16
include/qpdf/Types.h
Normal 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__ */
|
Loading…
Reference in New Issue
Block a user