mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 15:48:54 +02:00
glib/tests: Clean up inclusion of unistd.h
Include unistd.h only when G_OS_UNIX is defined (or when G_OS_WIN32 is not defined). This will avoid including unistd.h unconditionally and/or unecessarily, which may cause problems in certain scenarios, such as when building the tests on Visual C++, which does not come with a unistd.h and MinGW, where unistd.h is essentially a wrapper for io.h and process.h. https://bugzilla.gnome.org/show_bug.cgi?id=711047
This commit is contained in:
@@ -26,17 +26,14 @@
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_PRCTL_H
|
||||
#include <sys/prctl.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifndef G_OS_WIN32
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user