--- glib-2.32.0.orig/configure.ac	2012-04-27 19:34:01 +0400
+++ glib-2.32.0/configure.ac	2012-04-27 19:40:20 +0400
@@ -3062,6 +3062,17 @@
 #define GLIB_SYSDEF_MSG_PEEK $g_msg_peek
 #define GLIB_SYSDEF_MSG_DONTROUTE $g_msg_dontroute
 
+/* MSVCRT's version of abort() terminates the application without throwing
+ * an exception (so, for example, gdb won't break over it).
+ * Use DebugBreak() instead, which will break to debugger or (when no
+ * debugger is present) throw an exception.
+ */
+#ifdef G_OS_WIN32
+#define g_abort() DebugBreak ()
+#else
+#define g_abort() abort ()
+#endif
+
 G_END_DECLS
 
 #endif /* __GLIBCONFIG_H__ */
diff -ur glib-2.31.2.orig/glib/gbacktrace.c glib-2.31.2/glib/gbacktrace.c
--- glib-2.31.2.orig/glib/gbacktrace.c	2011-11-13 23:45:14 +0400
+++ glib-2.31.2/glib/gbacktrace.c	2011-12-02 13:16:29 +0400
@@ -258,7 +258,7 @@
   if (IsDebuggerPresent ())
     G_BREAKPOINT ();
   else
-    abort ();
+    g_abort ();
 #endif
 }
 
diff -ur glib-2.31.2.orig/glib/giowin32.c glib-2.31.2/glib/giowin32.c
--- glib-2.31.2.orig/glib/giowin32.c	2011-11-13 23:45:14 +0400
+++ glib-2.31.2/glib/giowin32.c	2011-12-02 13:16:42 +0400
@@ -800,7 +800,7 @@
 
     default:
       g_assert_not_reached ();
-      abort ();
+      g_abort ();
     }
   if (channel->debug)
     g_print ("\n");
@@ -947,7 +947,7 @@
 
     default:
       g_assert_not_reached ();
-      abort ();
+      g_abort ();
     }
 }
 
@@ -1012,7 +1012,7 @@
 
     default:
       g_assert_not_reached ();
-      abort ();
+      g_abort ();
     }
   if (channel->debug)
     g_print ("\n");
@@ -1297,7 +1297,7 @@
     default:
       whence = -1; /* Keep the compiler quiet */
       g_assert_not_reached ();
-      abort ();
+      g_abort ();
     }
 
   tmp_offset = offset;
@@ -1691,7 +1691,7 @@
         break;
       default:
         g_assert_not_reached ();
-	abort ();
+	g_abort ();
     }
 
   /* always open 'untranslated' */
@@ -1737,7 +1737,7 @@
         break;
       default:
         g_assert_not_reached ();
-	abort ();
+	g_abort ();
     }
 
   return channel;
@@ -2223,7 +2223,7 @@
 
     default:
       g_assert_not_reached ();
-      abort ();
+      g_abort ();
     }
   
   fd->events = condition;
diff -ur glib-2.31.2.orig/glib/gmessages.c glib-2.31.2/glib/gmessages.c
--- glib-2.31.2.orig/glib/gmessages.c	2011-11-18 13:51:54 +0400
+++ glib-2.31.2/glib/gmessages.c	2011-12-02 13:16:55 +0400
@@ -752,12 +752,12 @@
 	      if (IsDebuggerPresent () && !(test_level & G_LOG_FLAG_RECURSION))
 		G_BREAKPOINT ();
 	      else
-		abort ();
+		g_abort ();
 #else
 	      if (!(test_level & G_LOG_FLAG_RECURSION))
 		G_BREAKPOINT ();
 	      else
-		abort ();
+		g_abort ();
 #endif /* !G_OS_WIN32 */
 	    }
 	  
@@ -842,7 +842,7 @@
 	 line, 
 	 pretty_function,
 	 expression);
-  abort ();
+  g_abort ();
 }
 
 #define CHAR_IS_SAFE(wc) (!((wc < 0x20 && wc != '\t' && wc != '\n' && wc != '\r') || \
--- glib-2.32.0/glib/gthread-posix.c.orig	2012-03-30 04:51:16 +0400
+++ glib-2.32.0/glib/gthread-posix.c	2012-03-12 04:42:42 +0400
@@ -73,7 +73,7 @@
 {
   fprintf (stderr, "GLib (gthread-posix.c): Unexpected error from C library during '%s': %s.  Aborting.\n",
            function, strerror (status));
-  abort ();
+  g_abort ();
 }
 
 /* {{{1 GMutex */
diff -ur glib-2.31.2.orig/glib/gthread-win32.c glib-2.31.2/glib/gthread-win32.c
--- glib-2.31.2.orig/glib/gthread-win32.c	2011-11-18 13:51:54 +0400
+++ glib-2.31.2/glib/gthread-win32.c	2011-12-02 13:17:32 +0400
@@ -59,7 +59,7 @@
 {
   fprintf (stderr, "GLib (gthread-win32.c): Unexpected error from C library during '%s': %s.  Aborting.\n",
            strerror (status), function);
-  abort ();
+  g_abort ();
 }
 
 /* Starting with Vista and Windows 2008, we have access to the
--- glib-2.32.0/glib/tests/gvariant.c.orig	2012-03-18 07:43:35 +0400
+++ glib-2.32.0/glib/tests/gvariant.c	2012-03-30 04:53:46 +0400
@@ -17,6 +17,9 @@
 #include <string.h>
 #include <stdlib.h>
 #include <glib.h>
+#ifdef G_OS_WIN32
+#include <windows.h>
+#endif
 
 #define BASIC "bynqiuxthdsog?"
 #define N_BASIC (G_N_ELEMENTS (BASIC) - 1)
@@ -3879,19 +3882,19 @@
       if (do_failed_test ("*GVariant format string*"))
         {
           g_variant_new_parsed ("%z");
-          abort ();
+          g_abort ();
         }
 
       if (do_failed_test ("*can not parse as*"))
         {
           g_variant_new_parsed ("uint32 %i", 2);
-          abort ();
+          g_abort ();
         }
 
       if (do_failed_test ("*expected GVariant of type `i'*"))
         {
           g_variant_new_parsed ("%@i", g_variant_new_uint32 (2));
-          abort ();
+          g_abort ();
         }
     }
 }
--- glib-2.32.0/gio/tests/gsettings.c.orig	2012-03-30 22:56:48 +0400
+++ glib-2.32.0/gio/tests/gsettings.c	2012-03-30 23:28:12 +0400
@@ -5,6 +5,9 @@
 #include <gstdio.h>
 #define G_SETTINGS_ENABLE_BACKEND
 #include <gio/gsettingsbackend.h>
+#ifdef G_OS_WIN32
+#include <windows.h>
+#endif
 
 #include "testenum.h"
 
--- glib-2.33.12/glib/gslice.c.orig	2012-03-12 04:42:42 +0400
+++ glib-2.33.12/glib/gslice.c	2012-09-07 10:32:50 +0400
@@ -1081,7 +1081,7 @@
     return;
   if (G_UNLIKELY (allocator->config.debug_blocks) &&
       !smc_notify_free (mem_block, mem_size))
-    abort();
+    g_abort ();
   if (G_LIKELY (acat == 1))             /* allocate through magazine layer */
     {
       ThreadMemory *tmem = thread_memory_from_self();
@@ -1165,7 +1165,7 @@
           slice = *(gpointer*) (current + next_offset);
           if (G_UNLIKELY (allocator->config.debug_blocks) &&
               !smc_notify_free (current, mem_size))
-            abort();
+            g_abort ();
           if (G_UNLIKELY (thread_memory_magazine2_is_full (tmem, ix)))
             {
               thread_memory_swap_magazines (tmem, ix);
@@ -1186,7 +1186,7 @@
           slice = *(gpointer*) (current + next_offset);
           if (G_UNLIKELY (allocator->config.debug_blocks) &&
               !smc_notify_free (current, mem_size))
-            abort();
+            g_abort ();
           if (G_UNLIKELY (g_mem_gc_friendly))
             memset (current, 0, chunk_size);
           slab_allocator_free_chunk (chunk_size, current);
@@ -1200,7 +1200,7 @@
         slice = *(gpointer*) (current + next_offset);
         if (G_UNLIKELY (allocator->config.debug_blocks) &&
             !smc_notify_free (current, mem_size))
-          abort();
+          g_abort ();
         if (G_UNLIKELY (g_mem_gc_friendly))
           memset (current, 0, mem_size);
         g_free (current);
@@ -1439,7 +1439,7 @@
   vfprintf (stderr, format, args);
   va_end (args);
   fputs ("\n", stderr);
-  abort();
+  g_abort ();
   _exit (1);
 }
 
--- glib-2.33.12/glib/gtester.c.orig	2012-08-17 05:17:48 +0400
+++ glib-2.33.12/glib/gtester.c	2012-09-07 10:33:42 +0400
@@ -93,7 +93,7 @@
 terminate (void)
 {
   kill (getpid(), SIGTERM);
-  abort();
+  g_abort ();
 }
 
 static void
--- glib-2.35.3/glib/gnulib/vasnprintf.c.orig	2013-01-07 01:58:04 +0400
+++ glib-2.35.3/glib/gnulib/vasnprintf.c	2013-01-07 02:05:09 +0400
@@ -66,6 +66,10 @@
 # endif
 #endif
 
+#ifdef G_OS_WIN32
+#  include <windows.h> /* DebugBreak() AKA g_abort () */
+#endif
+
 /* For those losing systems which don't have 'alloca' we have to add
    some additional code emulating it.  */ 
 #ifdef HAVE_ALLOCA 
@@ -339,7 +343,7 @@
 	if (dp->conversion == '%')
 	  {
 	    if (!(dp->arg_index < 0))
-	      abort ();
+	      g_abort ();
 	    ENSURE_ALLOCATION (length + 1);
 	    result[length] = '%';
 	    length += 1;
@@ -347,7 +351,7 @@
 	else
 	  {
 	    if (!(dp->arg_index >= 0))
-	      abort ();
+	      g_abort ();
 
 	    if (dp->conversion == 'n')
 	      {
@@ -371,7 +375,7 @@
 		    break;
 #endif
 		  default:
-		    abort ();
+		    g_abort ();
 		  }
 	      }
 	    else
@@ -399,7 +403,7 @@
 			  int arg;
 
 			  if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
-			    abort ();
+			    g_abort ();
 			  arg = a.arg[dp->width_arg_index].a.a_int;
 			  width = (arg < 0 ? -arg : arg);
 			}
@@ -421,7 +425,7 @@
 			  int arg;
 
 			  if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
-			    abort ();
+			    g_abort ();
 			  arg = a.arg[dp->precision_arg_index].a.a_int;
 			  precision = (arg < 0 ? 0 : arg);
 			}
@@ -595,7 +599,7 @@
 		      break;
 
 		    default:
-		      abort ();
+		      g_abort ();
 		    }
 
 		  if (tmp_length < width)
@@ -708,13 +712,13 @@
 		if (dp->width_arg_index >= 0)
 		  {
 		    if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
-		      abort ();
+		      g_abort ();
 		    prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
 		  }
 		if (dp->precision_arg_index >= 0)
 		  {
 		    if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
-		      abort ();
+		      g_abort ();
 		    prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
 		  }
 
@@ -756,7 +760,7 @@
 					     &count);			    \
 			break;						    \
 		      default:						    \
-			abort ();					    \
+			g_abort ();					    \
 		      }
 #else
 #define SNPRINTF_BUF(arg) \
@@ -773,7 +777,7 @@
 					 arg);				    \
 			break;						    \
 		      default:						    \
-			abort ();					    \
+			g_abort ();					    \
 		      }
 #endif
 
@@ -858,7 +862,7 @@
 				  int arg;
 				  
 				  if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
-				    abort ();
+				    g_abort ();
 				  arg = a.arg[dp->width_arg_index].a.a_int;
 				  width = (arg < 0 ? -arg : arg);
 				}
@@ -880,7 +884,7 @@
 				  int arg;
 				  
 				  if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
-				    abort ();
+				    g_abort ();
 				  arg = a.arg[dp->precision_arg_index].a.a_int;
 				  precision = (arg < 0 ? 0 : arg);
 				}
@@ -978,7 +982,7 @@
 			}
 			break;
 		      default:
-			abort ();
+			g_abort ();
 		      }
 
 #if HAVE_SNPRINTF
@@ -991,7 +995,7 @@
 			/* Verify that snprintf() has NUL-terminated its
 			   result.  */
 			if (count < maxlen && result[length + count] != '\0')
-			  abort ();
+			  g_abort ();
 			/* Portability hack.  */
 			if (retcount > count)
 			  count = retcount;
@@ -1026,7 +1030,7 @@
 		    if (count >= tmp_length)
 		      /* tmp_length was incorrectly calculated - fix the
 			 code above!  */
-		      abort ();
+		      g_abort ();
 #endif
 
 		    /* Make room for the result.  */
--- glib-2.35.3/glib/gtestutils.c.orig	2013-01-07 02:06:36 +0400
+++ glib-2.35.3/glib/gtestutils.c	2013-01-07 02:10:05 +0400
@@ -38,6 +38,7 @@
 #endif
 #ifdef G_OS_WIN32
 #include <io.h>
+#include <windows.h>
 #endif
 #include <errno.h>
 #include <signal.h>
@@ -622,7 +623,7 @@
       else if (!g_test_quiet())
         g_print ("%s\n", fail ? "FAIL" : "OK");
       if (fail && test_mode_fatal)
-        abort();
+        g_abort ();
       break;
     case G_TEST_LOG_MIN_RESULT:
       if (g_test_verbose())
@@ -1889,7 +1890,7 @@
 
   g_test_log (G_TEST_LOG_ERROR, s, NULL, 0, NULL);
   g_free (s);
-  abort();
+  g_abort ();
 }
 
 void
