Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49372 - in sandbox/tools/profile_templates: . src
From: steven_at_[hidden]
Date: 2008-10-17 14:29:58


Author: steven_watanabe
Date: 2008-10-17 14:29:58 EDT (Fri, 17 Oct 2008)
New Revision: 49372
URL: http://svn.boost.org/trac/boost/changeset/49372

Log:
Add gcc 4.3 support
Text files modified:
   sandbox/tools/profile_templates/src/filter.cpp | 1 +
   sandbox/tools/profile_templates/src/postprocess.cpp | 10 ++++++++++
   sandbox/tools/profile_templates/template_profiler.hpp | 35 +++++++++++++++++++++--------------
   3 files changed, 32 insertions(+), 14 deletions(-)

Modified: sandbox/tools/profile_templates/src/filter.cpp
==============================================================================
--- sandbox/tools/profile_templates/src/filter.cpp (original)
+++ sandbox/tools/profile_templates/src/filter.cpp 2008-10-17 14:29:58 EDT (Fri, 17 Oct 2008)
@@ -9,6 +9,7 @@
 
 #include <string>
 #include <cstdio>
+#include <cstring>
 
 const char* search("template_profiler");
 

Modified: sandbox/tools/profile_templates/src/postprocess.cpp
==============================================================================
--- sandbox/tools/profile_templates/src/postprocess.cpp (original)
+++ sandbox/tools/profile_templates/src/postprocess.cpp 2008-10-17 14:29:58 EDT (Fri, 17 Oct 2008)
@@ -29,12 +29,22 @@
 
 #elif defined(__GNUC__)
 
+#if (__GNUC__ < 4) || (__GNUC_MINOR__ < 3)
+
 boost::regex warning_message("(.*): warning: division by zero in .template_profiler::value / 0.");
 boost::regex call_graph_line("(.*):(\\d+): instantiated from .*");
 boost::regex split_file_and_line("(.*):(\\d+)");
 
 #else
 
+boost::regex warning_message("(.*): warning: .int template_profiler::f\\(int\\).*");
+boost::regex call_graph_line("(.*):(\\d+): instantiated from .*");
+boost::regex split_file_and_line("(.*):(\\d+)");
+
+#endif
+
+#else
+
 #error Unknown Compiler
 
 #endif

Modified: sandbox/tools/profile_templates/template_profiler.hpp
==============================================================================
--- sandbox/tools/profile_templates/template_profiler.hpp (original)
+++ sandbox/tools/profile_templates/template_profiler.hpp 2008-10-17 14:29:58 EDT (Fri, 17 Oct 2008)
@@ -22,20 +22,27 @@
 #if defined(_MSC_VER)
     #define PROFILE_TRACER() enum template_profiler_test { template_profiler_value = sizeof(delete ((::template_profiler::incomplete*)0),0) };
 #elif defined(__GNUC__)
- #define PROFILE_TRACER()\
- struct template_profiler_test {};\
- enum {template_profiler_size = sizeof(template_profiler_size_one(static_cast<template_profiler_test*>(0))) };\
- typedef ::template_profiler::int_<\
- sizeof(\
- ::template_profiler::value /\
- ::template_profiler::make_zero<\
- ::template_profiler::int_<\
- template_profiler_size\
- >\
- >::value\
- )\
- > template_profiler_test_result;
-
+ #if (__GNUC__ < 4) || (__GNUC_MINOR__ < 3)
+ #define PROFILE_TRACER()\
+ struct template_profiler_test {};\
+ enum {template_profiler_size = sizeof(template_profiler_size_one(static_cast<template_profiler_test*>(0))) };\
+ typedef ::template_profiler::int_<\
+ sizeof(\
+ ::template_profiler::value /\
+ ::template_profiler::make_zero<\
+ ::template_profiler::int_<\
+ template_profiler_size\
+ >\
+ >::value\
+ )\
+ > template_profiler_test_result;
+ #else
+ namespace template_profiler {
+ __attribute__((deprecated)) int f(int);
+ int f(double);
+ }
+ #define PROFILE_TRACER() enum { template_profiler_size = sizeof(::template_profiler::f(1)) };
+ #endif
 #else
     #error Unknown compiler
 #endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk