aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pdf-double-page-size.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2013-11-30 04:08:25 +0100
committerJay Berkenbilt <ejb@ql.org>2013-11-30 21:58:32 +0100
commit478c05fcab6cb4137b9cbaf55fdcdb6ff74107c0 (patch)
treeb3861bf4962f0509a7ccf2ec58f794d7a54b23f2 /examples/pdf-double-page-size.cc
parent88c29873e56e69c83aa0d0798188cd792368059b (diff)
downloadqpdf-478c05fcab6cb4137b9cbaf55fdcdb6ff74107c0.tar.zst
Allow -DNO_GET_ENVIRONMENT to avoid GetEnvironmentVariable
If NO_GET_ENVIRONMENT is #defined at compile time on Windows, do not call GetEnvironmentVariable. QUtil::get_env will always return false. This option is not available through configure. This was added to support a specific user's requirements to avoid calling GetEnvironmentVariable from the Windows API. Nothing in qpdf outside the test coverage system in qtest relies on QUtil::get_env.
Diffstat (limited to 'examples/pdf-double-page-size.cc')
-rw-r--r--examples/pdf-double-page-size.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/examples/pdf-double-page-size.cc b/examples/pdf-double-page-size.cc
index 8a1867aa..2236265b 100644
--- a/examples/pdf-double-page-size.cc
+++ b/examples/pdf-double-page-size.cc
@@ -51,6 +51,15 @@ int main(int argc, char* argv[])
whoami += 3;
}
+ // For test suite
+ bool static_id = false;
+ if ((argc > 1) && (strcmp(argv[1], " --static-id") == 0))
+ {
+ static_id = true;
+ --argc;
+ ++argv;
+ }
+
if (! ((argc == 3) || (argc == 4)))
{
usage();
@@ -88,7 +97,7 @@ int main(int argc, char* argv[])
// Write out a new file
QPDFWriter w(qpdf, outfilename);
- if (QUtil::get_env("IN_TESTSUITE"))
+ if (static_id)
{
// For the test suite, uncompress streams and use static
// IDs.