summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension/refcount.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-12-14 19:51:25 -0500
committerTavian Barnes <tavianator@gmail.com>2011-12-15 20:02:12 -0500
commit6b94e0329841ed8e80dbb55a3f8c2eee41b3168b (patch)
treef4f5b2b8519744475c05ce4ba813740dcc1db4b8 /libdimension/dimension/refcount.h
parentbfbe9e43e108f6816c17b9b7764b75284ac78313 (diff)
downloaddimension-6b94e0329841ed8e80dbb55a3f8c2eee41b3168b.tar.xz
Make refcount declarations uniform.
Diffstat (limited to 'libdimension/dimension/refcount.h')
-rw-r--r--libdimension/dimension/refcount.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/libdimension/dimension/refcount.h b/libdimension/dimension/refcount.h
index f9f3286..9f6d8b0 100644
--- a/libdimension/dimension/refcount.h
+++ b/libdimension/dimension/refcount.h
@@ -23,10 +23,11 @@
* Generic reference count implementation.
*/
-/**
- * Reference counter.
- */
-typedef unsigned int dmnsn_refcount;
+/** @internal The name of the reference count field in all structs. */
+#define DMNSN_REFCOUNT_NAME refcount
+
+/** @internal Declare a reference count field in a struct. */
+#define DMNSN_REFCOUNT unsigned int DMNSN_REFCOUNT_NAME
/**
* Increment a reference count.
@@ -37,6 +38,6 @@ typedef unsigned int dmnsn_refcount;
/* Suppress "address will always evaluate to true" warning */ \
void *testptr = (object); \
if (testptr) { \
- ++(object)->refcount; \
+ ++(object)->DMNSN_REFCOUNT_NAME; \
} \
} while (0)