summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/gccmacro.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-09-16 22:42:03 +0000
committerLennart Poettering <lennart@poettering.net>2007-09-16 22:42:03 +0000
commit116ddaaae9267d9f89f3d127cba62763246b441c (patch)
tree6c09bd5990ed3eedc22098ade6fd511ae9274037 /src/pulsecore/gccmacro.h
parent35483eeab7d08bc3e7ab2cd7a91e3d7453dca605 (diff)
use gcc const and pure function attributes wherever applicable
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1835 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/gccmacro.h')
-rw-r--r--src/pulsecore/gccmacro.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/pulsecore/gccmacro.h b/src/pulsecore/gccmacro.h
index f3ace593..d211c2e7 100644
--- a/src/pulsecore/gccmacro.h
+++ b/src/pulsecore/gccmacro.h
@@ -55,7 +55,26 @@
#ifdef __GNUC__
#define PA_GCC_DESTRUCTOR __attribute__ ((destructor))
#else
+/** Call this function when process terminates */
#define PA_GCC_DESTRUCTOR
#endif
+#ifndef PA_GCC_PURE
+#ifdef __GNUCC__
+#define PA_GCC_PURE __attribute__ ((pure))
+#else
+/** This function's return value depends only the arguments list and global state **/
+#define PA_GCC_PURE
+#endif
+#endif
+
+#ifndef PA_GCC_CONST
+#ifdef __GNUCC__
+#define PA_GCC_CONST __attribute__ ((pure))
+#else
+/** This function's return value depends only the arguments list (stricter version of PA_GCC_CONST) **/
+#define PA_GCC_CONST
+#endif
+#endif
+
#endif