Add the magical incantations to get perftools to compile

cleanly under windows.  The only non-trivial one is the #undef
        of small, which I needed to compile under the latest cygwin --
        I ran g++ with -dD under cygwin and saw the '#define small
        char' with my own eyes.  I wouldn't have thought it...


git-svn-id: http://gperftools.googlecode.com/svn/trunk@129 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
This commit is contained in:
csilvers 2011-12-23 00:45:14 +00:00
parent 76131b04cf
commit 75f5a791bc
3 changed files with 8 additions and 4 deletions

View File

@ -95,12 +95,12 @@ class LogItem {
} u_;
};
extern void Log(LogMode mode, const char* filename, int line,
extern PERFTOOLS_DLL_DECL void Log(LogMode mode, const char* filename, int line,
LogItem a, LogItem b = LogItem(),
LogItem c = LogItem(), LogItem d = LogItem());
// Tests can override this function to collect logging messages.
extern void (*log_message_writer)(const char* msg, int length);
extern PERFTOOLS_DLL_DECL void (*log_message_writer)(const char* msg, int length);
} // end tcmalloc namespace

View File

@ -147,6 +147,9 @@
# define WIN32_DO_PATCHING 1
#endif
// Some windows file somewhere (at least on cygwin) #define's small (!)
#undef small
using STL_NAMESPACE::max;
using STL_NAMESPACE::numeric_limits;
using STL_NAMESPACE::vector;

View File

@ -65,14 +65,15 @@
/*
* 4018: signed/unsigned mismatch is common (and ok for signed_i < unsigned_i)
* 4244: otherwise we get problems when substracting two size_t's to an int
* 4244: otherwise we get problems when subtracting two size_t's to an int
* 4288: VC++7 gets confused when a var is defined in a loop and then after it
* 4267: too many false positives for "conversion gives possible data loss"
* 4290: it's ok windows ignores the "throw" directive
* 4996: Yes, we're ok using "unsafe" functions like vsnprintf and getenv()
* 4146: internal_logging.cc intentionally negates an unsigned value
*/
#ifdef _MSC_VER
#pragma warning(disable:4018 4244 4288 4267 4290 4996)
#pragma warning(disable:4018 4244 4288 4267 4290 4996 4146)
#endif
#ifndef __cplusplus