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

@ -35,8 +35,6 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "glib.h"
#include "gprintfint.h"
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
@ -61,12 +59,16 @@
#include <string.h> /* for bzero on BSD systems */
#ifdef G_OS_WIN32
# define STRICT /* Strict typing, please */
# define STRICT /* Strict typing, please */
# define _WIN32_WINDOWS 0x0401 /* to get IsDebuggerPresent */
# include <windows.h>
# undef STRICT
#endif
#include "gtypes.h"
#include "gprintfint.h"
#ifndef NO_FD_SET
# define SELECT_MASK fd_set
#else
@ -101,18 +103,18 @@ g_on_error_query (const gchar *prg_name)
if (prg_name)
_g_fprintf (stdout,
"%s (pid:%u): %s%s%s: ",
prg_name,
(guint) getpid (),
query1,
query2,
query3);
"%s (pid:%u): %s%s%s: ",
prg_name,
(guint) getpid (),
query1,
query2,
query3);
else
_g_fprintf (stdout,
"(process:%u): %s%s: ",
(guint) getpid (),
query1,
query3);
"(process:%u): %s%s: ",
(guint) getpid (),
query1,
query3);
fflush (stdout);
if (isatty(0) && isatty(1))
@ -124,20 +126,20 @@ g_on_error_query (const gchar *prg_name)
&& buf[1] == '\n')
_exit (0);
else if ((buf[0] == 'P' || buf[0] == 'p')
&& buf[1] == '\n')
&& buf[1] == '\n')
return;
else if (prg_name
&& (buf[0] == 'S' || buf[0] == 's')
&& buf[1] == '\n')
&& (buf[0] == 'S' || buf[0] == 's')
&& buf[1] == '\n')
{
g_on_error_stack_trace (prg_name);
goto retry;
}
else if ((buf[0] == 'H' || buf[0] == 'h')
&& buf[1] == '\n')
&& buf[1] == '\n')
{
while (glib_on_error_halt)
;
;
glib_on_error_halt = TRUE;
return;
}
@ -148,8 +150,8 @@ g_on_error_query (const gchar *prg_name)
prg_name = g_get_prgname ();
MessageBox (NULL, "g_on_error_query called, program terminating",
(prg_name && *prg_name) ? prg_name : NULL,
MB_OK|MB_ICONERROR);
(prg_name && *prg_name) ? prg_name : NULL,
MB_OK|MB_ICONERROR);
_exit(0);
#endif
}

View File

@ -52,16 +52,16 @@ void g_on_error_stack_trace (const gchar *prg_name);
* Actual use is strongly discouraged of course ;)
*/
#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)
# 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)
# 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
# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END
#else /* !__i386__ && !__alpha__ */
# define G_BREAKPOINT() G_STMT_START{ raise (SIGTRAP); }G_STMT_END
#endif /* __i386__ */
# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END
#else /* !__i386__ && !__alpha__ */
# define G_BREAKPOINT() G_STMT_START{ raise (SIGTRAP); }G_STMT_END
#endif /* __i386__ */
G_END_DECLS