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,9 +8,10 @@
8 #include <qpdf/QPDFPageDocumentHelper.hh> 8 #include <qpdf/QPDFPageDocumentHelper.hh>
9 #include <qpdf/QPDFWriter.hh> 9 #include <qpdf/QPDFWriter.hh>
10 #include <qpdf/QUtil.hh> 10 #include <qpdf/QUtil.hh>
11 -#include <string> 11 +
12 #include <iostream> 12 #include <iostream>
13 -#include <cstdlib> 13 +#include <stdlib.h>
  14 +#include <string>
14 15
15 static char const* whoami = 0; 16 static char const* whoami = 0;
16 static bool static_id = false; 17 static bool static_id = false;
ispell-words
@@ -400,7 +400,6 @@ cso @@ -400,7 +400,6 @@ cso
400 csoe 400 csoe
401 css 401 css
402 cstdio 402 cstdio
403 -cstdlib  
404 cstr 403 cstr
405 cstring 404 cstring
406 ctest 405 ctest
libqpdf/Pl_DCT.cc
@@ -2,10 +2,11 @@ @@ -2,10 +2,11 @@
2 2
3 #include <qpdf/QUtil.hh> 3 #include <qpdf/QUtil.hh>
4 #include <qpdf/QTC.hh> 4 #include <qpdf/QTC.hh>
  5 +
5 #include <setjmp.h> 6 #include <setjmp.h>
6 -#include <string>  
7 #include <stdexcept> 7 #include <stdexcept>
8 -#include <cstdlib> 8 +#include <stdlib.h>
  9 +#include <string>
9 10
10 #if BITS_IN_JSAMPLE != 8 11 #if BITS_IN_JSAMPLE != 8
11 # error "qpdf does not support libjpeg built with BITS_IN_JSAMPLE != 8" 12 # error "qpdf does not support libjpeg built with BITS_IN_JSAMPLE != 8"
libqpdf/QPDF.cc
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 #include <vector> 4 #include <vector>
5 #include <map> 5 #include <map>
6 #include <algorithm> 6 #include <algorithm>
  7 +#include <stdlib.h>
7 #include <string.h> 8 #include <string.h>
8 #include <memory.h> 9 #include <memory.h>
9 10
libqpdf/QPDFTokenizer.cc
@@ -10,8 +10,8 @@ @@ -10,8 +10,8 @@
10 #include <qpdf/QPDFObjectHandle.hh> 10 #include <qpdf/QPDFObjectHandle.hh>
11 11
12 #include <stdexcept> 12 #include <stdexcept>
  13 +#include <stdlib.h>
13 #include <string.h> 14 #include <string.h>
14 -#include <cstdlib>  
15 15
16 static bool is_delimiter(char ch) 16 static bool is_delimiter(char ch)
17 { 17 {