| 
									
										
										
										
											2003-11-28 15:35:21 +00:00
										 |  |  | #include <boost/config.hpp>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if defined(BOOST_MSVC)
 | 
					
						
							| 
									
										
										
										
											2002-01-25 13:54:30 +00:00
										 |  |  | #pragma warning(disable: 4786)  // identifier truncated in debug info
 | 
					
						
							|  |  |  | #pragma warning(disable: 4710)  // function not inlined
 | 
					
						
							|  |  |  | #pragma warning(disable: 4711)  // function selected for automatic inline expansion
 | 
					
						
							|  |  |  | #pragma warning(disable: 4514)  // unreferenced inline removed
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | //  current_function_test.cpp - a test for boost/current_function.hpp
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | //  Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
 | 
					
						
							|  |  |  | //
 | 
					
						
							| 
									
										
										
										
											2004-07-26 00:32:12 +00:00
										 |  |  | // Distributed under the Boost Software License, Version 1.0. (See
 | 
					
						
							|  |  |  | // accompanying file LICENSE_1_0.txt or copy at
 | 
					
						
							|  |  |  | // http://www.boost.org/LICENSE_1_0.txt)
 | 
					
						
							| 
									
										
										
										
											2002-01-25 13:54:30 +00:00
										 |  |  | //
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <boost/current_function.hpp>
 | 
					
						
							| 
									
										
										
										
											2004-09-22 17:18:06 +00:00
										 |  |  | #include <boost/config.hpp>
 | 
					
						
							| 
									
										
										
										
											2002-01-25 13:54:30 +00:00
										 |  |  | #include <cstdio>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void message(char const * file, long line, char const * func, char const * msg) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2004-09-22 17:18:06 +00:00
										 |  |  | #if !defined(BOOST_NO_STDC_NAMESPACE)
 | 
					
						
							|  |  |  |     using std::printf; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     printf("%s(%ld): %s in function '%s'\n", file, line, msg, func); | 
					
						
							| 
									
										
										
										
											2002-01-25 13:54:30 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define MESSAGE(msg) message(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, msg)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int main() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     MESSAGE("assertion failed"); | 
					
						
							| 
									
										
										
										
											2004-09-24 06:17:26 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     return 0; | 
					
						
							| 
									
										
										
										
											2002-01-25 13:54:30 +00:00
										 |  |  | } |