2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-05 11:50:53 +00:00

Remove obsolete LL_FMT check from build (fixes #768)

This was broken for cross-compilation and has probably been
unnecessary for several years now.

Also fix extraneous whitespace in related some tests.
This commit is contained in:
Jay Berkenbilt 2022-09-12 11:35:04 -04:00
parent 1393f56e7c
commit 4963ce6a53
18 changed files with 51 additions and 69 deletions

View File

@ -1,3 +1,8 @@
2022-09-12 Jay Berkenbilt <ejb@ql.org>
* Remove compile-time test for LL_FMT. It's unlikely that any
compiler new enough to build qpdf still doesn't support %lld.
2022-09-10 Jay Berkenbilt <ejb@ql.org>
* 11.0.0: release

View File

@ -361,24 +361,6 @@ if(LFS_WITH_MACROS AND NOT LFS_WITHOUT_MACROS)
set(_FILE_OFFSET_BITS 64)
endif()
function(qpdf_check_ll_fmt fmt var)
if(NOT DEFINED LL_FMT)
check_c_source_runs(
"#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int main(int argc, char* argv[]) {
long long int a = 123456789012345ll;
char s[30];
sprintf(s, \"${fmt}\", a);
return (strcmp(s, \"123456789012345\") == 0) ? 0 : 1;
}" ${var})
if(${var})
set(LL_FMT "${fmt}" PARENT_SCOPE)
endif()
endif()
endfunction()
check_c_source_compiles(
"#include <malloc.h>
#include <stdio.h>
@ -402,10 +384,6 @@ int main(int argc, char* argv[]) {
}"
HAVE_OPEN_MEMSTREAM)
qpdf_check_ll_fmt("%lld" fmt_lld)
qpdf_check_ll_fmt("%I64d" fmt_i64d)
qpdf_check_ll_fmt("%I64lld" fmt_i64lld)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/qpdf/qpdf-config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/qpdf/qpdf-config.h"

View File

@ -24,9 +24,6 @@
#cmakedefine HAVE_MALLOC_INFO 1
#cmakedefine HAVE_OPEN_MEMSTREAM 1
/* printf format for long long */
#cmakedefine LL_FMT "${LL_FMT}"
/* system random device (e.g. /dev/random) if any */
#cmakedefine RANDOM_DEVICE "${RANDOM_DEVICE}"

View File

@ -8,6 +8,12 @@ For a detailed list of changes, please see the file
.. x.y.z: not yet released
11.0.1: not yet released
- Build fixes
- Remove ``LL_FMT`` tests, which were broken for cross
compilation. The code just uses ``%lld`` now.
11.0.0: September 10, 2022
- Replacement of ``PointerHolder`` with ``std::shared_ptr``

View File

@ -27,7 +27,6 @@ foreach(PROG ${MAIN_C_PROGRAMS})
target_link_libraries(${PROG} libqpdf)
set_property(TARGET ${PROG} PROPERTY LINKER_LANGUAGE CXX)
endforeach()
target_include_directories(qpdf-ctest PRIVATE ${CMAKE_BINARY_DIR}/libqpdf)
target_include_directories(sizes PRIVATE ${JPEG_INCLUDE})
set(needs_private_headers

View File

@ -6,8 +6,6 @@
#include <stdlib.h>
#include <string.h>
#include <qpdf/qpdf-config.h> // for LL_FMT -- special case in build
static char* whoami = 0;
static qpdf_data qpdf = 0;
@ -42,11 +40,10 @@ safe_fopen(char const* filename, char const* mode)
static void
print_error(char const* label, qpdf_data q, qpdf_error e)
{
#define POS_FMT " pos : " LL_FMT "\n"
printf("%s: %s\n", label, qpdf_get_error_full_text(q, e));
printf(" code: %d\n", qpdf_get_error_code(q, e));
printf(" file: %s\n", qpdf_get_error_filename(q, e));
printf(POS_FMT, qpdf_get_error_file_position(q, e));
printf(" pos: %lld\n", qpdf_get_error_file_position(q, e));
printf(" text: %s\n", qpdf_get_error_message_detail(q, e));
}