]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim/erc32: Rename EVENT_MAX -> MAX_EVENTS
authorOrgad Shaneh <orgads@gmail.com>
Sun, 3 Mar 2024 10:22:14 +0000 (12:22 +0200)
committerTom Tromey <tromey@adacore.com>
Thu, 21 Mar 2024 16:46:23 +0000 (10:46 -0600)
EVENT_MAX is defined as 0x7FFFFFFF (INT_MAX) in winuser.h, so when
building on Windows, the value is overridden and compilation fails
because the array size of evbuf is too large.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28476
Approved-By: Tom Tromey <tom@tromey.com>
sim/erc32/func.c
sim/erc32/sis.h

index 972a636e619e286517db3f51556312d9b886214e..80f416d87d735f8162d3bf18ee6c6ffd408bce7f 100644 (file)
@@ -697,7 +697,7 @@ init_signals(void)
 extern struct disassemble_info dinfo;
 
 struct estate   ebase;
-struct evcell   evbuf[EVENT_MAX];
+struct evcell   evbuf[MAX_EVENTS];
 struct irqcell  irqarr[16];
 
 static int
@@ -864,10 +864,10 @@ init_event(void)
 
     ebase.eq.nxt = NULL;
     ebase.freeq = evbuf;
-    for (i = 0; i < EVENT_MAX; i++) {
+    for (i = 0; i < MAX_EVENTS; i++) {
        evbuf[i].nxt = &evbuf[i + 1];
     }
-    evbuf[EVENT_MAX - 1].nxt = NULL;
+    evbuf[MAX_EVENTS - 1].nxt = NULL;
 }
 
 void
index 504d7e69c7759befd4830c728e36d3afae3a7015..cf44ddfb7fed4067bcad0ce3a5b21885bc4fe37f 100644 (file)
@@ -31,7 +31,7 @@
 #define I_ACC_EXC 1
 
 /* Maximum events in event queue */
-#define EVENT_MAX      256
+#define MAX_EVENTS     256
 
 /* Maximum # of floating point queue */
 #define FPUQN  1