diff --git a/scripts/apibuild.py b/scripts/apibuild.py index 2f7314b379a7ba98dbe95a831fa420796e604053..05a169c30d794d817be95e8935c28f34a804c216 100755 --- a/scripts/apibuild.py +++ b/scripts/apibuild.py @@ -1657,6 +1657,13 @@ class CParser: token = ("name", "virloginit") return token + elif token[0] == "name" and token[1] == "G_STATIC_ASSERT": + # skip whole line + while token is not None and not (token[0] == "sep" and + token[1] == ";"): + token = self.token() + return self.token() + elif token[0] == "name": if self.type == "": self.type = token[1] diff --git a/src/util/virerror.c b/src/util/virerror.c index fd2f77329f12675d5e2022f5a6333398e58184ac..aac6ee359723d91299bbf172232669c166e2c8e1 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -910,7 +910,7 @@ typedef struct { } virErrorMsgTuple; -const virErrorMsgTuple virErrorMsgStrings[VIR_ERR_NUMBER_LAST] = { +static const virErrorMsgTuple virErrorMsgStrings[] = { [VIR_ERR_OK] = { NULL, NULL }, [VIR_ERR_INTERNAL_ERROR] = { N_("internal error"), @@ -1235,6 +1235,8 @@ const virErrorMsgTuple virErrorMsgStrings[VIR_ERR_NUMBER_LAST] = { N_("network port not found: %s") }, }; +G_STATIC_ASSERT(G_N_ELEMENTS(virErrorMsgStrings) == VIR_ERR_NUMBER_LAST); + /** * virErrorMsg: