Got rid of several unnecessary includes of <iostream>.

Including <iostream> causes the file to be polluted with a static
initializer for the __ioinit symbol. This can harm binary startup time.
For more info, see here:

    http://neugierig.org/software/chromium/notes/2011/08/static-initializers.html
This commit is contained in:
Aaron Jacobs
2011-12-22 03:18:24 +00:00
parent 7c507d7eba
commit 2b853c4067
6 changed files with 15 additions and 8 deletions

View File

@@ -7,7 +7,6 @@
# define CPPTL_JSON_ASSERTIONS_H_INCLUDED
#include <stdlib.h>
#include <iostream>
#if !defined(JSON_IS_AMALGAMATION)
# include <json/config.h>
@@ -18,7 +17,13 @@
#define JSON_FAIL_MESSAGE( message ) throw std::runtime_error( message );
#else // JSON_USE_EXCEPTION
#define JSON_ASSERT( condition ) assert( condition );
#define JSON_FAIL_MESSAGE( message ) { std::cerr << std::endl << message << std::endl; exit(123); }
// The call to assert() will show the failure message in debug builds. In
// release bugs we write to invalid memory in order to crash hard instead of
// calling exit(), so that a debugger or crash reporter gets the chance to take
// over.
#define JSON_FAIL_MESSAGE( message ) { assert(false && message); strcpy(reinterpret_cast<char*>(666), message); }
#endif
#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) { JSON_FAIL_MESSAGE( message ) }

View File

@@ -13,7 +13,6 @@
# include <deque>
# include <stack>
# include <string>
# include <iostream>
namespace Json {

View File

@@ -11,7 +11,6 @@
#endif // if !defined(JSON_IS_AMALGAMATION)
# include <vector>
# include <string>
# include <iostream>
namespace Json {