$OpenBSD: patch-arch_Mips_MipsInstPrinter_c,v 1.1 2017/11/06 08:54:28 rpointel Exp $

The 'mips' symbol is special on MIPS platforms, so rename it to prevent a
conflict.

--- arch/Mips/MipsInstPrinter.c.orig	Fri May  8 11:06:59 2015
+++ arch/Mips/MipsInstPrinter.c	Sat May  9 08:34:16 2015
@@ -93,12 +93,12 @@ static void set_mem_access(MCInst *MI, bool status)
 		return;
 
 	if (status) {
-		MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].type = MIPS_OP_MEM;
-		MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].mem.base = MIPS_REG_INVALID;
-		MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].mem.disp = 0;
+		MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].type = MIPS_OP_MEM;
+		MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].mem.base = MIPS_REG_INVALID;
+		MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].mem.disp = 0;
 	} else {
 		// done, create the next operand slot
-		MI->flat_insn->detail->mips.op_count++;
+		MI->flat_insn->detail->mipsen.op_count++;
 	}
 }
 
@@ -195,11 +195,11 @@ static void printOperand(MCInst *MI, unsigned OpNo, SS
 		reg = Mips_map_register(reg);
 		if (MI->csh->detail) {
 			if (MI->csh->doing_mem) {
-				MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].mem.base = reg;
+				MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].mem.base = reg;
 			} else {
-				MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].type = MIPS_OP_REG;
-				MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].reg = reg;
-				MI->flat_insn->detail->mips.op_count++;
+				MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].type = MIPS_OP_REG;
+				MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].reg = reg;
+				MI->flat_insn->detail->mipsen.op_count++;
 			}
 		}
 	} else if (MCOperand_isImm(Op)) {
@@ -219,7 +219,7 @@ static void printOperand(MCInst *MI, unsigned OpNo, SS
 				}
 			}
 			if (MI->csh->detail)
-				MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].mem.disp = imm;
+				MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].mem.disp = imm;
 		} else {
 			if (imm >= 0) {
 				if (imm > HEX_THRESHOLD)
@@ -234,9 +234,9 @@ static void printOperand(MCInst *MI, unsigned OpNo, SS
 			}
 
 			if (MI->csh->detail) {
-				MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].type = MIPS_OP_IMM;
-				MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].imm = imm;
-				MI->flat_insn->detail->mips.op_count++;
+				MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].type = MIPS_OP_IMM;
+				MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].imm = imm;
+				MI->flat_insn->detail->mipsen.op_count++;
 			}
 		}
 	}
@@ -259,9 +259,9 @@ static void printUnsignedImm(MCInst *MI, int opNum, SS
 				SStream_concat(O, "-%u", (short int)-imm);
 		}
 		if (MI->csh->detail) {
-			MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].type = MIPS_OP_IMM;
-			MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].imm = (unsigned short int)imm;
-			MI->flat_insn->detail->mips.op_count++;
+			MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].type = MIPS_OP_IMM;
+			MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].imm = (unsigned short int)imm;
+			MI->flat_insn->detail->mipsen.op_count++;
 		}
 	} else
 		printOperand(MI, opNum, O);
@@ -277,9 +277,9 @@ static void printUnsignedImm8(MCInst *MI, int opNum, S
 		else
 			SStream_concat(O, "%u", imm);
 		if (MI->csh->detail) {
-			MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].type = MIPS_OP_IMM;
-			MI->flat_insn->detail->mips.operands[MI->flat_insn->detail->mips.op_count].imm = imm;
-			MI->flat_insn->detail->mips.op_count++;
+			MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].type = MIPS_OP_IMM;
+			MI->flat_insn->detail->mipsen.operands[MI->flat_insn->detail->mipsen.op_count].imm = imm;
+			MI->flat_insn->detail->mipsen.op_count++;
 		}
 	} else
 		printOperand(MI, opNum, O);
