Description: 将 libsepol 的 cond_expr_t 结构体成员与 bool_copy_callback 局部变量
 的 bool 标识符重命名为 boolean。GCC 15 默认 -std=gnu17 已将 bool 设为内置关键字，
 与这些标识符冲突导致编译失败；该项无法通过构建参数规避，故重命名（成员偏移不变，
 ABI 保持一致）。
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Forwarded: not-needed
Last-Update: 2026-08-27

--- android-platform-external-libselinux-10.0.0+r36.orig/libsepol/include/sepol/policydb/conditional.h
+++ android-platform-external-libselinux-10.0.0+r36/libsepol/include/sepol/policydb/conditional.h
@@ -54,7 +54,7 @@ typedef struct cond_expr {
 #define COND_NEQ	7	/* bool != bool */
 #define COND_LAST	COND_NEQ
 	uint32_t expr_type;
-	uint32_t bool;
+	uint32_t boolean;
 	struct cond_expr *next;
 } cond_expr_t;
 
--- android-platform-external-libselinux-10.0.0+r36.orig/libsepol/src/conditional.c
+++ android-platform-external-libselinux-10.0.0+r36/libsepol/src/conditional.c
@@ -124,7 +124,7 @@ int cond_expr_equal(cond_node_t * a, con
 		if (cur_a->expr_type != cur_b->expr_type)
 			return 0;
 		if (cur_a->expr_type == COND_BOOL) {
-			if (cur_a->bool != cur_b->bool)
+			if (cur_a->boolean != cur_b->boolean)
 				return 0;
 		}
 		cur_a = cur_a->next;
@@ -222,7 +222,7 @@ int cond_evaluate_expr(policydb_t * p, c
 			if (sp == (COND_EXPR_MAXDEPTH - 1))
 				return -1;
 			sp++;
-			s[sp] = p->bool_val_to_struct[cur->bool - 1]->state;
+			s[sp] = p->bool_val_to_struct[cur->boolean - 1]->state;
 			break;
 		case COND_NOT:
 			if (sp < 0)
@@ -278,7 +278,7 @@ cond_expr_t *cond_copy_expr(cond_expr_t
 		memset(new_expr, 0, sizeof(cond_expr_t));
 
 		new_expr->expr_type = cur->expr_type;
-		new_expr->bool = cur->bool;
+		new_expr->boolean = cur->boolean;
 
 		if (!head)
 			head = new_expr;
@@ -390,10 +390,10 @@ int cond_normalize_expr(policydb_t * p,
 		case COND_BOOL:
 			i = 0;
 			/* see if we've already seen this bool */
-			if (!bool_present(e->bool, cn->bool_ids, cn->nbools)) {
+			if (!bool_present(e->boolean, cn->bool_ids, cn->nbools)) {
 				/* count em all but only record up to COND_MAX_BOOLS */
 				if (cn->nbools < COND_MAX_BOOLS)
-					cn->bool_ids[cn->nbools++] = e->bool;
+					cn->bool_ids[cn->nbools++] = e->boolean;
 				else
 					cn->nbools++;
 			}
@@ -749,7 +749,7 @@ static int expr_isvalid(policydb_t * p,
 		return 0;
 	}
 
-	if (expr->bool > p->p_bools.nprim) {
+	if (expr->boolean > p->p_bools.nprim) {
 		printf
 		    ("security: conditional expressions uses unknown bool.\n");
 		return 0;
@@ -789,7 +789,7 @@ static int cond_read_node(policydb_t * p
 		memset(expr, 0, sizeof(cond_expr_t));
 
 		expr->expr_type = le32_to_cpu(buf[0]);
-		expr->bool = le32_to_cpu(buf[1]);
+		expr->boolean = le32_to_cpu(buf[1]);
 
 		if (!expr_isvalid(p, expr)) {
 			free(expr);
--- android-platform-external-libselinux-10.0.0+r36.orig/libsepol/src/expand.c
+++ android-platform-external-libselinux-10.0.0+r36/libsepol/src/expand.c
@@ -1071,11 +1071,11 @@ static int bool_copy_callback(hashtab_ke
 {
 	int ret;
 	expand_state_t *state;
-	cond_bool_datum_t *bool, *new_bool;
+	cond_bool_datum_t *boolean, *new_bool;
 	char *id, *new_id;
 
 	id = key;
-	bool = (cond_bool_datum_t *) datum;
+	boolean = (cond_bool_datum_t *) datum;
 	state = (expand_state_t *) data;
 
 	if (!is_id_enabled(id, state->base, SYM_BOOLS)) {
@@ -1083,7 +1083,7 @@ static int bool_copy_callback(hashtab_ke
 		return 0;
 	}
 
-	if (bool->flags & COND_BOOL_FLAGS_TUNABLE) {
+	if (boolean->flags & COND_BOOL_FLAGS_TUNABLE) {
 		/* Skip tunables */
 		return 0;
 	}
@@ -1117,10 +1117,10 @@ static int bool_copy_callback(hashtab_ke
 		return -1;
 	}
 
-	state->boolmap[bool->s.value - 1] = new_bool->s.value;
+	state->boolmap[boolean->s.value - 1] = new_bool->s.value;
 
-	new_bool->state = bool->state;
-	new_bool->flags = bool->flags;
+	new_bool->state = boolean->state;
+	new_bool->flags = boolean->flags;
 
 	return 0;
 }
@@ -2027,8 +2027,8 @@ static int cond_node_map_bools(expand_st
 
 	cur = cn->expr;
 	while (cur) {
-		if (cur->bool)
-			cur->bool = state->boolmap[cur->bool - 1];
+		if (cur->boolean)
+			cur->boolean = state->boolmap[cur->boolean - 1];
 		cur = cur->next;
 	}
 
@@ -2913,7 +2913,7 @@ static void discard_tunables(sepol_handl
 			     cur_expr = cur_expr->next) {
 				if (cur_expr->expr_type != COND_BOOL)
 					continue;
-				booldatum = pol->bool_val_to_struct[cur_expr->bool - 1];
+				booldatum = pol->bool_val_to_struct[cur_expr->boolean - 1];
 				if (booldatum->flags & COND_BOOL_FLAGS_TUNABLE)
 					tmp[tunables++] = booldatum;
 				else
--- android-platform-external-libselinux-10.0.0+r36.orig/libsepol/src/kernel_to_cil.c
+++ android-platform-external-libselinux-10.0.0+r36/libsepol/src/kernel_to_cil.c
@@ -43,7 +43,7 @@ static char *cond_expr_to_str(struct pol
 
 	for (curr = expr; curr != NULL; curr = curr->next) {
 		if (curr->expr_type == COND_BOOL) {
-			char *val1 = pdb->p_bool_val_to_name[curr->bool - 1];
+			char *val1 = pdb->p_bool_val_to_name[curr->boolean - 1];
 			new_val = create_str("%s", 1, val1);
 		} else {
 			const char *op;
--- android-platform-external-libselinux-10.0.0+r36.orig/libsepol/src/kernel_to_conf.c
+++ android-platform-external-libselinux-10.0.0+r36/libsepol/src/kernel_to_conf.c
@@ -42,7 +42,7 @@ static char *cond_expr_to_str(struct pol
 
 	for (curr = expr; curr != NULL; curr = curr->next) {
 		if (curr->expr_type == COND_BOOL) {
-			char *val1 = pdb->p_bool_val_to_name[curr->bool - 1];
+			char *val1 = pdb->p_bool_val_to_name[curr->boolean - 1];
 			new_val = create_str("%s", 1, val1);
 		} else {
 			const char *op;
--- android-platform-external-libselinux-10.0.0+r36.orig/libsepol/src/link.c
+++ android-platform-external-libselinux-10.0.0+r36/libsepol/src/link.c
@@ -1580,9 +1580,9 @@ static int copy_cond_list(cond_node_t *
 			/* expression nodes don't have a bool value of 0 - don't map them */
 			if (cur_expr->expr_type != COND_BOOL)
 				continue;
-			assert(module->map[SYM_BOOLS][cur_expr->bool - 1] != 0);
-			cur_expr->bool =
-			    module->map[SYM_BOOLS][cur_expr->bool - 1];
+			assert(module->map[SYM_BOOLS][cur_expr->boolean - 1] != 0);
+			cur_expr->boolean =
+			    module->map[SYM_BOOLS][cur_expr->boolean - 1];
 		}
 		new_node->nbools = cur->nbools;
 		/* FIXME should COND_MAX_BOOLS be used here? */
--- android-platform-external-libselinux-10.0.0+r36.orig/libsepol/src/module_to_cil.c
+++ android-platform-external-libselinux-10.0.0+r36/libsepol/src/module_to_cil.c
@@ -1282,7 +1282,7 @@ static int cond_expr_to_cil(int indent,
 
 	for (curr = cond_expr; curr != NULL; curr = curr->next) {
 		if (curr->expr_type == COND_BOOL) {
-			val1 = pdb->p_bool_val_to_name[curr->bool - 1];
+			val1 = pdb->p_bool_val_to_name[curr->boolean - 1];
 			// length of boolean + 2 parens + null terminator
 			len = strlen(val1) + 2 + 1;
 			new_val = malloc(len);
--- android-platform-external-libselinux-10.0.0+r36.orig/libsepol/src/write.c
+++ android-platform-external-libselinux-10.0.0+r36/libsepol/src/write.c
@@ -769,7 +769,7 @@ static int cond_write_node(policydb_t *
 	for (cur_expr = node->expr; cur_expr != NULL; cur_expr = cur_expr->next) {
 		items = 0;
 		buf[items++] = cpu_to_le32(cur_expr->expr_type);
-		buf[items++] = cpu_to_le32(cur_expr->bool);
+		buf[items++] = cpu_to_le32(cur_expr->boolean);
 		items2 = put_entry(buf, sizeof(uint32_t), items, fp);
 		if (items2 != items)
 			return POLICYDB_ERROR;
