You need to sign in before continuing.
Commit b856379370809cca68cb97b737284ade2c44765c
1 parent
92c94e7d
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.
Showing
6 changed files
with
27 additions
and
0 deletions
examples/pdf-mod-info.cc
| ... | ... | @@ -8,6 +8,13 @@ |
| 8 | 8 | #include <iostream> |
| 9 | 9 | #include <string.h> |
| 10 | 10 | #include <stdlib.h> |
| 11 | +#ifdef _WIN32 | |
| 12 | +#include <Windows.h> | |
| 13 | +#include <direct.h> | |
| 14 | +#include <io.h> | |
| 15 | +#else | |
| 16 | +#include <unistd.h> | |
| 17 | +#endif | |
| 11 | 18 | |
| 12 | 19 | static char const* version = "1.1"; |
| 13 | 20 | static char const* whoami = 0; | ... | ... |
include/qpdf/QPDF.hh
include/qpdf/QPDFExc.hh
include/qpdf/QPDFObjectHandle.hh
include/qpdf/QPDFXRefEntry.hh
include/qpdf/Types.h
0 → 100644
| 1 | +#ifndef __QPDFTYPES_H__ | |
| 2 | +#define __QPDFTYPES_H__ | |
| 3 | + | |
| 4 | +/* Attempt to provide off_t and size_t on any recent platform. To | |
| 5 | + * make cross compilation easier and to be more portable across | |
| 6 | + * platforms, QPDF avoids having any public header files use the | |
| 7 | + * results of autoconf testing, so we have to handle this ourselves in | |
| 8 | + * a static way. | |
| 9 | + */ | |
| 10 | + | |
| 11 | +#define _FILE_OFFSET_BITS 64 | |
| 12 | +#include <sys/types.h> | |
| 13 | +#include <stdio.h> | |
| 14 | +#include <string.h> | |
| 15 | + | |
| 16 | +#endif /* __QPDFTYPES_H__ */ | ... | ... |