From 42a4f363c6fd7b2b9f57ec931e76ad31e94f133f Mon Sep 17 00:00:00 2001 From: Davis King Date: Mon, 3 May 2010 21:34:30 +0000 Subject: [PATCH] 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 --- dlib/logger/logger_kernel_1.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlib/logger/logger_kernel_1.h b/dlib/logger/logger_kernel_1.h index 6c4c379ed..ad27fc234 100644 --- a/dlib/logger/logger_kernel_1.h +++ b/dlib/logger/logger_kernel_1.h @@ -597,7 +597,17 @@ namespace dlib ) { 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 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 is present. So this works around + // this problem. +#if _MSC_VER == 1400 hook.set(object, hook_); +#else + hook.set(object, hook_); +#endif logger::global_data& gd = logger::get_global_data(); auto_mutex M(gd.m);