2259
|
1 |
--- gnash-0.8.6.orig/plugin/mozilla-sdk/include/prcpucfg-glibc.h 2009-09-13 19:22:18.000000000 -0400
|
|
2 |
+++ gnash-0.8.6/plugin/mozilla-sdk/include/prcpucfg-glibc.h 2009-12-10 00:03:56.385049958 -0500
|
|
3 |
@@ -19,6 +19,7 @@
|
|
4 |
/*
|
|
5 |
* This file is used by not only Linux but also other glibc systems
|
|
6 |
* such as GNU/Hurd and GNU/k*BSD.
|
|
7 |
+ * Gnash now uses it for all other Unix-like platforms as well.
|
|
8 |
*/
|
|
9 |
|
|
10 |
#ifndef nspr_cpucfg___
|
|
11 |
@@ -28,7 +29,17 @@
|
|
12 |
#define LINUX
|
|
13 |
#endif
|
|
14 |
|
|
15 |
-#define PR_AF_INET6 10 /* same as AF_INET6 */
|
|
16 |
+#if defined(__sgi) || defined(sgi) || defined(__sgi__)
|
|
17 |
+
|
|
18 |
+#ifndef IRIX
|
|
19 |
+ #define IRIX
|
|
20 |
+#endif
|
|
21 |
+
|
|
22 |
+#ifndef _SGI_MP_SOURCE
|
|
23 |
+ #define _SGI_MP_SOURCE
|
|
24 |
+#endif
|
|
25 |
+
|
|
26 |
+#endif
|
|
27 |
|
|
28 |
#if defined(__powerpc64__)
|
|
29 |
|
|
30 |
@@ -213,7 +224,7 @@
|
|
31 |
#define PR_BYTES_PER_WORD_LOG2 3
|
|
32 |
#define PR_BYTES_PER_DWORD_LOG2 3
|
|
33 |
|
|
34 |
-#elif defined(__x86_64__)
|
|
35 |
+#elif defined(__x86_64__) || defined(__x86_64) || defined(__amd64__)
|
|
36 |
|
|
37 |
#define IS_LITTLE_ENDIAN 1
|
|
38 |
#undef IS_BIG_ENDIAN
|
|
39 |
@@ -304,55 +315,58 @@
|
|
40 |
#define PR_BYTES_PER_WORD_LOG2 2
|
|
41 |
#define PR_BYTES_PER_DWORD_LOG2 3
|
|
42 |
|
|
43 |
-#elif defined(__sparc__)
|
|
44 |
+#elif defined(__sparc__) || defined(sparc)
|
|
45 |
|
|
46 |
#undef IS_LITTLE_ENDIAN
|
|
47 |
#define IS_BIG_ENDIAN 1
|
|
48 |
|
|
49 |
+#if defined(__sparcv9) || defined(__arch64__)
|
|
50 |
+#define IS_64
|
|
51 |
+#endif
|
|
52 |
+
|
|
53 |
+#ifdef IS_64
|
|
54 |
+
|
|
55 |
#define PR_BYTES_PER_BYTE 1
|
|
56 |
#define PR_BYTES_PER_SHORT 2
|
|
57 |
#define PR_BYTES_PER_INT 4
|
|
58 |
#define PR_BYTES_PER_INT64 8
|
|
59 |
-#define PR_BYTES_PER_LONG 4
|
|
60 |
+#define PR_BYTES_PER_LONG 8
|
|
61 |
#define PR_BYTES_PER_FLOAT 4
|
|
62 |
#define PR_BYTES_PER_DOUBLE 8
|
|
63 |
-#define PR_BYTES_PER_WORD 4
|
|
64 |
+#define PR_BYTES_PER_WORD 8
|
|
65 |
#define PR_BYTES_PER_DWORD 8
|
|
66 |
|
|
67 |
#define PR_BITS_PER_BYTE 8
|
|
68 |
#define PR_BITS_PER_SHORT 16
|
|
69 |
#define PR_BITS_PER_INT 32
|
|
70 |
#define PR_BITS_PER_INT64 64
|
|
71 |
-#define PR_BITS_PER_LONG 32
|
|
72 |
+#define PR_BITS_PER_LONG 64
|
|
73 |
#define PR_BITS_PER_FLOAT 32
|
|
74 |
#define PR_BITS_PER_DOUBLE 64
|
|
75 |
-#define PR_BITS_PER_WORD 32
|
|
76 |
+#define PR_BITS_PER_WORD 64
|
|
77 |
|
|
78 |
#define PR_BITS_PER_BYTE_LOG2 3
|
|
79 |
#define PR_BITS_PER_SHORT_LOG2 4
|
|
80 |
#define PR_BITS_PER_INT_LOG2 5
|
|
81 |
#define PR_BITS_PER_INT64_LOG2 6
|
|
82 |
-#define PR_BITS_PER_LONG_LOG2 5
|
|
83 |
+#define PR_BITS_PER_LONG_LOG2 6
|
|
84 |
#define PR_BITS_PER_FLOAT_LOG2 5
|
|
85 |
#define PR_BITS_PER_DOUBLE_LOG2 6
|
|
86 |
-#define PR_BITS_PER_WORD_LOG2 5
|
|
87 |
+#define PR_BITS_PER_WORD_LOG2 6
|
|
88 |
|
|
89 |
#define PR_ALIGN_OF_SHORT 2
|
|
90 |
#define PR_ALIGN_OF_INT 4
|
|
91 |
-#define PR_ALIGN_OF_LONG 4
|
|
92 |
+#define PR_ALIGN_OF_LONG 8
|
|
93 |
#define PR_ALIGN_OF_INT64 8
|
|
94 |
#define PR_ALIGN_OF_FLOAT 4
|
|
95 |
#define PR_ALIGN_OF_DOUBLE 8
|
|
96 |
-#define PR_ALIGN_OF_POINTER 4
|
|
97 |
-#define PR_ALIGN_OF_WORD 4
|
|
98 |
-
|
|
99 |
-#define PR_BYTES_PER_WORD_LOG2 2
|
|
100 |
-#define PR_BYTES_PER_DWORD_LOG2 3
|
|
101 |
+#define PR_ALIGN_OF_POINTER 8
|
|
102 |
+#define PR_ALIGN_OF_WORD 8
|
|
103 |
|
|
104 |
-#elif defined(__i386__)
|
|
105 |
+#define PR_BYTES_PER_WORD_LOG2 3
|
|
106 |
+#define PR_BYTES_PER_DWORD_LOG2 3
|
|
107 |
|
|
108 |
-#define IS_LITTLE_ENDIAN 1
|
|
109 |
-#undef IS_BIG_ENDIAN
|
|
110 |
+#else /* IS_64 */
|
|
111 |
|
|
112 |
#define PR_BYTES_PER_BYTE 1
|
|
113 |
#define PR_BYTES_PER_SHORT 2
|
|
114 |
@@ -385,30 +399,21 @@
|
|
115 |
#define PR_ALIGN_OF_SHORT 2
|
|
116 |
#define PR_ALIGN_OF_INT 4
|
|
117 |
#define PR_ALIGN_OF_LONG 4
|
|
118 |
-#define PR_ALIGN_OF_INT64 4
|
|
119 |
+#define PR_ALIGN_OF_INT64 8
|
|
120 |
#define PR_ALIGN_OF_FLOAT 4
|
|
121 |
-#define PR_ALIGN_OF_DOUBLE 4
|
|
122 |
+#define PR_ALIGN_OF_DOUBLE 8
|
|
123 |
#define PR_ALIGN_OF_POINTER 4
|
|
124 |
#define PR_ALIGN_OF_WORD 4
|
|
125 |
|
|
126 |
#define PR_BYTES_PER_WORD_LOG2 2
|
|
127 |
#define PR_BYTES_PER_DWORD_LOG2 3
|
|
128 |
|
|
129 |
-#elif defined(__sgi) || defined(sgi) || defined(__sgi__)
|
|
130 |
+#endif /* IS_64 */
|
|
131 |
|
|
132 |
-#ifndef IRIX
|
|
133 |
- #define IRIX
|
|
134 |
-#endif
|
|
135 |
-
|
|
136 |
-#ifndef _SGI_MP_SOURCE
|
|
137 |
- #define _SGI_MP_SOURCE
|
|
138 |
-#endif
|
|
139 |
-
|
|
140 |
-#undef IS_LITTLE_ENDIAN
|
|
141 |
-#define IS_BIG_ENDIAN 1
|
|
142 |
+#elif defined(__i386__) || defined(i386)
|
|
143 |
|
|
144 |
-#undef PR_AF_INET6
|
|
145 |
-#define PR_AF_INET6 24 /* same as AF_INET6 */
|
|
146 |
+#define IS_LITTLE_ENDIAN 1
|
|
147 |
+#undef IS_BIG_ENDIAN
|
|
148 |
|
|
149 |
#define PR_BYTES_PER_BYTE 1
|
|
150 |
#define PR_BYTES_PER_SHORT 2
|
|
151 |
@@ -438,31 +443,24 @@
|
|
152 |
#define PR_BITS_PER_DOUBLE_LOG2 6
|
|
153 |
#define PR_BITS_PER_WORD_LOG2 5
|
|
154 |
|
|
155 |
-#define PR_BYTES_PER_WORD_LOG2 2
|
|
156 |
-#define PR_BYTES_PER_DWORD_LOG2 3
|
|
157 |
-
|
|
158 |
#define PR_ALIGN_OF_SHORT 2
|
|
159 |
#define PR_ALIGN_OF_INT 4
|
|
160 |
#define PR_ALIGN_OF_LONG 4
|
|
161 |
-#define PR_ALIGN_OF_INT64 8
|
|
162 |
+#define PR_ALIGN_OF_INT64 4
|
|
163 |
#define PR_ALIGN_OF_FLOAT 4
|
|
164 |
-#define PR_ALIGN_OF_DOUBLE 8
|
|
165 |
+#define PR_ALIGN_OF_DOUBLE 4
|
|
166 |
#define PR_ALIGN_OF_POINTER 4
|
|
167 |
#define PR_ALIGN_OF_WORD 4
|
|
168 |
|
|
169 |
-#define HAVE_LONG_LONG
|
|
170 |
-#define HAVE_ALIGNED_DOUBLES
|
|
171 |
-#define HAVE_ALIGNED_LONGLONGS
|
|
172 |
-
|
|
173 |
-#define _PR_POLL_BACKCOMPAT
|
|
174 |
-
|
|
175 |
+#define PR_BYTES_PER_WORD_LOG2 2
|
|
176 |
+#define PR_BYTES_PER_DWORD_LOG2 3
|
|
177 |
|
|
178 |
-#elif defined(__mips__)
|
|
179 |
+#elif defined(__mips__) || defined(__mips)
|
|
180 |
|
|
181 |
-#ifdef __MIPSEB__
|
|
182 |
+#if defined(__MIPSEB__) || defined(__MIPSEB)
|
|
183 |
#define IS_BIG_ENDIAN 1
|
|
184 |
#undef IS_LITTLE_ENDIAN
|
|
185 |
-#elif defined(__MIPSEL__)
|
|
186 |
+#elif defined(__MIPSEL__) || defined(__MIPSEL)
|
|
187 |
#define IS_LITTLE_ENDIAN 1
|
|
188 |
#undef IS_BIG_ENDIAN
|
|
189 |
#else
|
|
190 |
@@ -699,9 +697,13 @@
|
|
191 |
#define HAVE_LONG_LONG
|
|
192 |
#if PR_ALIGN_OF_DOUBLE == 8
|
|
193 |
#define HAVE_ALIGNED_DOUBLES
|
|
194 |
+#else
|
|
195 |
+#undef HAVE_ALIGNED_DOUBLES
|
|
196 |
#endif
|
|
197 |
#if PR_ALIGN_OF_INT64 == 8
|
|
198 |
#define HAVE_ALIGNED_LONGLONGS
|
|
199 |
+#else
|
|
200 |
+#undef HAVE_ALIGNED_LONGLONGS
|
|
201 |
#endif
|
|
202 |
|
|
203 |
#ifndef NO_NSPR_10_SUPPORT
|
|
204 |
--- gnash-0.8.6.orig/plugin/plugin.cpp 2009-09-13 19:22:18.000000000 -0400
|
|
205 |
+++ gnash-0.8.6/plugin/plugin.cpp 2009-12-10 21:58:46.637940745 -0500
|
|
206 |
@@ -21,6 +21,7 @@
|
|
207 |
#endif
|
|
208 |
|
|
209 |
#include <cstdlib> // getenv
|
|
210 |
+#include <stdlib.h> // putenv
|
|
211 |
|
|
212 |
#define MIME_TYPES_HANDLED "application/x-shockwave-flash"
|
|
213 |
// The name must be this value to get flash movies that check the
|
|
214 |
@@ -60,6 +61,7 @@
|
|
215 |
#include "plugin.h"
|
|
216 |
#include <csignal>
|
|
217 |
#include "GnashSystemIOHeaders.h"
|
|
218 |
+#include "StringPredicates.h"
|
|
219 |
#include <cstdio>
|
|
220 |
#include <cstddef>
|
|
221 |
#include <cstring>
|
|
222 |
@@ -68,6 +70,7 @@
|
|
223 |
#include <sys/wait.h>
|
|
224 |
#include <fcntl.h>
|
|
225 |
#include <cerrno>
|
|
226 |
+#include <climits>
|
|
227 |
#include <string>
|
|
228 |
#include <vector>
|
|
229 |
#include <iostream>
|
|
230 |
@@ -97,6 +100,10 @@
|
|
231 |
# include <nsStringAPI.h>
|
|
232 |
#endif // HAVE_XPCOM
|
|
233 |
|
|
234 |
+#ifndef PATH_MAX
|
|
235 |
+#define PATH_MAX 1024
|
|
236 |
+#endif
|
|
237 |
+
|
|
238 |
extern NPNetscapeFuncs NPNFuncs;
|
|
239 |
|
|
240 |
NPBool plugInitialized = FALSE;
|
|
241 |
@@ -272,43 +279,43 @@
|
|
242 |
}
|
|
243 |
|
|
244 |
// Append SYSCONFDIR/gnashpluginrc and ~/.gnashpluginrc to GNASHRC
|
|
245 |
- do {
|
|
246 |
- // TODO: extract content in a set, add to set
|
|
247 |
- // and serialize back (to avoid duplicates)
|
|
248 |
|
|
249 |
- std::string newGnashRc;
|
|
250 |
- char *gnashrc = std::getenv("GNASHRC");
|
|
251 |
- if ( gnashrc )
|
|
252 |
- {
|
|
253 |
- newGnashRc.assign(gnashrc);
|
|
254 |
- newGnashRc.append(":");
|
|
255 |
- }
|
|
256 |
+ std::string newGnashRc("GNASHRC=");
|
|
257 |
|
|
258 |
- newGnashRc.append(SYSCONFDIR);
|
|
259 |
- newGnashRc.append("/gnashpluginrc");
|
|
260 |
+ newGnashRc.append(SYSCONFDIR);
|
|
261 |
+ newGnashRc.append("/gnashpluginrc");
|
|
262 |
|
|
263 |
- char *home = std::getenv("HOME");
|
|
264 |
- if ( home )
|
|
265 |
- {
|
|
266 |
- newGnashRc.append(":");
|
|
267 |
- newGnashRc.append(home);
|
|
268 |
- newGnashRc.append("/.gnashpluginrc");
|
|
269 |
- }
|
|
270 |
- else
|
|
271 |
- {
|
|
272 |
- std::cout << "WARNING: NPAPI plugin could not find user home dir" << std::endl;
|
|
273 |
- }
|
|
274 |
+ char *home = std::getenv("HOME");
|
|
275 |
+ if ( home )
|
|
276 |
+ {
|
|
277 |
+ newGnashRc.append(":");
|
|
278 |
+ newGnashRc.append(home);
|
|
279 |
+ newGnashRc.append("/.gnashpluginrc");
|
|
280 |
+ }
|
|
281 |
+ else
|
|
282 |
+ {
|
|
283 |
+ std::cout << "WARNING: NPAPI plugin could not find user home dir" << std::endl;
|
|
284 |
+ }
|
|
285 |
|
|
286 |
- if ( setenv("GNASHRC", newGnashRc.c_str(), 1) )
|
|
287 |
- {
|
|
288 |
- std::cout << "WARNING: NPAPI plugin could not append to the GNASHRC env variable" << std::endl;
|
|
289 |
- }
|
|
290 |
-#if GNASH_PLUGIN_DEBUG > 1
|
|
291 |
- else std::cout << "NOTE: NPAPI plugin set GNASHRC to " << newGnashRc << std::endl;
|
|
292 |
-#endif
|
|
293 |
+ char *gnashrc = std::getenv("GNASHRC");
|
|
294 |
+ if ( gnashrc )
|
|
295 |
+ {
|
|
296 |
+ newGnashRc.append(":");
|
|
297 |
+ newGnashRc.append(gnashrc);
|
|
298 |
+ }
|
|
299 |
|
|
300 |
- } while (0);
|
|
301 |
+ // putenv doesn't copy the string in standards-conforming implementations
|
|
302 |
+ gnashrc = new char[PATH_MAX];
|
|
303 |
+ std::strncpy(gnashrc, newGnashRc.c_str(), PATH_MAX);
|
|
304 |
+ gnashrc[PATH_MAX-1] = '\0';
|
|
305 |
|
|
306 |
+ if ( putenv(gnashrc) )
|
|
307 |
+ {
|
|
308 |
+ std::cout << "WARNING: NPAPI plugin could not append to the GNASHRC env variable" << std::endl;
|
|
309 |
+ }
|
|
310 |
+#if GNASH_PLUGIN_DEBUG > 1
|
|
311 |
+ else std::cout << "NOTE: NPAPI plugin set GNASHRC to " << newGnashRc << std::endl;
|
|
312 |
+#endif
|
|
313 |
|
|
314 |
/* Success */
|
|
315 |
|
|
316 |
@@ -429,6 +436,7 @@
|
|
317 |
for (size_t i=0, n=data->argc; i<n; ++i)
|
|
318 |
{
|
|
319 |
std::string name, val;
|
|
320 |
+ gnash::StringNoCaseEqual noCaseCompare;
|
|
321 |
|
|
322 |
if (data->argn[i])
|
|
323 |
{
|
|
324 |
@@ -440,7 +448,7 @@
|
|
325 |
val = data->argv[i];
|
|
326 |
}
|
|
327 |
|
|
328 |
- if ( ! strcasecmp(name.c_str(), "name") )
|
|
329 |
+ if (noCaseCompare(name, "name"))
|
|
330 |
{
|
|
331 |
_name = val;
|
|
332 |
}
|
|
333 |
@@ -808,7 +816,7 @@
|
|
334 |
return false;
|
|
335 |
}
|
|
336 |
|
|
337 |
- if ( ! strncmp(buf, "GET ", 4) )
|
|
338 |
+ if ( ! std::strncmp(buf, "GET ", 4) )
|
|
339 |
{
|
|
340 |
char* target = buf + 4;
|
|
341 |
if ( ! *target )
|
|
342 |
@@ -842,7 +850,7 @@
|
|
343 |
return true;
|
|
344 |
|
|
345 |
}
|
|
346 |
- else if ( ! strncmp(buf, "INVOKE ", 7) )
|
|
347 |
+ else if ( ! std::strncmp(buf, "INVOKE ", 7) )
|
|
348 |
{
|
|
349 |
char* command = buf + 7;
|
|
350 |
if ( ! *command ) {
|