mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 13:11:13 +00:00
Broadway: Allow Compilation on Windows/MSVC
-Don't include unistd.h unconditionally as it's not available in Visual Studio, but include io.h where necessary. -Avoid C99isms, and use _chsize_s in place of ftruncate when unistd.h is not available (as in the case of Visual Studio)
This commit is contained in:
parent
4b49c44b0a
commit
2268e9d6c9
@ -12,7 +12,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#elif defined (G_OS_WIN32)
|
||||
#include <io.h>
|
||||
#endif
|
||||
#include <crypt.h>
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
@ -979,7 +983,7 @@ static gchar *
|
||||
generate_handshake_response_wsietf_v7 (const gchar *key)
|
||||
{
|
||||
gsize digest_len = 20;
|
||||
guchar digest[digest_len];
|
||||
guchar digest[20];
|
||||
GChecksum *checksum;
|
||||
|
||||
checksum = g_checksum_new (G_CHECKSUM_SHA1);
|
||||
|
@ -18,7 +18,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#elif defined (G_OS_WIN32)
|
||||
#include <io.h>
|
||||
#define ftruncate _chsize_s
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#ifdef G_OS_WIN32
|
||||
#include <windows.h>
|
||||
|
@ -37,7 +37,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
static void gdk_broadway_display_dispose (GObject *object);
|
||||
|
@ -33,7 +33,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user