DOS/Windows-specific code in sim/

Eli Zaretskii
2001-05-08T04:54:00Z

* sim/callback.c:

#if defined(__GO32__) || defined (_MSC_VER)
static int
os_poll_quit (p)
host_callback *p;
{
#if defined(__GO32__)
int kbhit ();
int getkey ();
if (kbhit ())
{
int k = getkey ();
if (k == 1)
{
return 1;
}
else if (k == 2)
{
return 1;
}
else
{
sim_cb_eprintf (p, "CTRL-A to quit, CTRL-B to quit harder\n");
}
}
#endif
#if defined (_MSC_VER)
/* NB - this will not compile! */
int k = win32pollquit();
if (k == 1)
return 1;
else if (k == 2)
return 1;
#endif
return 0;
}
#else
#define os_poll_quit 0
#endif /* defined(__GO32__) || defined(_MSC_VER) */

This is an old code which was changed in utils.c long ago. Is some
platform still using this?

* sim/common/sim-signal.c:

#ifdef _MSC_VER
#ifndef SIGTRAP
#define SIGTRAP 5
#endif
#ifndef SIGBUS
#define SIGBUS 10
#endif
#ifndef SIGQUIT
#define SIGQUIT 3
#endif
#endif

Does someone know why this is done? If SIGTRAP etc. are not defined,
the code should simply not reference it.

* sim/common/sim-types.h:

#if !defined (SIM_TYPES_H) && defined (_MSC_VER)
#define SIM_TYPES_H

/* bit based */

#define UNSIGNED32(X) (X##ui32)
#define UNSIGNED64(X) (X##ui64)

#define SIGNED32(X) (X##i32)
#define SIGNED64(X) (X##i64)

typedef signed char signed8;
typedef signed short signed16;
typedef signed int signed32;
typedef signed __int64 signed64;

typedef unsigned int unsigned8;
typedef unsigned int unsigned16;
typedef unsigned int unsigned32;
typedef unsigned __int64 unsigned64;

typedef struct { unsigned64 a[2]; } unsigned128;
typedef struct { signed64 a[2]; } signed128;

#endif /* _MSC_VER */

Does anyone know why is this ifdef'ed away for MSC?