Commit 9fea88dc3e4dc59b6dd56de5c282f1abbb37e921
1 parent
d494aaac
Correctly detect that timezone is not an int
The simple CMake test that printf("%ld", timezone) to tell if HAVE_EXTERN_LONG_TIMEZONE, incorrectly saw an int after casting FreeBSD's char * timezone(int zone, int dst) pointer function to an int. By dividing it by 60 (as will occur in the .cc file), we ensure the test program to fail and thus HAVE_EXTERN_LONG_TIMEZONE not to be defined.
Showing
1 changed file
with
1 additions
and
1 deletions
libqpdf/CMakeLists.txt
| @@ -328,7 +328,7 @@ check_c_source_compiles( | @@ -328,7 +328,7 @@ check_c_source_compiles( | ||
| 328 | #include <stdio.h> | 328 | #include <stdio.h> |
| 329 | int main(int argc, char* argv[]) { | 329 | int main(int argc, char* argv[]) { |
| 330 | tzset(); | 330 | tzset(); |
| 331 | - printf(\"%ld\", timezone); | 331 | + printf(\"%ld\", timezone / 60); |
| 332 | return 0; | 332 | return 0; |
| 333 | }" | 333 | }" |
| 334 | HAVE_EXTERN_LONG_TIMEZONE) | 334 | HAVE_EXTERN_LONG_TIMEZONE) |