Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/utility/current_function_test.cpp @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 1.1 KB
Line 
1#include <boost/config.hpp>
2
3#if defined(BOOST_MSVC)
4#pragma warning(disable: 4786)  // identifier truncated in debug info
5#pragma warning(disable: 4710)  // function not inlined
6#pragma warning(disable: 4711)  // function selected for automatic inline expansion
7#pragma warning(disable: 4514)  // unreferenced inline removed
8#endif
9
10//
11//  current_function_test.cpp - a test for boost/current_function.hpp
12//
13//  Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
14//
15// Distributed under the Boost Software License, Version 1.0. (See
16// accompanying file LICENSE_1_0.txt or copy at
17// http://www.boost.org/LICENSE_1_0.txt)
18//
19
20#include <boost/current_function.hpp>
21#include <boost/config.hpp>
22#include <cstdio>
23
24void message(char const * file, long line, char const * func, char const * msg)
25{
26#if !defined(BOOST_NO_STDC_NAMESPACE)
27    using std::printf;
28#endif
29
30    printf("%s(%ld): %s in function '%s'\n", file, line, msg, func);
31}
32
33#define MESSAGE(msg) message(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, msg)
34
35int main()
36{
37    MESSAGE("assertion failed");
38
39    return 0;
40}
Note: See TracBrowser for help on using the repository browser.