medit/moo/mooutils/mooonce.h

19 lines
491 B
C
Raw Normal View History

2010-01-21 23:42:47 -08:00
#ifndef MOO_ONCE_H
#define MOO_ONCE_H
#include <glib.h>
#include <mooutils/mooutils-macros.h>
#define MOO_DO_ONCE_BEGIN \
do { \
static gsize _moo_do_once = 0; \
if (g_once_init_enter (&_moo_do_once)) \
2010-01-21 23:42:47 -08:00
{
#define MOO_DO_ONCE_END \
g_once_init_leave (&_moo_do_once, 1); \
2010-01-21 23:42:47 -08:00
} \
} while (0);
#endif /* MOO_ONCE_H */