28#ifndef XCOM_STANDALONE
49#define FWD_ITER(head, type, action) \
51 linkage *p = link_first(head); \
52 while (p != (head)) { \
53 linkage *_next = link_first(p); \
55 type *link_iter = (type *)p; \
64#define REV_ITER(head, type, action) \
66 linkage *p = link_last(head); \
67 while (p != (head)) { \
68 linkage *_next = link_last(p); \
70 type *link_iter = (type *)p; \
79#define container_of(ptr, type, member) \
80 ((type *)(((char *)(ptr)) - offsetof(type, member)))
82#define NULL_TYPE 0xdefaced
84#ifdef USE_LINK_SANITY_CHECK
85#define LINK_SANITY_CHECK(x) \
90#define TYPE_SANITY_CHECK(x, y) \
91 { assert((x)->type == (y)->type); }
93#define LINK_SANITY_CHECK(x)
94#define TYPE_SANITY_CHECK(x, y)
97#define link_into(self, s) link_precede(self, s)
119 self->suc =
self->pred =
self;
129 self->suc->pred =
self->pred;
130 self->pred->suc =
self->suc;
131 self->suc =
self->pred =
self;
Header for compiler-dependent features.
required string type
Definition: replication_group_member_actions.proto:34
#define FWD_ITER(head, type, action)
Definition: simset.h:49
static linkage * link_init(linkage *self, unsigned int type)
Definition: simset.h:116
#define LINK_SANITY_CHECK(x)
Definition: simset.h:93
static linkage * link_extract_last(linkage *self)
Definition: simset.h:110
static void link_precede(linkage *self, linkage *ptr)
Definition: simset.h:150
char * dbg_linkage(linkage *self)
Definition: simset.cc:35
#define TYPE_SANITY_CHECK(x, y)
Definition: simset.h:94
static linkage * link_last(linkage *self)
Definition: simset.h:104
static linkage * link_out(linkage *self)
Definition: simset.h:124
static linkage * link_first(linkage *self)
Definition: simset.h:102
static int cardinal(linkage *self)
Definition: simset.h:164
static linkage * link_extract_first(linkage *self)
Definition: simset.h:106
static void link_follow(linkage *self, linkage *ptr)
Definition: simset.h:137
static int link_empty(linkage *self)
Definition: simset.h:114
linkage * pred
Definition: simset.h:40
unsigned int type
Definition: simset.h:37
linkage * suc
Definition: simset.h:39
int n
Definition: xcom_base.cc:509