1 /*
2  * Copyright 2006-2008 The FLWOR Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 #ifndef ZORBA_TRACER_H
18 #define ZORBA_TRACER_H
19 
20 namespace zorba {
21 
22 
23 #if !defined WIN32 && !defined WINCE
24 #define TRACE __PRETTY_FUNCTION__<<" ("<<__FILE__<<':'<<std::dec<<__LINE__<<")"
25 #define LOCATION	(__oss.str(""), \
26                    __oss<<__FILE__<<":"<<std::dec<<__LINE__<<"::"<<__PRETTY_FUNCTION__, \
27 									 __oss.str())
28 #elif defined WIN32
29 #define TRACE __FUNCSIG__<<" ("<<__FILE__<<':'<<std::dec<<__LINE__<<")"
30 #define LOCATION	(__oss.str(""), \
31                    __oss<<__FILE__<<":"<<std::dec<<__LINE__<<"::"<<__FUNCTION__, \
32 									 __oss.str())
33 #else
34 #define TRACE __FILE__<<':'<<std::dec<<__LINE__<<"::"<<__FUNCTION__
35 #define LOCATION	(__oss.str(""), \
36 										__oss<<__FILE__<<":"<<std::dec<<__LINE__<<"::"<<__FUNCTION__, \
37 										__oss.str())
38 #endif
39 
40 
41 } /* namespace zorba */
42 
43 #endif /* ZORBA_TRACER_H */
44 /* vim:set et sw=2 ts=2: */
45