Remove redundant header inclusions

and clean up some whitespace
This commit is contained in:
Matthias Clasen 2010-09-03 19:41:49 -04:00
parent 156a3f7195
commit 9b3fb41a5e
2 changed files with 37 additions and 35 deletions

View File

@ -21,11 +21,11 @@
* Modified by the GLib Team and others 1997-2000. See the AUTHORS * Modified by the GLib Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GLib Team. See the ChangeLog * file for a list of people on the GLib Team. See the ChangeLog
* files for a list of changes. These files are distributed with * files for a list of changes. These files are distributed with
* GLib at ftp://ftp.gtk.org/pub/gtk/. * GLib at ftp://ftp.gtk.org/pub/gtk/.
*/ */
/* /*
* MT safe ; except for g_on_error_stack_trace, but who wants thread safety * MT safe ; except for g_on_error_stack_trace, but who wants thread safety
* then * then
*/ */
@ -35,8 +35,6 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "glib.h"
#include "gprintfint.h"
#ifdef HAVE_SYS_TIME_H #ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
@ -61,12 +59,16 @@
#include <string.h> /* for bzero on BSD systems */ #include <string.h> /* for bzero on BSD systems */
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
# define STRICT /* Strict typing, please */ # define STRICT /* Strict typing, please */
# define _WIN32_WINDOWS 0x0401 /* to get IsDebuggerPresent */ # define _WIN32_WINDOWS 0x0401 /* to get IsDebuggerPresent */
# include <windows.h> # include <windows.h>
# undef STRICT # undef STRICT
#endif #endif
#include "gtypes.h"
#include "gprintfint.h"
#ifndef NO_FD_SET #ifndef NO_FD_SET
# define SELECT_MASK fd_set # define SELECT_MASK fd_set
#else #else
@ -96,27 +98,27 @@ g_on_error_query (const gchar *prg_name)
if (!prg_name) if (!prg_name)
prg_name = g_get_prgname (); prg_name = g_get_prgname ();
retry: retry:
if (prg_name) if (prg_name)
_g_fprintf (stdout, _g_fprintf (stdout,
"%s (pid:%u): %s%s%s: ", "%s (pid:%u): %s%s%s: ",
prg_name, prg_name,
(guint) getpid (), (guint) getpid (),
query1, query1,
query2, query2,
query3); query3);
else else
_g_fprintf (stdout, _g_fprintf (stdout,
"(process:%u): %s%s: ", "(process:%u): %s%s: ",
(guint) getpid (), (guint) getpid (),
query1, query1,
query3); query3);
fflush (stdout); fflush (stdout);
if (isatty(0) && isatty(1)) if (isatty(0) && isatty(1))
fgets (buf, 8, stdin); fgets (buf, 8, stdin);
else else
strcpy (buf, "E\n"); strcpy (buf, "E\n");
@ -124,20 +126,20 @@ g_on_error_query (const gchar *prg_name)
&& buf[1] == '\n') && buf[1] == '\n')
_exit (0); _exit (0);
else if ((buf[0] == 'P' || buf[0] == 'p') else if ((buf[0] == 'P' || buf[0] == 'p')
&& buf[1] == '\n') && buf[1] == '\n')
return; return;
else if (prg_name else if (prg_name
&& (buf[0] == 'S' || buf[0] == 's') && (buf[0] == 'S' || buf[0] == 's')
&& buf[1] == '\n') && buf[1] == '\n')
{ {
g_on_error_stack_trace (prg_name); g_on_error_stack_trace (prg_name);
goto retry; goto retry;
} }
else if ((buf[0] == 'H' || buf[0] == 'h') else if ((buf[0] == 'H' || buf[0] == 'h')
&& buf[1] == '\n') && buf[1] == '\n')
{ {
while (glib_on_error_halt) while (glib_on_error_halt)
; ;
glib_on_error_halt = TRUE; glib_on_error_halt = TRUE;
return; return;
} }
@ -146,10 +148,10 @@ g_on_error_query (const gchar *prg_name)
#else #else
if (!prg_name) if (!prg_name)
prg_name = g_get_prgname (); prg_name = g_get_prgname ();
MessageBox (NULL, "g_on_error_query called, program terminating", MessageBox (NULL, "g_on_error_query called, program terminating",
(prg_name && *prg_name) ? prg_name : NULL, (prg_name && *prg_name) ? prg_name : NULL,
MB_OK|MB_ICONERROR); MB_OK|MB_ICONERROR);
_exit(0); _exit(0);
#endif #endif
} }

View File

@ -52,16 +52,16 @@ void g_on_error_stack_trace (const gchar *prg_name);
* Actual use is strongly discouraged of course ;) * Actual use is strongly discouraged of course ;)
*/ */
#if (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__) && __GNUC__ >= 2 #if (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__) && __GNUC__ >= 2
# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("int $03"); }G_STMT_END # define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("int $03"); }G_STMT_END
#elif (defined (_MSC_VER) || defined (__DMC__)) && defined (_M_IX86) #elif (defined (_MSC_VER) || defined (__DMC__)) && defined (_M_IX86)
# define G_BREAKPOINT() G_STMT_START{ __asm int 3h }G_STMT_END # define G_BREAKPOINT() G_STMT_START{ __asm int 3h }G_STMT_END
#elif defined (_MSC_VER) #elif defined (_MSC_VER)
# define G_BREAKPOINT() G_STMT_START{ __debugbreak(); }G_STMT_END # define G_BREAKPOINT() G_STMT_START{ __debugbreak(); }G_STMT_END
#elif defined (__alpha__) && !defined(__osf__) && defined (__GNUC__) && __GNUC__ >= 2 #elif defined (__alpha__) && !defined(__osf__) && defined (__GNUC__) && __GNUC__ >= 2
# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END # define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END
#else /* !__i386__ && !__alpha__ */ #else /* !__i386__ && !__alpha__ */
# define G_BREAKPOINT() G_STMT_START{ raise (SIGTRAP); }G_STMT_END # define G_BREAKPOINT() G_STMT_START{ raise (SIGTRAP); }G_STMT_END
#endif /* __i386__ */ #endif /* __i386__ */
G_END_DECLS G_END_DECLS