Commit 76bf91765e0b25066a47cbd52df07645239c5a78

Authored by Jay Berkenbilt
1 parent 0ceb79cf

missing header files for gcc 4.3

git-svn-id: svn+q:///qpdf/trunk@607 71b93d88-0707-0410-a8cf-f5a4172ac649
ChangeLog
1 -2008-05-03 Jay Berkenbilt <ejb@ql.org> 1 +2008-05-04 Jay Berkenbilt <ejb@ql.org>
2 2
3 - * libqpdf/PCRE.cc: added missing include of <string.h> 3 + * updated several files for gcc 4.3 (extra includes)
4 4
5 2008-04-26 Jay Berkenbilt <ejb@ql.org> 5 2008-04-26 Jay Berkenbilt <ejb@ql.org>
6 6
examples/pdf-bookmarks.cc
1 #include <iostream> 1 #include <iostream>
2 #include <string.h> 2 #include <string.h>
  3 +#include <stdlib.h>
3 #include <qpdf/QPDF.hh> 4 #include <qpdf/QPDF.hh>
4 #include <qpdf/QUtil.hh> 5 #include <qpdf/QUtil.hh>
5 #include <qpdf/QTC.hh> 6 #include <qpdf/QTC.hh>
examples/pdf-npages.cc
1 -  
2 -  
3 #include <iostream> 1 #include <iostream>
4 #include <string.h> 2 #include <string.h>
  3 +#include <stdlib.h>
5 4
6 #include <qpdf/QPDF.hh> 5 #include <qpdf/QPDF.hh>
7 6
libqpdf/PCRE.cc
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 #include <qpdf/QUtil.hh> 3 #include <qpdf/QUtil.hh>
4 4
5 #include <iostream> 5 #include <iostream>
6 -#include <strlen.h> 6 +#include <string.h>
7 7
8 PCRE::Exception::Exception(std::string const& message) 8 PCRE::Exception::Exception(std::string const& message)
9 { 9 {
libqpdf/Pl_Buffer.cc
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 #include <qpdf/Pl_Buffer.hh> 2 #include <qpdf/Pl_Buffer.hh>
3 #include <qpdf/QEXC.hh> 3 #include <qpdf/QEXC.hh>
4 #include <assert.h> 4 #include <assert.h>
  5 +#include <string.h>
5 6
6 Pl_Buffer::Pl_Buffer(char const* identifier, Pipeline* next) : 7 Pl_Buffer::Pl_Buffer(char const* identifier, Pipeline* next) :
7 Pipeline(identifier, next), 8 Pipeline(identifier, next),
libqpdf/Pl_QPDFTokenizer.cc
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 #include <qpdf/Pl_QPDFTokenizer.hh> 2 #include <qpdf/Pl_QPDFTokenizer.hh>
3 #include <qpdf/QPDF_String.hh> 3 #include <qpdf/QPDF_String.hh>
4 #include <qpdf/QPDF_Name.hh> 4 #include <qpdf/QPDF_Name.hh>
  5 +#include <string.h>
5 6
6 Pl_QPDFTokenizer::Pl_QPDFTokenizer(char const* identifier, Pipeline* next) : 7 Pl_QPDFTokenizer::Pl_QPDFTokenizer(char const* identifier, Pipeline* next) :
7 Pipeline(identifier, next), 8 Pipeline(identifier, next),
libqpdf/QPDFObjectHandle.cc
@@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
16 #include <qpdf/QEXC.hh> 16 #include <qpdf/QEXC.hh>
17 #include <qpdf/QUtil.hh> 17 #include <qpdf/QUtil.hh>
18 18
  19 +#include <stdlib.h>
  20 +
19 QPDFObjectHandle::QPDFObjectHandle() : 21 QPDFObjectHandle::QPDFObjectHandle() :
20 initialized(false), 22 initialized(false),
21 objid(0), 23 objid(0),
libqpdf/QPDFTokenizer.cc
@@ -9,6 +9,8 @@ @@ -9,6 +9,8 @@
9 #include <qpdf/QEXC.hh> 9 #include <qpdf/QEXC.hh>
10 #include <qpdf/QTC.hh> 10 #include <qpdf/QTC.hh>
11 11
  12 +#include <string.h>
  13 +
12 // See note above about ctype. 14 // See note above about ctype.
13 static bool is_hex_digit(char ch) 15 static bool is_hex_digit(char ch)
14 { 16 {
libqpdf/QPDFWriter.cc
@@ -19,6 +19,8 @@ @@ -19,6 +19,8 @@
19 #include <qpdf/QPDF_Name.hh> 19 #include <qpdf/QPDF_Name.hh>
20 #include <qpdf/QPDF_String.hh> 20 #include <qpdf/QPDF_String.hh>
21 21
  22 +#include <stdlib.h>
  23 +
22 QPDFWriter::QPDFWriter(QPDF& pdf, char const* filename) : 24 QPDFWriter::QPDFWriter(QPDF& pdf, char const* filename) :
23 pdf(pdf), 25 pdf(pdf),
24 filename(filename), 26 filename(filename),
@@ -233,7 +235,7 @@ QPDFWriter::setEncryptionParameters( @@ -233,7 +235,7 @@ QPDFWriter::setEncryptionParameters(
233 for (std::set<int>::iterator iter = bits_to_clear.begin(); 235 for (std::set<int>::iterator iter = bits_to_clear.begin();
234 iter != bits_to_clear.end(); ++iter) 236 iter != bits_to_clear.end(); ++iter)
235 { 237 {
236 - P |= (1 << (*iter) - 1); 238 + P |= ((1 << (*iter)) - 1);
237 } 239 }
238 P = ~P; 240 P = ~P;
239 241
libqpdf/QPDF_Name.cc
1 1
2 #include <qpdf/QPDF_Name.hh> 2 #include <qpdf/QPDF_Name.hh>
3 3
  4 +#include <string.h>
  5 +
4 QPDF_Name::QPDF_Name(std::string const& name) : 6 QPDF_Name::QPDF_Name(std::string const& name) :
5 name(name) 7 name(name)
6 { 8 {
libqpdf/QPDF_encryption.cc
@@ -10,6 +10,8 @@ @@ -10,6 +10,8 @@
10 #include <qpdf/RC4.hh> 10 #include <qpdf/RC4.hh>
11 #include <qpdf/MD5.hh> 11 #include <qpdf/MD5.hh>
12 12
  13 +#include <string.h>
  14 +
13 static char const padding_string[] = { 15 static char const padding_string[] = {
14 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 16 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41,
15 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, 17 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08,
libqpdf/QPDF_linearization.cc
@@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
16 #include <algorithm> 16 #include <algorithm>
17 #include <assert.h> 17 #include <assert.h>
18 #include <math.h> 18 #include <math.h>
  19 +#include <string.h>
19 20
20 template <class T> 21 template <class T>
21 static void 22 static void
libqpdf/QUtil.cc
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 #include <errno.h> 4 #include <errno.h>
5 #include <ctype.h> 5 #include <ctype.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
  7 +#include <string.h>
7 #ifdef _WIN32 8 #ifdef _WIN32
8 #include <Windows.h> 9 #include <Windows.h>
9 #include <direct.h> 10 #include <direct.h>
libtests/ascii85.cc
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 #include <qpdf/Pl_StdioFile.hh> 3 #include <qpdf/Pl_StdioFile.hh>
4 #include <iostream> 4 #include <iostream>
  5 +#include <stdlib.h>
5 6
6 int main() 7 int main()
7 { 8 {
libtests/buffer.cc
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 #include <qpdf/Pl_Buffer.hh> 2 #include <qpdf/Pl_Buffer.hh>
3 #include <qpdf/Pl_Count.hh> 3 #include <qpdf/Pl_Count.hh>
4 #include <qpdf/Pl_Discard.hh> 4 #include <qpdf/Pl_Discard.hh>
  5 +#include <stdlib.h>
5 6
6 typedef unsigned char* uc; 7 typedef unsigned char* uc;
7 8
libtests/flate.cc
@@ -5,6 +5,8 @@ @@ -5,6 +5,8 @@
5 5
6 #include <iostream> 6 #include <iostream>
7 #include <errno.h> 7 #include <errno.h>
  8 +#include <string.h>
  9 +#include <stdlib.h>
8 10
9 FILE* safe_fopen(char const* filename, char const* mode) 11 FILE* safe_fopen(char const* filename, char const* mode)
10 { 12 {
libtests/hex.cc
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 #include <qpdf/Pl_StdioFile.hh> 3 #include <qpdf/Pl_StdioFile.hh>
4 #include <iostream> 4 #include <iostream>
  5 +#include <stdlib.h>
5 6
6 int main() 7 int main()
7 { 8 {
@@ -29,7 +30,7 @@ int main() @@ -29,7 +30,7 @@ int main()
29 catch (std::exception& e) 30 catch (std::exception& e)
30 { 31 {
31 std::cerr << e.what() << std::endl; 32 std::cerr << e.what() << std::endl;
32 - exit(2); 33 + exit(2);
33 } 34 }
34 35
35 return 0; 36 return 0;
libtests/lzw.cc
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 #include <qpdf/Pl_StdioFile.hh> 3 #include <qpdf/Pl_StdioFile.hh>
4 #include <iostream> 4 #include <iostream>
  5 +#include <stdlib.h>
5 6
6 int main() 7 int main()
7 { 8 {
libtests/pcre.cc
1 1
2 #include <qpdf/PCRE.hh> 2 #include <qpdf/PCRE.hh>
3 #include <iostream> 3 #include <iostream>
  4 +#include <string.h>
4 5
5 int main(int argc, char* argv[]) 6 int main(int argc, char* argv[])
6 { 7 {
libtests/png_filter.cc
@@ -5,6 +5,8 @@ @@ -5,6 +5,8 @@
5 #include <iostream> 5 #include <iostream>
6 #include <errno.h> 6 #include <errno.h>
7 #include <assert.h> 7 #include <assert.h>
  8 +#include <string.h>
  9 +#include <stdlib.h>
8 10
9 FILE* safe_fopen(char const* filename, char const* mode) 11 FILE* safe_fopen(char const* filename, char const* mode)
10 { 12 {
libtests/qexc.cc
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 #include <qpdf/QEXC.hh> 2 #include <qpdf/QEXC.hh>
3 #include <iostream> 3 #include <iostream>
4 #include <errno.h> 4 #include <errno.h>
  5 +#include <stdlib.h>
5 6
6 void do_terminate() 7 void do_terminate()
7 { 8 {
libtests/qutil.cc
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 #include <sys/stat.h> 5 #include <sys/stat.h>
6 #include <fcntl.h> 6 #include <fcntl.h>
7 #include <qpdf/QUtil.hh> 7 #include <qpdf/QUtil.hh>
  8 +#include <string.h>
8 9
9 #ifdef _WIN32 10 #ifdef _WIN32
10 # include <io.h> 11 # include <io.h>
qpdf/test_driver.cc
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 #include <qpdf/QPDFWriter.hh> 9 #include <qpdf/QPDFWriter.hh>
10 #include <iostream> 10 #include <iostream>
11 #include <string.h> 11 #include <string.h>
  12 +#include <stdlib.h>
12 #include <map> 13 #include <map>
13 14
14 static char const* whoami = 0; 15 static char const* whoami = 0;