mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-02 22:50:20 +00:00
Add configure option AVOID_WINDOWS_HANDLE
If set, we avoid using Windows I/O HANDLE, which is disallowed in some versions of the Windows SDK, such as for Windows phones. QUtil::same_file will always return false in this case. Only applies to Windows builds.
This commit is contained in:
parent
d24a120c7f
commit
4ecd1df6f2
@ -1,5 +1,12 @@
|
|||||||
2019-01-10 Jay Berkenbilt <ejb@ql.org>
|
2019-01-10 Jay Berkenbilt <ejb@ql.org>
|
||||||
|
|
||||||
|
* Add new configure option --enable-avoid-windows-handle, which
|
||||||
|
causes the symbol AVOID_WINDOWS_HANDLE to be defined. If set, we
|
||||||
|
avoid using Windows I/O HANDLE, which is disallowed in some
|
||||||
|
versions of the Windows SDK, such as for Windows phones.
|
||||||
|
QUtil::same_file will always return false in this case. Only
|
||||||
|
applies to Windows builds.
|
||||||
|
|
||||||
* Add new method QPDF::setImmediateCopyFrom. When called on a
|
* Add new method QPDF::setImmediateCopyFrom. When called on a
|
||||||
source QPDF object, streams can be copied FROM that object to
|
source QPDF object, streams can be copied FROM that object to
|
||||||
other ones without having to keep the source QPDF or its input
|
other ones without having to keep the source QPDF or its input
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
b544741ebe32e6bf555703b4cbedcaef62553da29e3230df4ccb8351900e2378 configure.ac
|
8e191dc63d2709fcd089ff62dd022589d12892129616a6036fa7e39833dd5443 configure.ac
|
||||||
35bc5c645dc42d47f2daeea06f8f3e767c8a1aee6a35eb2b4854fd2ce66c3413 m4/ax_random_device.m4
|
35bc5c645dc42d47f2daeea06f8f3e767c8a1aee6a35eb2b4854fd2ce66c3413 m4/ax_random_device.m4
|
||||||
37f8897d5f68d7d484e5457832a8f190ddb7507fa2a467cb7ee2be40a4364643 m4/libtool.m4
|
37f8897d5f68d7d484e5457832a8f190ddb7507fa2a467cb7ee2be40a4364643 m4/libtool.m4
|
||||||
e77ebba8361b36f14b4d0927173a034b98c5d05049697a9ded84d85eb99a7990 m4/ltoptions.m4
|
e77ebba8361b36f14b4d0927173a034b98c5d05049697a9ded84d85eb99a7990 m4/ltoptions.m4
|
||||||
|
26
configure
vendored
26
configure
vendored
@ -756,6 +756,7 @@ enable_libtool_lock
|
|||||||
enable_insecure_random
|
enable_insecure_random
|
||||||
enable_os_secure_random
|
enable_os_secure_random
|
||||||
with_random
|
with_random
|
||||||
|
enable_avoid_windows_handle
|
||||||
enable_external_libs
|
enable_external_libs
|
||||||
with_windows_wordsize
|
with_windows_wordsize
|
||||||
with_large_file_test_path
|
with_large_file_test_path
|
||||||
@ -1425,6 +1426,9 @@ Optional Features:
|
|||||||
--enable-os-secure-random
|
--enable-os-secure-random
|
||||||
whether to try to use OS-provided secure random
|
whether to try to use OS-provided secure random
|
||||||
numbers (default is yes)
|
numbers (default is yes)
|
||||||
|
--enable-avoid-windows-handle
|
||||||
|
whether to avoid use of HANDLE, useful for some
|
||||||
|
embedded Windows builds (default is no)
|
||||||
--enable-external-libs whether to use external libraries distribution
|
--enable-external-libs whether to use external libraries distribution
|
||||||
--disable-largefile omit support for large files
|
--disable-largefile omit support for large files
|
||||||
--enable-ld-version-script
|
--enable-ld-version-script
|
||||||
@ -15780,6 +15784,28 @@ _ACEOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Check whether --enable-avoid-windows-handle was given.
|
||||||
|
if test "${enable_avoid_windows_handle+set}" = set; then :
|
||||||
|
enableval=$enable_avoid_windows_handle; if test "$enableval" = "yes"; then
|
||||||
|
qpdf_AVOID_HANDLE=1;
|
||||||
|
else
|
||||||
|
qpdf_AVOID_HANDLE=0;
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
qpdf_AVOID_HANDLE=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$qpdf_AVOID_HANDLE" = "1"; then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||||
|
$as_echo "yes" >&6; }
|
||||||
|
|
||||||
|
$as_echo "#define AVOID_WINDOWS_HANDLE 1" >>confdefs.h
|
||||||
|
|
||||||
|
else
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||||
|
$as_echo "no" >&6; }
|
||||||
|
fi
|
||||||
|
|
||||||
USE_EXTERNAL_LIBS=0
|
USE_EXTERNAL_LIBS=0
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether to use external libraries distribution" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether to use external libraries distribution" >&5
|
||||||
$as_echo_n "checking for whether to use external libraries distribution... " >&6; }
|
$as_echo_n "checking for whether to use external libraries distribution... " >&6; }
|
||||||
|
15
configure.ac
15
configure.ac
@ -92,6 +92,21 @@ fi
|
|||||||
|
|
||||||
AX_RANDOM_DEVICE
|
AX_RANDOM_DEVICE
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(avoid-windows-handle,
|
||||||
|
AS_HELP_STRING([--enable-avoid-windows-handle],
|
||||||
|
[whether to avoid use of HANDLE, useful for some embedded Windows builds (default is no)]),
|
||||||
|
[if test "$enableval" = "yes"; then
|
||||||
|
qpdf_AVOID_HANDLE=1;
|
||||||
|
else
|
||||||
|
qpdf_AVOID_HANDLE=0;
|
||||||
|
fi], [qpdf_AVOID_HANDLE=0])
|
||||||
|
if test "$qpdf_AVOID_HANDLE" = "1"; then
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE([AVOID_WINDOWS_HANDLE], [1], [Whether to avoid use of HANDLE in Windows])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
|
||||||
USE_EXTERNAL_LIBS=0
|
USE_EXTERNAL_LIBS=0
|
||||||
AC_MSG_CHECKING(for whether to use external libraries distribution)
|
AC_MSG_CHECKING(for whether to use external libraries distribution)
|
||||||
AC_ARG_ENABLE(external-libs,
|
AC_ARG_ENABLE(external-libs,
|
||||||
|
@ -214,13 +214,14 @@ QUtil::same_file(char const* name1, char const* name2)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
bool same = false;
|
||||||
|
# ifndef AVOID_WINDOWS_HANDLE
|
||||||
HANDLE fh1 = CreateFile(name1, GENERIC_READ, FILE_SHARE_READ,
|
HANDLE fh1 = CreateFile(name1, GENERIC_READ, FILE_SHARE_READ,
|
||||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
HANDLE fh2 = CreateFile(name2, GENERIC_READ, FILE_SHARE_READ,
|
HANDLE fh2 = CreateFile(name2, GENERIC_READ, FILE_SHARE_READ,
|
||||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
BY_HANDLE_FILE_INFORMATION fi1;
|
BY_HANDLE_FILE_INFORMATION fi1;
|
||||||
BY_HANDLE_FILE_INFORMATION fi2;
|
BY_HANDLE_FILE_INFORMATION fi2;
|
||||||
bool same = false;
|
|
||||||
if ((fh1 != INVALID_HANDLE_VALUE) &&
|
if ((fh1 != INVALID_HANDLE_VALUE) &&
|
||||||
(fh2 != INVALID_HANDLE_VALUE) &&
|
(fh2 != INVALID_HANDLE_VALUE) &&
|
||||||
GetFileInformationByHandle(fh1, &fi1) &&
|
GetFileInformationByHandle(fh1, &fi1) &&
|
||||||
@ -239,6 +240,7 @@ QUtil::same_file(char const* name1, char const* name2)
|
|||||||
{
|
{
|
||||||
CloseHandle(fh2);
|
CloseHandle(fh2);
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
return same;
|
return same;
|
||||||
#else
|
#else
|
||||||
struct stat st1;
|
struct stat st1;
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
/* libqpdf/qpdf/qpdf-config.h.in. Generated from configure.ac by autoheader. */
|
/* libqpdf/qpdf/qpdf-config.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
|
||||||
|
/* Whether to avoid use of HANDLE in Windows */
|
||||||
|
#undef AVOID_WINDOWS_HANDLE
|
||||||
|
|
||||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
#undef HAVE_DLFCN_H
|
#undef HAVE_DLFCN_H
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user