summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Palevich <jackpal@google.com>2009-06-24 19:01:27 -0700
committerJack Palevich <jackpal@google.com>2009-06-24 19:01:27 -0700
commitbdb087c9305d6d753444e1c0176a793c00f07840 (patch)
tree8f0d197874bc9b0a8eac4d2fe816cb1218749712
parent5158cc55088fec902320cafc02c746e3bf087a10 (diff)
downloadframeworks_base-bdb087c9305d6d753444e1c0176a793c00f07840.zip
frameworks_base-bdb087c9305d6d753444e1c0176a793c00f07840.tar.gz
frameworks_base-bdb087c9305d6d753444e1c0176a793c00f07840.tar.bz2
Add includes to enable host C++ tools to compile with GCC 4.4
Otherwise printf is undeclared. These files worked with earlier versions of gcc because either cstdio or stdio.h was being included by some other header file. But this was not guaranteed behavior, so with GCC 4.4 there are errors. The fix is backwards compatible with earlier versions of GCC. This change includes either <cstdio> or <stdio.h> whichever looks more appropriate given the other headers included by the given source file. Note, I'm using "GCC" to mean Gnu Compile Collection, as this problem is specific to C++ source files. (Presumably a C++-specific header file changed to no longer include cstdio.)
-rw-r--r--tools/localize/Perforce.cpp1
-rw-r--r--tools/localize/SourcePos.cpp1
-rw-r--r--tools/localize/Values.cpp1
-rw-r--r--tools/localize/XLIFFFile.cpp1
-rw-r--r--tools/localize/file_utils.cpp1
-rw-r--r--tools/localize/localize_test.cpp1
-rw-r--r--tools/localize/merge_res_and_xliff.cpp1
-rw-r--r--tools/localize/merge_res_and_xliff_test.cpp2
-rw-r--r--tools/localize/xmb.cpp1
9 files changed, 9 insertions, 1 deletions
diff --git a/tools/localize/Perforce.cpp b/tools/localize/Perforce.cpp
index 3425668..1c644ed 100644
--- a/tools/localize/Perforce.cpp
+++ b/tools/localize/Perforce.cpp
@@ -1,6 +1,7 @@
#include "Perforce.h"
#include "log.h"
#include <string.h>
+#include <cstdio>
#include <stdlib.h>
#include <sstream>
#include <sys/types.h>
diff --git a/tools/localize/SourcePos.cpp b/tools/localize/SourcePos.cpp
index 9d7c5c6..2533f0a 100644
--- a/tools/localize/SourcePos.cpp
+++ b/tools/localize/SourcePos.cpp
@@ -1,6 +1,7 @@
#include "SourcePos.h"
#include <stdarg.h>
+#include <cstdio>
#include <set>
using namespace std;
diff --git a/tools/localize/Values.cpp b/tools/localize/Values.cpp
index e396f8b..8623b97 100644
--- a/tools/localize/Values.cpp
+++ b/tools/localize/Values.cpp
@@ -1,5 +1,6 @@
#include "Values.h"
#include <stdlib.h>
+#include <cstdio>
// =====================================================================================
diff --git a/tools/localize/XLIFFFile.cpp b/tools/localize/XLIFFFile.cpp
index 51f81de..4e217d9 100644
--- a/tools/localize/XLIFFFile.cpp
+++ b/tools/localize/XLIFFFile.cpp
@@ -3,6 +3,7 @@
#include <algorithm>
#include <sys/time.h>
#include <time.h>
+#include <cstdio>
const char* const XLIFF_XMLNS = "urn:oasis:names:tc:xliff:document:1.2";
diff --git a/tools/localize/file_utils.cpp b/tools/localize/file_utils.cpp
index 8792b9e..293e50e 100644
--- a/tools/localize/file_utils.cpp
+++ b/tools/localize/file_utils.cpp
@@ -1,4 +1,5 @@
#include <string.h>
+#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "file_utils.h"
diff --git a/tools/localize/localize_test.cpp b/tools/localize/localize_test.cpp
index 63d904c..678cad8 100644
--- a/tools/localize/localize_test.cpp
+++ b/tools/localize/localize_test.cpp
@@ -1,6 +1,7 @@
#include "XLIFFFile.h"
#include "ValuesFile.h"
#include "localize.h"
+#include <stdio.h>
int pseudolocalize_xliff(XLIFFFile* xliff, bool expand);
diff --git a/tools/localize/merge_res_and_xliff.cpp b/tools/localize/merge_res_and_xliff.cpp
index 58a6554..1fdaa0e 100644
--- a/tools/localize/merge_res_and_xliff.cpp
+++ b/tools/localize/merge_res_and_xliff.cpp
@@ -3,6 +3,7 @@
#include "file_utils.h"
#include "Perforce.h"
#include "log.h"
+#include <stdio.h>
static set<StringResource>::const_iterator
find_id(const set<StringResource>& s, const string& id, int index)
diff --git a/tools/localize/merge_res_and_xliff_test.cpp b/tools/localize/merge_res_and_xliff_test.cpp
index 5a2b0f4..e4ab562 100644
--- a/tools/localize/merge_res_and_xliff_test.cpp
+++ b/tools/localize/merge_res_and_xliff_test.cpp
@@ -1,5 +1,5 @@
#include "merge_res_and_xliff.h"
-
+#include <stdio.h>
int
merge_test()
diff --git a/tools/localize/xmb.cpp b/tools/localize/xmb.cpp
index 236705f..d8f6ff0 100644
--- a/tools/localize/xmb.cpp
+++ b/tools/localize/xmb.cpp
@@ -7,6 +7,7 @@
#include "XLIFFFile.h"
#include <map>
+#include <cstdio>
using namespace std;