mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 22:16:16 +01:00
GCancellable: Fix build on Win32
https://bugzilla.gnome.org/show_bug.cgi?id=653522
This commit is contained in:
parent
1b0e5e7683
commit
315210ecdb
@ -195,17 +195,20 @@ g_cancellable_class_init (GCancellableClass *klass)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef G_OS_WIN32
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_cancellable_write_cancelled (GCancellable *cancellable)
|
g_cancellable_write_cancelled (GCancellable *cancellable)
|
||||||
{
|
{
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
if (priv->event)
|
||||||
|
SetEvent (priv->event);
|
||||||
|
#else
|
||||||
gssize c;
|
gssize c;
|
||||||
GCancellablePrivate *priv;
|
GCancellablePrivate *priv;
|
||||||
const char ch = 'x';
|
const char ch = 'x';
|
||||||
|
|
||||||
priv = cancellable->priv;
|
priv = cancellable->priv;
|
||||||
|
|
||||||
|
|
||||||
if (priv->cancel_pipe[0] == -1)
|
if (priv->cancel_pipe[0] == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -227,8 +230,11 @@ g_cancellable_write_cancelled (GCancellable *cancellable)
|
|||||||
do
|
do
|
||||||
c = write (priv->cancel_pipe[1], &ch, 1);
|
c = write (priv->cancel_pipe[1], &ch, 1);
|
||||||
while (c == -1 && errno == EINTR);
|
while (c == -1 && errno == EINTR);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef G_OS_WIN32
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_cancellable_open_pipe (GCancellable *cancellable)
|
g_cancellable_open_pipe (GCancellable *cancellable)
|
||||||
{
|
{
|
||||||
@ -654,10 +660,6 @@ g_cancellable_cancel (GCancellable *cancellable)
|
|||||||
|
|
||||||
priv->cancelled = TRUE;
|
priv->cancelled = TRUE;
|
||||||
priv->cancelled_running = TRUE;
|
priv->cancelled_running = TRUE;
|
||||||
#ifdef G_OS_WIN32
|
|
||||||
if (priv->event)
|
|
||||||
SetEvent (priv->event);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
g_cancellable_write_cancelled (cancellable);
|
g_cancellable_write_cancelled (cancellable);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user