Commit 2c704b99a100728e35f1c78a37d686c5e2149b08

Authored by Thorsten Schöning
Committed by Jay Berkenbilt
1 parent 2efec4ce

Undefined functions because of missing std:: or header. (#295)

* [bcc32 Error] QPDF.cc(375): E2268 Call to undefined function 'atof'
  Full parser context
    QPDF.cc(358): parsing: void QPDF::parse(const char *)

* [bcc32 Error] QPDFTokenizer.cc(183): E2268 Call to undefined function 'strtol'
  Full parser context
    QPDFTokenizer.cc(163): parsing: void QPDFTokenizer::resolveLiteral()

* [bcc32 Error] pdf-split-pages.cc(52): E2268 Call to undefined function 'exit'
  Full parser context
    pdf-split-pages.cc(50): parsing: void usage()

* PR #295: Including "cstdlib" should be replaced with "stdlib.h" to be more consistent. At the same time I changed the order of the surrounding includes to reflect alphabetical order, because at some files this already have been the case.
examples/pdf-split-pages.cc
... ... @@ -8,9 +8,10 @@
8 8 #include <qpdf/QPDFPageDocumentHelper.hh>
9 9 #include <qpdf/QPDFWriter.hh>
10 10 #include <qpdf/QUtil.hh>
11   -#include <string>
  11 +
12 12 #include <iostream>
13   -#include <cstdlib>
  13 +#include <stdlib.h>
  14 +#include <string>
14 15  
15 16 static char const* whoami = 0;
16 17 static bool static_id = false;
... ...
ispell-words
... ... @@ -400,7 +400,6 @@ cso
400 400 csoe
401 401 css
402 402 cstdio
403   -cstdlib
404 403 cstr
405 404 cstring
406 405 ctest
... ...
libqpdf/Pl_DCT.cc
... ... @@ -2,10 +2,11 @@
2 2  
3 3 #include <qpdf/QUtil.hh>
4 4 #include <qpdf/QTC.hh>
  5 +
5 6 #include <setjmp.h>
6   -#include <string>
7 7 #include <stdexcept>
8   -#include <cstdlib>
  8 +#include <stdlib.h>
  9 +#include <string>
9 10  
10 11 #if BITS_IN_JSAMPLE != 8
11 12 # error "qpdf does not support libjpeg built with BITS_IN_JSAMPLE != 8"
... ...
libqpdf/QPDF.cc
... ... @@ -4,6 +4,7 @@
4 4 #include <vector>
5 5 #include <map>
6 6 #include <algorithm>
  7 +#include <stdlib.h>
7 8 #include <string.h>
8 9 #include <memory.h>
9 10  
... ...
libqpdf/QPDFTokenizer.cc
... ... @@ -10,8 +10,8 @@
10 10 #include <qpdf/QPDFObjectHandle.hh>
11 11  
12 12 #include <stdexcept>
  13 +#include <stdlib.h>
13 14 #include <string.h>
14   -#include <cstdlib>
15 15  
16 16 static bool is_delimiter(char ch)
17 17 {
... ...