aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorFelix Lee <flee@cygnus>1997-07-28 22:34:36 +0000
committerFelix Lee <flee@cygnus>1997-07-28 22:34:36 +0000
commitce4450fa09dafa36b069185fe198f14d038a1985 (patch)
tree2ff2935fcab87780d990d8f8ab6d128dc9cb7f7d /gdb/utils.c
parent8dbbb8be9b0f0211ff8af51aaab1cbebcbdab24c (diff)
downloadgdb-ce4450fa09dafa36b069185fe198f14d038a1985.zip
gdb-ce4450fa09dafa36b069185fe198f14d038a1985.tar.gz
gdb-ce4450fa09dafa36b069185fe198f14d038a1985.tar.bz2
* Makefile.in (init.c): don't try to scan mswin for _initialize
funcs. (generates misleading error message because files have .cpp suffix, not .c suffix) * ser-e7kpc.c: <w32sut.h> -> "mswin/w32sut.h" * mon960-rom.c: removed unused #includes; no ioctl.h in Windows. * nindy-share/ttyflush.c: find sleep() for _MSC_VER. * remote-array.c: #include <ctype.h> for isascii(). * utils.c (notice_quit,pollquit): cleanup. _WIN32 -> _MSC_VER.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c87
1 files changed, 27 insertions, 60 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 716f92e..a2699d6 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -607,97 +607,64 @@ quit ()
}
-#if defined(__GO32__) || defined (_WIN32)
+#if defined(__GO32__)
-#ifndef _MSC_VER
/* In the absence of signals, poll keyboard for a quit.
Called from #define QUIT pollquit() in xm-go32.h. */
void
-pollquit()
+notice_quit()
{
if (kbhit ())
- {
- int k = getkey ();
- if (k == 1) {
+ switch (getkey ())
+ {
+ case 1:
quit_flag = 1;
- quit();
- }
- else if (k == 2) {
- immediate_quit = 1;
- quit ();
+ break;
+ case 2:
+ immediate_quit = 2;
+ break;
+ default:
+ /* We just ignore it */
+ /* FIXME!! Don't think this actually works! */
+ fprintf_unfiltered (gdb_stderr, "CTRL-A to quit, CTRL-B to quit harder\n");
+ break;
}
- else
- {
- /* We just ignore it */
- /* FIXME!! Don't think this actually works! */
- fprintf_unfiltered (gdb_stderr, "CTRL-A to quit, CTRL-B to quit harder\n");
- }
- }
}
-#else /* !_MSC_VER */
-/* This above code is not valid for wingdb unless
- * getkey and kbhit were to be rewritten.
+#elif defined(_MSC_VER) /* should test for wingdb instead? */
+
+/*
* Windows translates all keyboard and mouse events
* into a message which is appended to the message
* queue for the process.
*/
-void
-pollquit()
+
+void notice_quit()
{
int k = win32pollquit();
if (k == 1)
- {
quit_flag = 1;
- quit ();
- }
else if (k == 2)
- {
immediate_quit = 1;
- quit ();
- }
}
-#endif /* !_MSC_VER */
+#else /* !defined(__GO32__) && !defined(_MSC_VER) */
-#ifndef _MSC_VER
void notice_quit()
{
- if (kbhit ())
- {
- int k = getkey ();
- if (k == 1) {
- quit_flag = 1;
- }
- else if (k == 2)
- {
- immediate_quit = 1;
- }
- else
- {
- fprintf_unfiltered (gdb_stderr, "CTRL-A to quit, CTRL-B to quit harder\n");
- }
- }
+ /* Done by signals */
}
-#else /* !_MSC_VER */
-void notice_quit()
-{
- int k = win32pollquit();
- if (k == 1)
- quit_flag = 1;
- else if (k == 2)
- immediate_quit = 1;
-}
-#endif /* !_MSC_VER */
+#endif /* !defined(__GO32__) && !defined(_MSC_VER) */
-#else
-void notice_quit()
+void
+pollquit()
{
- /* Done by signals */
+ notice_quit ();
+ if (quit_flag || immediate_quit)
+ quit ();
}
-#endif /* defined(__GO32__) || defined(_WIN32) */
/* Control C comes here */