]> git.pld-linux.org Git - packages/kde4-kdelibs.git/blob - kde4-kdelibs-glibc-2.11.patch
- up to 4.14.2
[packages/kde4-kdelibs.git] / kde4-kdelibs-glibc-2.11.patch
1 --- trunk/KDE/kdelibs/kdecore/fakes.c   2009/10/31 22:24:52     1043164
2 +++ trunk/KDE/kdelibs/kdecore/fakes.c   2009/11/06 19:59:40     1045794
3 @@ -31,7 +31,7 @@
4  
5  
6  #define KDE_open open
7 -#define KDE_mkdir mkdir 
8 +#define KDE_mkdir mkdir
9  
10  
11  #ifndef HAVE_SETENV
12 @@ -39,10 +39,15 @@
13  #ifdef HAVE_ALLOCA_H
14  #include <alloca.h>
15  #endif
16 -
17 +#ifdef HAVE_STRING_H
18  #include <string.h>
19 +#endif
20 +#ifdef HAVE_STDLIB_H
21  #include <stdlib.h>
22 +#endif
23 +#ifdef HAVE_UNISTD_H
24  #include <unistd.h>
25 +#endif
26  
27  KDECORE_EXPORT int setenv(const char *name, const char *value, int overwrite) {
28      int i;
29 @@ -67,11 +72,18 @@
30  #ifdef HAVE_ALLOCA_H
31  #include <alloca.h>
32  #endif
33 -
34 +#ifdef HAVE_STRING_H
35  #include <string.h>
36 +#endif
37 +#ifdef HAVE_STDLIB_H
38  #include <stdlib.h>
39 +#endif
40 +#ifdef HAVE_ERRNO_H
41  #include <errno.h>
42 +#endif
43 +#ifdef HAVE_UNISTD_H
44  #include <unistd.h>
45 +#endif
46  
47  #ifndef environ
48  extern char ** environ;
49 @@ -154,24 +166,32 @@
50  {
51      srand48(seed);
52  }
53 -#endif
54 +#endif /* !HAVE_RANDOM */
55  
56  #ifndef HAVE_SETEUID
57  int seteuid(uid_t euid)
58  {
59      return setreuid(-1, euid); /* Well, if you have neither you are in trouble :) */
60  }
61 -#endif
62 +#endif /* !HAVE_SETEUID */
63  
64  #ifndef HAVE_MKSTEMPS
65 +#ifdef HAVE_SYS_TYPES_H
66  #include <sys/types.h>
67 +#endif
68  #ifdef HAVE_SYS_STAT_H
69  #include <sys/stat.h>
70  #endif
71  #include <fcntl.h>
72 +#ifdef HAVE_STRING_H
73  #include <string.h>
74 +#endif
75 +#ifdef HAVE_STRINGS_H
76  #include <strings.h>
77 +#endif
78 +#ifdef HAVE_STDLIB_H
79  #include <stdlib.h>
80 +#endif
81  
82  /* this is based on code taken from the GNU libc, distributed under the LGPL license */
83  
84 @@ -244,12 +264,14 @@
85  {
86    return mkstemps( _template, 0 );
87  }
88 -#endif
89 +#endif /* !HAVE_MKSTEMP */
90  
91  #ifndef HAVE_MKDTEMP
92  
93  #ifndef HAVE_MKSTEMPS
94 +#ifdef HAVE_SYS_TYPES_H
95  #include <sys/types.h>
96 +#endif
97  #ifdef HAVE_SYS_STAT_H
98  #include <sys/stat.h>
99  #endif
100 @@ -306,13 +328,18 @@
101        value += 7777;
102  
103        if (!KDE_mkdir(_template,0700))
104 -       return _template;       
105 +       return _template;
106      }
107      return 0;
108  }
109  #endif /* !HAVE_MKDTEMP */
110  
111  #ifndef HAVE_STRLCPY
112 +
113 +#ifdef HAVE_STRING_H
114 +#include <string.h>
115 +#endif
116 +
117  KDECORE_EXPORT unsigned long strlcpy(char* d, const char* s, unsigned long bufsize)
118  {
119      unsigned long len, ret = strlen(s);
120 @@ -325,12 +352,17 @@
121          }
122      } else
123         memcpy(d, s, ret + 1);
124 -       
125 +
126      return ret;
127  }
128 -#endif
129 +#endif /* !HAVE_STRLCPY */
130  
131  #ifndef HAVE_STRLCAT
132 +
133 +#ifdef HAVE_STRING_H
134 +#include <string.h>
135 +#endif
136 +
137  KDECORE_EXPORT unsigned long strlcat(char* d, const char* s, unsigned long bufsize)
138  {
139      char *cp;
140 @@ -350,7 +382,7 @@
141  
142      return ret;
143  }
144 -#endif
145 +#endif /* !HAVE_STRLCAT */
146  
147  #ifndef HAVE_STRCASESTR
148  /*
149 @@ -450,7 +482,7 @@
150  ret0:
151    return 0;
152  }
153 -#endif
154 +#endif /* !HAVE_STRCASESTR */
155  
156  #ifndef HAVE_TRUNC
157  
158 @@ -467,4 +499,4 @@
159  {
160         return x < 0 ? -floor(-x) : floor(x);
161  }
162 -#endif
163 +#endif /* !HAVE_TRUNC */
This page took 0.168898 seconds and 3 git commands to generate.