1
0
mirror of https://github.com/simh/simh.git synced 2026-02-24 08:03:13 +00:00

simulators with global variables PC, SP and BC: Avoid name space collisions.

Avoid potential name space collision for the global variables PC, SP and BC
when readline is dynamically loaded.  For some unknown reason, ncurses
exports these internal variables which may be needed in the context of
how ncurses is used by readline implementations.  In any case, these
variable names are common in simulators, so there is an undesired
interaction between simulator internal variables and the simplest
solution is to rename these simulator global variables where they exist.
Another alternative is to merely declare these variables static when
they happen to only be referenced in a single simulator source module.
This commit is contained in:
Peter Kooiman
2025-04-09 13:56:27 -10:00
committed by Mark Pizzolato
parent dab8053cf8
commit ef8f4f53a2
8 changed files with 3559 additions and 3540 deletions

View File

@@ -27,9 +27,10 @@ Copyright (c) 2005-2012, William Beech
#include <ctype.h>
#include "sim_defs.h" // simulator defs
/* Rename of global PC variable to avoid namespace conflicts on some platforms */
/* Rename of global PC and SP variables to avoid namespace conflicts on some platforms */
#define PC PC_Global
#define SP SP_Global
//#define DONT_USE_INTERNAL_ROM 1