00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef log4c_location_info_h
00012 #define log4c_location_info_h
00013
00023 #include <log4c/defs.h>
00024
00025 __LOG4C_BEGIN_DECLS
00026
00038 typedef struct
00039 {
00040 const char* loc_file;
00041 int loc_line;
00042 const char* loc_function;
00043
00044 } log4c_location_info_t;
00045
00049 #ifdef __GNUC__
00050 # define LOG4C_LOCATION_INFO_INITIALIZER { __FILE__, __LINE__, __FUNCTION__ }
00051 #else
00052 # define LOG4C_LOCATION_INFO_INITIALIZER { __FILE__, __LINE__, "(nil)" }
00053 #endif
00054
00055 #define __log4c_str(n) #n
00056
00057 #ifdef __GNUC__
00058 # define __log4c_location(n) __FUNCTION__ "() at " __FILE__ ":" __log4c_str(n)
00059 #else
00060 # define __log4c_location(n) __FILE__ ":" __log4c_str(n)
00061 #endif
00062
00067 #define log4c_location __log4c_location(__LINE__)
00068
00069 __LOG4C_END_DECLS
00070
00071 #endif