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.)
This commit is contained in:
Jack Palevich
2009-06-24 19:27:30 -07:00
parent ad39eb0a25
commit c7410f6f9f

View File

@@ -5,6 +5,7 @@
#include <vector> #include <vector>
#include <set> #include <set>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h>
using namespace std; using namespace std;