From: mquinson Date: Fri, 1 Jul 2005 20:33:49 +0000 (+0000) Subject: s/_XBT_GNUC_FUNCTION/_XBT_FUNCTION/ (that's how to get __FUNCTION__ portably) X-Git-Tag: v3.3~3829 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3d2c6d00f1e8b5d3bb8ab17ff60f0c3833d42e3e?hp=3f3a9768bca32b22232ebcaa3485d4a8d1a781bc;ds=sidebyside s/_XBT_GNUC_FUNCTION/_XBT_FUNCTION/ (that's how to get __FUNCTION__ portably) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1527 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/xbt/log.h b/include/xbt/log.h index c730041b77..970571b2ec 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -279,7 +279,7 @@ extern xbt_log_appender_t xbt_log_default_appender; #define _XBT_LOG_PRE(catv, priority) do { \ if (_XBT_LOG_ISENABLEDV(catv, priority)) { \ s_xbt_log_event_t _log_ev = \ - {&(catv),priority,__FILE__,_XBT_GNUC_FUNCTION,__LINE__}; \ + {&(catv),priority,__FILE__,_XBT_FUNCTION,__LINE__}; \ _xbt_log_event_log(&_log_ev #define _XBT_LOG_POST \ @@ -535,12 +535,12 @@ extern xbt_log_appender_t xbt_log_default_appender; #define CRITICAL6(f,a1,a2,a3,a4,a5,a6) LOG6(xbt_log_priority_critical, f,a1,a2,a3,a4,a5,a6) /* @} */ -#define XBT_IN LOG1(xbt_log_priority_trace, ">> begin of %s", _XBT_GNUC_FUNCTION) -#define XBT_IN1(fmt,a) LOG2(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_GNUC_FUNCTION, a) -#define XBT_IN2(fmt,a,b) LOG3(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_GNUC_FUNCTION, a,b) -#define XBT_IN3(fmt,a,b,c) LOG4(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_GNUC_FUNCTION, a,b,c) -#define XBT_IN4(fmt,a,b,c,d) LOG5(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_GNUC_FUNCTION, a,b,c,d) -#define XBT_OUT LOG1(xbt_log_priority_trace, "<< end of %s", _XBT_GNUC_FUNCTION) +#define XBT_IN LOG1(xbt_log_priority_trace, ">> begin of %s", _XBT_FUNCTION) +#define XBT_IN1(fmt,a) LOG2(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a) +#define XBT_IN2(fmt,a,b) LOG3(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b) +#define XBT_IN3(fmt,a,b,c) LOG4(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b,c) +#define XBT_IN4(fmt,a,b,c,d) LOG5(xbt_log_priority_trace, ">> begin of %s" fmt, _XBT_FUNCTION, a,b,c,d) +#define XBT_OUT LOG1(xbt_log_priority_trace, "<< end of %s", _XBT_FUNCTION) #define XBT_HERE LOG0(xbt_log_priority_trace, "-- was here") #endif /* ! _XBT_LOG_H_ */ diff --git a/include/xbt/misc.h b/include/xbt/misc.h index 22eb2194ec..0a97552880 100644 --- a/include/xbt/misc.h +++ b/include/xbt/misc.h @@ -33,11 +33,13 @@ /* inline and __FUNCTION__ are only in GCC when -ansi is off */ #if defined(__GNUC__) && ! defined(__STRICT_ANSI__) - -# define _XBT_GNUC_FUNCTION __FUNCTION__ +# define _XBT_FUNCTION __FUNCTION__ +# define _XBT_INLINE inline +#elif (defined(__STDC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) +# define _XBT_FUNC__ __func__ /* ISO-C99 compliant */ # define _XBT_INLINE inline #else -# define _XBT_GNUC_FUNCTION "function" +# define _XBT_FUNCTION "function" # define _XBT_INLINE #endif