summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-01-29 19:14:45 -0500
committerTavian Barnes <tavianator@gmail.com>2011-01-29 19:14:45 -0500
commit9400fce82dcf773c9862006a41681a73b22cbd87 (patch)
tree8193cc766c169c15cf1e74145ea2432ac70286cd /libdimension/dimension.h
parent4f0c30aee2c56967895c981534414d1b04e9e0ce (diff)
downloaddimension-9400fce82dcf773c9862006a41681a73b22cbd87.tar.xz
Add dmnsn_[un]likely() macros and a profiling framework.
Diffstat (limited to 'libdimension/dimension.h')
-rw-r--r--libdimension/dimension.h15
1 files changed, 15 insertions, 0 deletions
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 "<unknown function>"
+#endif
+
/* Common types */
/**