Changed code to avoid a bug in gcc-3.3 (and also visual studio 2005)

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403577
This commit is contained in:
Davis King 2010-05-03 21:34:30 +00:00
parent 93971a811a
commit 42a4f363c6
1 changed files with 10 additions and 0 deletions

View File

@ -597,7 +597,17 @@ namespace dlib
) )
{ {
logger::hook_mfp hook; logger::hook_mfp hook;
// There is a bug in one of the versions (but not all apparently) of
// Visual studio 2005 that causes it to error out if <T> isn't in the
// following line of code. However, there is also a bug in gcc-3.3
// that causes it to error out if <T> is present. So this works around
// this problem.
#if _MSC_VER == 1400
hook.set<T>(object, hook_); hook.set<T>(object, hook_);
#else
hook.set(object, hook_);
#endif
logger::global_data& gd = logger::get_global_data(); logger::global_data& gd = logger::get_global_data();
auto_mutex M(gd.m); auto_mutex M(gd.m);