Code

object.h: Added SC_OBJECT_WRAPPER_STATIC().
authorSebastian Harl <sh@tokkee.org>
Thu, 13 Dec 2012 12:37:14 +0000 (13:37 +0100)
committerSebastian Harl <sh@tokkee.org>
Thu, 13 Dec 2012 12:37:14 +0000 (13:37 +0100)
This may be used to initialize static sc_object_wrapper_t objects.

src/include/core/object.h

index cd91086..71d0297 100644 (file)
@@ -82,6 +82,9 @@ sc_object_create(size_t size, int (*init)(sc_object_t *, va_list),
 sc_object_t *
 sc_object_create_wrapper(void *data, void (*destructor)(void *));
 
+#define SC_OBJECT_WRAPPER_STATIC(obj, destructor) \
+       { SC_OBJECT_INIT, (obj), (destructor) }
+
 /*
  * sc_object_deref:
  * Dereference the object and free the allocated memory in case the ref-count