aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/snap-glib.patch
blob: 669f797e05bac816ef144b8b7da41db74e640fa1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- a/glib-core/base.h
+++ b/glib-core/base.h
@@ -66,7 +66,11 @@
   #include <dirent.h>
   #include <unistd.h>
   #include <signal.h>
-  #include <sys/poll.h>

+  #if defined(SNAP_HAVE_POLL_H)

+	  #include <poll.h>

+  #elif defined(SNAP_HAVE_SYS_POLL_H)

+    #include <sys/poll.h>

+  #endif

   #include <sys/socket.h>
   #include <sys/stat.h>
   #include <sys/time.h>
@@ -89,7 +93,7 @@
   #define GLib_32Bit
 #elif __WORDSIZE == 64 || defined(GLib_WIN64) || defined(__CYGWIN64__)
   #define GLib_64Bit
-#else

+#elif !defined(GLib_32Bit) && !defined(GLib_64Bit)

   #error "Undefined word size"
 #endif
 
@@ -98,10 +102,8 @@
     #if defined(GLib_MACOSX)
      #include <crt_externs.h>
      #define _environ (*_NSGetEnviron())
-    #elif !defined(GLib_CYGWIN)

-     #define _environ __environ

-     extern int _daylight;

     #else
+     extern char **environ;

      #define _environ environ
     #endif
   #endif
--- a/glib-core/fl.cpp
+++ a/glib-core/fl.cpp
@@ -1210,7 +1210,7 @@
 
 	filesize = lseek(input, 0, SEEK_END);
 	lseek(output, filesize - 1, SEEK_SET);
-	write(output, '\0', 1);

+	write(output, "\0", 1);

 
 	if((source = mmap(0, filesize, PROT_READ, MAP_SHARED, input, 0)) == (void *) -1) {
 		close(input);