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 | |
---|
24 | void 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 | |
---|
35 | int main() |
---|
36 | { |
---|
37 | MESSAGE("assertion failed"); |
---|
38 | |
---|
39 | return 0; |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.