X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fovsdb-idlc.in;h=c89048eeb291f15b84ed673866456d00f47d88b7;hb=6fce4487240b12104f3984e0bc36f9183e2fcccb;hp=6a0303dbbfa770590e665d6b38a9ccd4797cae51;hpb=a0bc29a541fc7dc6e20137d5558e2094d614e6ab;p=openvswitch diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in index 6a0303db..c89048ee 100755 --- a/ovsdb/ovsdb-idlc.in +++ b/ovsdb/ovsdb-idlc.in @@ -158,7 +158,14 @@ def printCIDLHeader(schemaFile): print ''' const struct %(s)s *%(s)s_first(const struct ovsdb_idl *); const struct %(s)s *%(s)s_next(const struct %(s)s *); -#define %(S)s_FOR_EACH(ROW, IDL) for ((ROW) = %(s)s_first(IDL); (ROW); (ROW) = %(s)s_next(ROW)) +#define %(S)s_FOR_EACH(ROW, IDL) \\ + for ((ROW) = %(s)s_first(IDL); \\ + (ROW); \\ + (ROW) = %(s)s_next(ROW)) +#define %(S)s_FOR_EACH_SAFE(ROW, NEXT, IDL) \\ + for ((ROW) = %(s)s_first(IDL); \\ + (ROW) ? ((NEXT) = %(s)s_next(ROW), 1) : 0; \\ + (ROW) = (NEXT)) void %(s)s_delete(const struct %(s)s *); struct %(s)s *%(s)s_insert(struct ovsdb_idl_txn *);