tests/testdnd2.c: Don't include unistd.h unconditionally
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 30 Jan 2020 14:34:53 +0000 (22:34 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 3 Feb 2020 09:18:36 +0000 (17:18 +0800)
Instead, on Windows when it is not available, include io.h for close()

tests/testdnd2.c

index 11d604fee54e0ebd2cfe5cceadb7770488969507..a9a2f6382f92582c7ef7f87e45975bb14a6d9fa3 100644 (file)
@@ -1,6 +1,11 @@
-#include <unistd.h>
 #include <gtk/gtk.h>
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#elif defined (G_OS_WIN32)
+#include <io.h>
+#endif
+
 static GdkTexture *
 get_image_texture (GtkImage *image,
                    int      *out_size)