Merge branch 'wip/pwithnall/scanner-test-fixes-macos' into 'main'

tests: Add missing unistd.h include to scannerapi.c

See merge request GNOME/glib!4579
This commit is contained in:
Michael Catanzaro
2025-04-04 14:11:40 +00:00
2 changed files with 4 additions and 1 deletions

View File

@@ -138,9 +138,10 @@ thread_func (gpointer user_data)
GRand *rand;
rand = g_rand_new ();
g_assert (data->n_locks <= G_MAXINT32);
for (unsigned int i = 0; i < data->n_iterations; i++)
acquire (data, g_rand_int_range (rand, 0, data->n_locks));
acquire (data, g_rand_int_range (rand, 0, (gint32) data->n_locks));
g_rand_free (rand);

View File

@@ -26,6 +26,8 @@
#ifdef G_OS_WIN32
#include <io.h>
#else
#include <unistd.h>
#endif
/* GScanner fixture */