From 23401227cb5fb47bb2b6fbe0407fd811512d4d9d Mon Sep 17 00:00:00 2001
From: Peiyuan Song <squallatf@gmail.com>
Date: Fri, 12 Dec 2025 09:17:51 -0800
Subject: [PATCH 1/4] Resolved conflict between #define B and system headers

regs51.h has pre-processor defines for special purpose registers (SPRs)
of the s51 architecture which includes a "B" SPR.

As a result, regs51.h contains the line:

    #define B (0xf0)

Unfortunately, the GCC headers contain function definitions such as this:

    __m256bh _mm256_roundscale_pbh (__m256bh __A, int B);

These GCC headers are imported via the winsock2.h.

To prevent collision between the "B" define and usage of "B" in GCC's
headers, this patch includes cmdutil.h early in the file, since
cmdutil.h includes winsock2.h .
---
 sim/ucsim/src/sims/s51.src/port.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sim/ucsim/src/sims/s51.src/port.cc b/sim/ucsim/src/sims/s51.src/port.cc
index 03ef499f1..7a869e54e 100644
--- a/sim/ucsim/src/sims/s51.src/port.cc
+++ b/sim/ucsim/src/sims/s51.src/port.cc
@@ -30,6 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 // cmd
 #include "argcl.h"
+#include "cmdutil.h"
 
 // local
 #include "regs51.h"
-- 
2.52.0

