Sfoglia il codice sorgente

Add missing includes and external definitions

Several modules use std::array without including the
array header. Bad modules.

Some modules use STDOUT_FILENO and friends, or close()
without including unistd.h, where they are defined.

One module also uses WIFEXITED() without including
sys/wait.h.

Finally, environ is not specified to be defined in unistd.h. We
are required to define it ourselves according to POSIX, so let's
do that.
Julian Andres Klode 10 anni fa
parent
commit
24a59c62ef

+ 1 - 0
apt-pkg/contrib/strutl.cc

@@ -21,6 +21,7 @@
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/error.h>
 
+#include <array>
 #include <algorithm>
 #include <iomanip>
 #include <locale>

+ 1 - 0
apt-pkg/deb/debindexfile.cc

@@ -30,6 +30,7 @@
 #include <sstream>
 
 #include <sys/stat.h>
+#include <unistd.h>
 									/*}}}*/
 
 // Sources Index							/*{{{*/

+ 2 - 0
apt-pkg/deb/dpkgpm.cc

@@ -61,6 +61,8 @@
 #include <apti18n.h>
 									/*}}}*/
 
+extern char **environ;
+
 using namespace std;
 
 APT_PURE static string AptHistoryRequestingUser()			/*{{{*/

+ 2 - 0
apt-pkg/edsp/edsplistparser.cc

@@ -21,6 +21,8 @@
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/pkgsystem.h>
 
+#include <array>
+
 									/*}}}*/
 
 // ListParser::edspListParser - Constructor				/*{{{*/

+ 1 - 0
apt-private/private-show.cc

@@ -24,6 +24,7 @@
 #include <apt-private/private-show.h>
 
 #include <stdio.h>
+#include <unistd.h>
 #include <ostream>
 #include <string>
 

+ 1 - 0
cmdline/apt-helper.cc

@@ -29,6 +29,7 @@
 #include <string>
 #include <vector>
 
+#include <unistd.h>
 #include <stdlib.h>
 
 #include <apti18n.h>

+ 1 - 0
cmdline/apt-sortpkgs.cc

@@ -29,6 +29,7 @@
 #include <vector>
 #include <algorithm>
 #include <stdio.h>
+#include <unistd.h>
 #include <iostream>
 #include <string>
 #include <memory>

+ 1 - 0
test/interactive-helper/test_fileutl.cc

@@ -4,6 +4,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/wait.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <fcntl.h>