#include "iostream.h"
+#include "test-io-stream-common.h"
+
static void
test_invalid_stream (NiceAddress *addr)
{
main_loop = g_main_loop_new (main_context, FALSE);
/* Set up the pollable source. */
- g_source_set_callback (pollable_source, (GSourceFunc) source_cancelled_cb,
+ g_source_set_callback (pollable_source, G_SOURCE_FUNC (source_cancelled_cb),
main_loop, NULL);
g_source_attach (pollable_source, main_context);
stop_main_loop (GMainLoop *loop)
{
GSource *src = g_idle_source_new ();
- g_source_set_callback (src, (GSourceFunc) g_main_loop_quit,
+ g_source_set_callback (src, G_SOURCE_FUNC (g_main_loop_quit),
g_main_loop_ref (loop), (GDestroyNotify) g_main_loop_unref);
g_source_attach (src, g_main_loop_get_context (loop));
g_source_unref (src);
#include <unistd.h>
#endif
+#if !GLIB_CHECK_VERSION(2, 58, 0)
+#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void)) (f))
+#endif
+
/* Make the message sufficiently large to not hit Nagle’s algorithm in the
* pseudo-TCP implementation, and hence run really slowly. */
#define MESSAGE_SIZE 1284 /* bytes */
g_pollable_input_stream_create_source (
G_POLLABLE_INPUT_STREAM (input_stream), NULL);
- g_source_set_callback (stream_source, (GSourceFunc) read_stream_cb,
+ g_source_set_callback (stream_source, G_SOURCE_FUNC (read_stream_cb),
data, NULL);
g_source_attach (stream_source, main_context);
g_source_unref (stream_source);
g_pollable_input_stream_create_source (
G_POLLABLE_INPUT_STREAM (input_stream), NULL);
- g_source_set_callback (stream_source, (GSourceFunc) read_stream_cb,
+ g_source_set_callback (stream_source, G_SOURCE_FUNC (read_stream_cb),
&gsource_data, NULL);
g_source_attach (stream_source, main_context);
g_pollable_output_stream_create_source (
G_POLLABLE_OUTPUT_STREAM (output_stream), NULL);
- g_source_set_callback (stream_source, (GSourceFunc) write_stream_cb,
+ g_source_set_callback (stream_source, G_SOURCE_FUNC (write_stream_cb),
&gsource_data, NULL);
g_source_attach (stream_source, main_context);