From 9400fce82dcf773c9862006a41681a73b22cbd87 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 29 Jan 2011 19:14:45 -0500 Subject: Add dmnsn_[un]likely() macros and a profiling framework. --- libdimension/dimension.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libdimension/dimension.h') diff --git a/libdimension/dimension.h b/libdimension/dimension.h index 9f7fd67..73cab50 100644 --- a/libdimension/dimension.h +++ b/libdimension/dimension.h @@ -44,6 +44,21 @@ extern "C" { #endif +/* Common macros */ + +/** + * @internal + * @def DMNSN_FUNC + * @brief Expands to the name of the current function + */ +#ifdef __GNUC__ + #define DMNSN_FUNC __PRETTY_FUNCTION__ +#elif __STDC_VERSION__ >= 199901L + #define DMNSN_FUNC __func__ +#else + #define DMNSN_FUNC "" +#endif + /* Common types */ /** -- cgit v1.2.3