mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-30 05:43:28 +02:00
gio/tests: Clean up inclusion of unistd.h
Include unistd.h only on *NIX and define items as necessary on Windows, also replace instances of ssize_t with the GLib-equivilant gssize so to fix the build on platforms that do not have ssize_t, such as Visual C++. https://bugzilla.gnome.org/show_bug.cgi?id=711047
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#ifdef G_OS_UNIX
|
||||
#include <unistd.h>
|
||||
#include <gio/gunixinputstream.h>
|
||||
#include <gio/gunixoutputstream.h>
|
||||
#endif
|
||||
@@ -20,7 +20,7 @@ write_all (int fd,
|
||||
{
|
||||
while (len > 0)
|
||||
{
|
||||
ssize_t bytes_written = write (fd, buf, len);
|
||||
gssize bytes_written = write (fd, buf, len);
|
||||
if (bytes_written < 0)
|
||||
g_error ("Failed to write to fd %d: %s",
|
||||
fd, strerror (errno));
|
||||
|
Reference in New Issue
Block a user