1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= Platform-neutral API for system-like functions
8 HOMEPAGE= http://www.mozilla.org/projects/nspr/index.html
12 SITES[main]= MOZILLA/nspr/releases/v4.14/src
13 DISTFILE[1]= nspr-4.14.tar.gz:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
22 DISTNAME= nspr-4.14/nspr
24 CPE_PRODUCT= netscape_portable_runtime
30 # Do not install tools to build itself
31 @${REINPLACE_CMD} -e '/RELEASE_BINS/d' \
32 ${WRKSRC}/pr/src/misc/Makefile.in
35 @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.so
37 [FILE:207:descriptions/desc.single]
38 Netscape Portable Runtime (NSPR) provides a platform-neutral API for
39 system level and libc like functions. The API is used in the Mozilla
40 client, many of Netscape/AOL/iPlanet's and other software offerings.
44 64fc18826257403a9132240aa3c45193d577a84b08e96f7e7770a97c074d17d5 1136626 nspr-4.14.tar.gz
47 [FILE:1225:manifests/plist.single]
79 include/nspr/obsolete/
108 include/nspr/private/
137 @(,,444) lib/libnspr4.a
138 @(,,444) lib/libnspr4.so
139 @(,,444) lib/libplc4.a
140 @(,,444) lib/libplc4.so
141 @(,,444) lib/libplds4.a
142 @(,,444) lib/libplds4.so
143 lib/pkgconfig/nspr.pc
144 share/aclocal/nspr.m4
147 [FILE:2077:patches/patch-bug1350414]
150 @@ -6730,6 +6730,8 @@ tools are selected during the Xcode/Developer Tools installation." "$LINENO" 5
152 $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
154 + $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
156 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
157 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
158 if test "$MOZ_OBJFORMAT" = "elf"; then
159 @@ -7340,6 +7342,8 @@ $as_echo "$as_me: WARNING: Unknown version of the Microsoft (R) Manifest Tool."
161 $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
163 + $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
165 if test -z "$USE_NSPR_THREADS"; then
168 @@ -7396,6 +7400,8 @@ $as_echo "$as_me: WARNING: Unknown version of the Microsoft (R) Manifest Tool."
170 $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
172 + $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
174 CFLAGS="$CFLAGS -ansi -Wall"
175 CXXFLAGS="$CXXFLAGS -ansi -Wall"
179 @@ -1554,6 +1554,7 @@ tools are selected during the Xcode/Developer Tools installation.])
181 AC_DEFINE(HAVE_BSD_FLOCK)
182 AC_DEFINE(HAVE_SOCKLEN_T)
183 + AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
184 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
185 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
186 if test "$MOZ_OBJFORMAT" = "elf"; then
187 @@ -2114,6 +2115,7 @@ tools are selected during the Xcode/Developer Tools installation.])
189 AC_DEFINE(HAVE_BSD_FLOCK)
190 AC_DEFINE(HAVE_SOCKLEN_T)
191 + AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
192 if test -z "$USE_NSPR_THREADS"; then
195 @@ -2162,6 +2164,7 @@ tools are selected during the Xcode/Developer Tools installation.])
197 AC_DEFINE(HAVE_BSD_FLOCK)
198 AC_DEFINE(HAVE_SOCKLEN_T)
199 + AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
200 CFLAGS="$CFLAGS -ansi -Wall"
201 CXXFLAGS="$CXXFLAGS -ansi -Wall"
205 [FILE:604:patches/patch-bug1350966]
206 --- pr/src/pthreads/ptsynch.c~
207 +++ pr/src/pthreads/ptsynch.c
208 @@ -55,12 +55,11 @@ void _PR_InitLocks(void)
209 rv = _PT_PTHREAD_MUTEXATTR_INIT(&_pt_mattr);
213 -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
214 +#if (defined(LINUX) && (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) || \
215 + (defined(FREEBSD) && __FreeBSD_version > 700055)
216 rv = pthread_mutexattr_settype(&_pt_mattr, PTHREAD_MUTEX_ADAPTIVE_NP);
221 rv = _PT_PTHREAD_CONDATTR_INIT(&_pt_cvar_attr);
225 [FILE:1298:patches/patch-bug301986]
226 pthread_t can well be a 64-bit value -- on FreeBSD/amd64, for example.
227 Better to just keep calling it pthread_t isntead of casting to anything.
231 --- pr/include/private/pprthred.h.orig 2015-10-16 13:22:19 UTC
232 +++ pr/include/private/pprthred.h
237 +#include <pthread.h>
241 @@ -59,7 +60,7 @@ NSPR_API(void) PR_DetachThread(void);
242 ** Get the id of the named thread. Each thread is assigned a unique id
243 ** when it is created or attached.
245 -NSPR_API(PRUint32) PR_GetThreadID(PRThread *thread);
246 +NSPR_API(pthread_t) PR_GetThreadID(PRThread *thread);
249 ** Set the procedure that is called when a thread is dumped. The procedure
250 --- pr/src/pthreads/ptthread.c.orig 2015-10-16 13:22:19 UTC
251 +++ pr/src/pthreads/ptthread.c
252 @@ -1155,12 +1155,12 @@ PR_IMPLEMENT(void) PR_ProcessExit(PRIntn
256 -PR_IMPLEMENT(PRUint32) PR_GetThreadID(PRThread *thred)
257 +PR_IMPLEMENT(pthread_t) PR_GetThreadID(PRThread *thred)
259 #if defined(_PR_DCETHREADS)
260 return (PRUint32)&thred->id; /* this is really a sham! */
262 - return (PRUint32)thred->id; /* and I don't know what they will do with it */
263 + return thred->id; /* and I don't know what they will do with it */
269 [FILE:916:patches/patch-bug782109]
270 --- pr/include/md/_freebsd.h.orig 2015-10-16 13:22:19 UTC
271 +++ pr/include/md/_freebsd.h
273 #define _PR_HAVE_LARGE_OFF_T
275 #if defined(_PR_PTHREADS)
276 +#if __FreeBSD_version >= 602000
277 +#define _PR_HAVE_GETPROTO_R
278 +#define _PR_HAVE_5_ARG_GETPROTO_R
280 +#if __FreeBSD_version >= 700016
281 +#define _PR_HAVE_GETHOST_R
282 +#define _PR_HAVE_GETHOST_R_INT
284 #if __FreeBSD_version >= 400008
286 * libc_r before this version of FreeBSD doesn't have poll().
287 --- pr/src/misc/prnetdb.c.orig 2015-10-16 13:22:19 UTC
288 +++ pr/src/misc/prnetdb.c
289 @@ -78,11 +78,6 @@ PRLock *_pr_dnsLock = NULL;
290 #define _PR_HAVE_GETPROTO_R_INT
293 -#if __FreeBSD_version >= 602000
294 -#define _PR_HAVE_GETPROTO_R
295 -#define _PR_HAVE_5_ARG_GETPROTO_R
298 /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
299 #if (defined(__GLIBC__) && __GLIBC__ >= 2 && !defined(XP_BEOS))
300 #define _PR_HAVE_GETPROTO_R
303 [FILE:489:patches/patch-config_nspr.pc.in]
304 --- config/nspr.pc.in.orig 2015-10-16 13:22:19 UTC
305 +++ config/nspr.pc.in
306 @@ -6,5 +6,5 @@ includedir=@includedir@
308 Description: The Netscape Portable Runtime
309 Version: @MOD_MAJOR_VERSION@.@MOD_MINOR_VERSION@.@MOD_PATCH_VERSION@
310 -Libs: -L@libdir@ -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@
311 -Cflags: -I@includedir@
312 +Libs: -L${libdir} -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@ @OS_LIBS@
313 +Cflags: -I${includedir}
316 [FILE:29847:patches/patch-libtests]
317 --- lib/tests/arena.c.orig 2015-10-16 13:22:19 UTC
318 +++ lib/tests/arena.c
319 @@ -36,6 +36,7 @@ void DumpAll( void )
325 ** Test Arena allocation.
327 @@ -96,6 +97,7 @@ static void ArenaGrow( void )
330 } /* end ArenaGrow() */
335 --- lib/tests/base64t.c.orig 2015-10-16 13:22:19 UTC
336 +++ lib/tests/base64t.c
337 @@ -1987,7 +1987,6 @@ PRBool test_008(void)
338 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
340 PRUint32 plen = PL_strlen(array[i].plaintext);
341 - PRUint32 clen = ((plen + 2)/3)*4;
343 char *rv = PL_Base64Encode(array[i].plaintext, plen, (char *)0);
345 @@ -2747,9 +2746,6 @@ PRBool test_024(void)
347 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
349 - PRUint32 plen = PL_strlen(array[i].plaintext);
350 - PRUint32 clen = ((plen + 2)/3)*4;
352 char *rv = PL_Base64Encode(array[i].plaintext, 0, (char *)0);
354 if( (char *)0 == rv )
355 @@ -2883,8 +2879,6 @@ PRBool test_027(void)
357 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
359 - PRUint32 clen = PL_strlen(array[i].cyphertext);
361 char *rv = PL_Base64Decode(array[i].cyphertext, 0, (char *)0);
363 if( (char *)0 == rv )
364 --- lib/tests/string.c.orig 2015-10-16 13:22:19 UTC
365 +++ lib/tests/string.c
366 @@ -127,7 +127,7 @@ PRBool test_003(void)
367 rv = PL_strcpy(array[i].dest, array[i].str);
368 if( array[i].rv != rv )
370 - printf("FAIL %d: (0x%x, %s)->0x%x\n", i, array[i].dest,
371 + printf("FAIL %d: (%p, %s)->%p\n", i, array[i].dest,
372 array[i].str ? array[i].str : "(null)", rv);
375 @@ -237,8 +237,8 @@ PRBool test_004(void)
376 rv = PL_strncpy(array[i].dest, array[i].str, array[i].len);
377 if( array[i].rv != rv )
379 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
380 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
381 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
382 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
386 @@ -363,8 +363,8 @@ PRBool test_005(void)
387 rv = PL_strncpyz(array[i].dest, array[i].str, array[i].len);
388 if( array[i].rv != rv )
390 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
391 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
392 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
393 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
397 @@ -415,7 +415,7 @@ PRBool test_006(void)
399 if( (char *)0 == rv )
401 - printf("FAIL %d: 0x%x -> 0\n", i, array[i]);
402 + printf("FAIL %d: %p -> 0\n", i, array[i]);
406 @@ -499,8 +499,8 @@ PRBool test_007(void)
408 if( (char *)0 == rv )
410 - printf("FAIL %d: %s,%lu -> 0\n", i,
411 - array[i].str ? array[i].str : "(null)", array[i].len);
412 + printf("FAIL %d: %s,%u -> 0\n", i,
413 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len);
417 @@ -684,10 +684,10 @@ PRBool test_009(void)
419 if( (char *)0 != rv )
421 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
422 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
423 array[i].first ? array[i].first : "(null)",
424 array[i].second ? array[i].second : "(null)",
425 - array[i].length, rv);
426 + (unsigned)array[i].length, rv);
430 @@ -695,10 +695,10 @@ PRBool test_009(void)
432 if( (char *)0 == rv )
434 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
435 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
436 array[i].first ? array[i].first : "(null)",
437 array[i].second ? array[i].second : "(null)",
438 - array[i].length, array[i].result);
439 + (unsigned)array[i].length, array[i].result);
443 @@ -710,10 +710,10 @@ PRBool test_009(void)
447 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
448 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
449 array[i].first ? array[i].first : "(null)",
450 array[i].second ? array[i].second : "(null)",
451 - array[i].length, rv, array[i].result);
452 + (unsigned)array[i].length, rv, array[i].result);
456 @@ -725,10 +725,10 @@ PRBool test_009(void)
460 - printf("FAIL %d: %s+%s/%lu -> not nulled\n", i,
461 + printf("FAIL %d: %s+%s/%u -> not nulled\n", i,
462 array[i].first ? array[i].first : "(null)",
463 array[i].second ? array[i].second : "(null)",
465 + (unsigned)array[i].length);
469 @@ -736,10 +736,10 @@ PRBool test_009(void)
473 - printf("FAIL %d: %s+%s/%lu -> overrun\n", i,
474 + printf("FAIL %d: %s+%s/%u -> overrun\n", i,
475 array[i].first ? array[i].first : "(null)",
476 array[i].second ? array[i].second : "(null)",
478 + (unsigned)array[i].length);
482 @@ -814,10 +814,10 @@ PRBool test_010(void)
484 if( (char *)0 != rv )
486 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
487 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
488 array[i].first ? array[i].first : "(null)",
489 array[i].second ? array[i].second : "(null)",
490 - array[i].length, rv);
491 + (unsigned)array[i].length, rv);
495 @@ -825,10 +825,10 @@ PRBool test_010(void)
497 if( (char *)0 == rv )
499 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
500 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
501 array[i].first ? array[i].first : "(null)",
502 array[i].second ? array[i].second : "(null)",
503 - array[i].length, array[i].result);
504 + (unsigned)array[i].length, array[i].result);
508 @@ -840,10 +840,10 @@ PRBool test_010(void)
512 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
513 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
514 array[i].first ? array[i].first : "(null)",
515 array[i].second ? array[i].second : "(null)",
516 - array[i].length, rv, array[i].result);
517 + (unsigned)array[i].length, rv, array[i].result);
521 @@ -1072,10 +1072,10 @@ PRBool test_012(void)
525 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
526 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
527 array[i].one ? array[i].one : "(null)",
528 array[i].two ? array[i].two : "(null)",
529 - array[i].max, rv, array[i].sign);
530 + (int)array[i].max, rv, array[i].sign);
534 @@ -1294,10 +1294,10 @@ PRBool test_014(void)
538 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
539 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
540 array[i].one ? array[i].one : "(null)",
541 array[i].two ? array[i].two : "(null)",
542 - array[i].max, rv, array[i].sign);
543 + (int)array[i].max, rv, array[i].sign);
547 @@ -1367,15 +1367,15 @@ PRBool test_015(void)
549 if( (char *)0 == rv )
551 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
552 - array[i].chr, array[i].off);
553 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
554 + array[i].chr, (unsigned)array[i].off);
558 if( &array[i].str[ array[i].off ] != rv )
560 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
561 - array[i].chr, rv, array[i].str, array[i].off);
562 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
563 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
567 @@ -1447,15 +1447,15 @@ PRBool test_016(void)
569 if( (char *)0 == rv )
571 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
572 - array[i].chr, array[i].off);
573 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
574 + array[i].chr, (unsigned)array[i].off);
578 if( &array[i].str[ array[i].off ] != rv )
580 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
581 - array[i].chr, rv, array[i].str, array[i].off);
582 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
583 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
587 @@ -1522,8 +1522,8 @@ PRBool test_017(void)
589 if( (char *)0 != rv )
591 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
592 - array[i].chr, array[i].max, rv);
593 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
594 + array[i].chr, (unsigned)array[i].max, rv);
598 @@ -1531,15 +1531,15 @@ PRBool test_017(void)
600 if( (char *)0 == rv )
602 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
603 - array[i].chr, array[i].max, array[i].off);
604 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
605 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
609 if( &array[i].str[ array[i].off ] != rv )
611 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
612 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
613 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
614 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
618 @@ -1606,8 +1606,8 @@ PRBool test_018(void)
620 if( (char *)0 != rv )
622 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
623 - array[i].chr, array[i].max, rv);
624 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
625 + array[i].chr, (unsigned)array[i].max, rv);
629 @@ -1615,15 +1615,15 @@ PRBool test_018(void)
631 if( (char *)0 == rv )
633 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
634 - array[i].chr, array[i].max, array[i].off);
635 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
636 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
640 - if( &array[i].str[ array[i].off ] != rv )
641 + if( &array[i].str[ array[i].off ] != rv)
643 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
644 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
645 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
646 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
650 @@ -1702,19 +1702,19 @@ PRBool test_019(void)
652 if( (char *)0 == rv )
654 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
655 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
656 array[i].str ? array[i].str : "(null)",
657 array[i].chrs ? array[i].chrs : "(null)",
659 + (unsigned)array[i].off);
663 if( &array[i].str[ array[i].off ] != rv )
665 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
666 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
667 array[i].str ? array[i].str : "(null)",
668 array[i].chrs ? array[i].chrs : "(null)",
669 - rv, array[i].str, array[i].off);
670 + rv, array[i].str, (unsigned)array[i].off);
674 @@ -1793,19 +1793,19 @@ PRBool test_020(void)
676 if( (char *)0 == rv )
678 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
679 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
680 array[i].str ? array[i].str : "(null)",
681 array[i].chrs ? array[i].chrs : "(null)",
683 + (unsigned)array[i].off);
687 if( &array[i].str[ array[i].off ] != rv )
689 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
690 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
691 array[i].str ? array[i].str : "(null)",
692 array[i].chrs ? array[i].chrs : "(null)",
693 - rv, array[i].str, array[i].off);
694 + rv, array[i].str, (unsigned)array[i].off);
698 @@ -1879,10 +1879,10 @@ PRBool test_021(void)
700 if( (char *)0 != rv )
702 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
703 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
704 array[i].str ? array[i].str : "(null)",
705 array[i].chrs ? array[i].chrs : "(null)",
707 + (unsigned)array[i].max, rv);
711 @@ -1890,19 +1890,19 @@ PRBool test_021(void)
713 if( (char *)0 == rv )
715 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
716 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
717 array[i].str ? array[i].str : "(null)",
718 array[i].chrs ? array[i].chrs : "(null)",
719 - array[i].max, array[i].off);
720 + (unsigned)array[i].max, array[i].off);
724 if( &array[i].str[ array[i].off ] != rv )
726 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
727 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
728 array[i].str ? array[i].str : "(null)",
729 array[i].chrs ? array[i].chrs : "(null)",
730 - array[i].max, rv, array[i].str, array[i].off);
731 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
735 @@ -1985,10 +1985,10 @@ PRBool test_022(void)
737 if( (char *)0 != rv )
739 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
740 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
741 array[i].str ? array[i].str : "(null)",
742 array[i].chrs ? array[i].chrs : "(null)",
744 + (unsigned)array[i].max, rv);
748 @@ -1996,19 +1996,19 @@ PRBool test_022(void)
750 if( (char *)0 == rv )
752 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
753 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
754 array[i].str ? array[i].str : "(null)",
755 array[i].chrs ? array[i].chrs : "(null)",
756 - array[i].max, array[i].off);
757 + (unsigned)array[i].max, array[i].off);
761 if( &array[i].str[ array[i].off ] != rv )
763 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
764 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
765 array[i].str ? array[i].str : "(null)",
766 array[i].chrs ? array[i].chrs : "(null)",
767 - array[i].max, rv, array[i].str, array[i].off);
768 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
772 @@ -2104,19 +2104,19 @@ PRBool test_023(void)
774 if( (char *)0 == rv )
776 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
777 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
778 array[i].str ? array[i].str : "(null)",
779 array[i].sub ? array[i].sub : "(null)",
780 - array[i].str, array[i].off);
781 + array[i].str, (unsigned)array[i].off);
785 if( &array[i].str[ array[i].off ] != rv )
787 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
788 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
789 array[i].str ? array[i].str : "(null)",
790 array[i].sub ? array[i].sub : "(null)",
791 - rv, array[i].str, array[i].off);
792 + rv, array[i].str, (unsigned)array[i].off);
796 @@ -2212,19 +2212,19 @@ PRBool test_024(void)
798 if( (char *)0 == rv )
800 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
801 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
802 array[i].str ? array[i].str : "(null)",
803 array[i].sub ? array[i].sub : "(null)",
804 - array[i].str, array[i].off);
805 + array[i].str, (unsigned)array[i].off);
809 if( &array[i].str[ array[i].off ] != rv )
811 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
812 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
813 array[i].str ? array[i].str : "(null)",
814 array[i].sub ? array[i].sub : "(null)",
815 - rv, array[i].str, array[i].off);
816 + rv, array[i].str, (unsigned)array[i].off);
820 @@ -2331,10 +2331,10 @@ PRBool test_025(void)
822 if( (char *)0 != rv )
824 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
825 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
826 array[i].str ? array[i].str : "(null)",
827 array[i].sub ? array[i].sub : "(null)",
829 + (unsigned)array[i].max, rv);
833 @@ -2342,19 +2342,19 @@ PRBool test_025(void)
835 if( (char *)0 == rv )
837 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
838 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
839 array[i].str ? array[i].str : "(null)",
840 array[i].sub ? array[i].sub : "(null)",
841 - array[i].max, array[i].str, array[i].off);
842 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
846 if( &array[i].str[ array[i].off ] != rv )
848 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
849 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
850 array[i].str ? array[i].str : "(null)",
851 array[i].sub ? array[i].sub : "(null)",
852 - array[i].max, rv, array[i].str, array[i].off);
853 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
857 @@ -2463,10 +2463,10 @@ PRBool test_026(void)
859 if( (char *)0 != rv )
861 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
862 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
863 array[i].str ? array[i].str : "(null)",
864 array[i].sub ? array[i].sub : "(null)",
866 + (unsigned)array[i].max, rv);
870 @@ -2474,19 +2474,19 @@ PRBool test_026(void)
872 if( (char *)0 == rv )
874 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
875 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
876 array[i].str ? array[i].str : "(null)",
877 array[i].sub ? array[i].sub : "(null)",
878 - array[i].max, array[i].str, array[i].off);
879 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
883 if( &array[i].str[ array[i].off ] != rv )
885 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
886 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
887 array[i].str ? array[i].str : "(null)",
888 array[i].sub ? array[i].sub : "(null)",
889 - array[i].max, rv, array[i].str, array[i].off);
890 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
894 @@ -2582,19 +2582,19 @@ PRBool test_027(void)
896 if( (char *)0 == rv )
898 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
899 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
900 array[i].str ? array[i].str : "(null)",
901 array[i].sub ? array[i].sub : "(null)",
902 - array[i].str, array[i].off);
903 + array[i].str, (unsigned)array[i].off);
907 if( &array[i].str[ array[i].off ] != rv )
909 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
910 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
911 array[i].str ? array[i].str : "(null)",
912 array[i].sub ? array[i].sub : "(null)",
913 - rv, array[i].str, array[i].off);
914 + rv, array[i].str, (unsigned)array[i].off);
918 @@ -2690,19 +2690,19 @@ PRBool test_028(void)
920 if( (char *)0 == rv )
922 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
923 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
924 array[i].str ? array[i].str : "(null)",
925 array[i].sub ? array[i].sub : "(null)",
926 - array[i].str, array[i].off);
927 + array[i].str, (unsigned)array[i].off);
931 if( &array[i].str[ array[i].off ] != rv )
933 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
934 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
935 array[i].str ? array[i].str : "(null)",
936 array[i].sub ? array[i].sub : "(null)",
937 - rv, array[i].str, array[i].off);
938 + rv, array[i].str, (unsigned)array[i].off);
942 @@ -2809,10 +2809,10 @@ PRBool test_029(void)
944 if( (char *)0 != rv )
946 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
947 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
948 array[i].str ? array[i].str : "(null)",
949 array[i].sub ? array[i].sub : "(null)",
951 + (unsigned)array[i].max, rv);
955 @@ -2820,19 +2820,19 @@ PRBool test_029(void)
957 if( (char *)0 == rv )
959 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
960 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
961 array[i].str ? array[i].str : "(null)",
962 array[i].sub ? array[i].sub : "(null)",
963 - array[i].max, array[i].str, array[i].off);
964 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
968 if( &array[i].str[ array[i].off ] != rv )
970 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
971 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
972 array[i].str ? array[i].str : "(null)",
973 array[i].sub ? array[i].sub : "(null)",
974 - array[i].max, rv, array[i].str, array[i].off);
975 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
979 @@ -2941,10 +2941,10 @@ PRBool test_030(void)
981 if( (char *)0 != rv )
983 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
984 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
985 array[i].str ? array[i].str : "(null)",
986 array[i].sub ? array[i].sub : "(null)",
988 + (unsigned)array[i].max, rv);
992 @@ -2952,19 +2952,19 @@ PRBool test_030(void)
994 if( (char *)0 == rv )
996 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
997 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
998 array[i].str ? array[i].str : "(null)",
999 array[i].sub ? array[i].sub : "(null)",
1000 - array[i].max, array[i].str, array[i].off);
1001 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
1005 if( &array[i].str[ array[i].off ] != rv )
1007 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
1008 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
1009 array[i].str ? array[i].str : "(null)",
1010 array[i].sub ? array[i].sub : "(null)",
1011 - array[i].max, rv, array[i].str, array[i].off);
1012 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
1018 [FILE:85333:patches/patch-tests]
1019 --- lib/tests/Makefile.in.orig 2015-10-16 13:22:19 UTC
1020 +++ lib/tests/Makefile.in
1021 @@ -167,7 +167,7 @@ else
1022 ifeq ($(OS_ARCH),OS2)
1023 $(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS)
1025 - $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@
1026 + $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) -o $@
1030 --- pr/tests/Makefile.in.orig 2015-10-16 13:22:19 UTC
1031 +++ pr/tests/Makefile.in
1032 @@ -489,17 +489,18 @@ endif
1035 runtests:: $(PROGS) ALWAYS
1036 - @$(ECHO) "\nNSPR Test Results - $(OBJDIR)\n"
1037 - @$(ECHO) "BEGIN\t\t\t`date`"
1038 - @$(ECHO) "NSPR_TEST_LOGFILE\t$(LOGFILE)\n"
1039 - @$(ECHO) "Test\t\t\tResult\n"
1040 + @$(ECHO) "NSPR Test Results - $(OBJDIR)"
1041 + @$(ECHO) "BEGIN `date`"
1042 + @$(ECHO) "Test Result"
1043 @cd $(OBJDIR); for i in $(PROGRAMS); do \
1044 - $(ECHO) "$$i\c"; \
1045 - ./$$i >> $(LOGFILE) 2>&1 ; \
1047 + ./$$i > $$i.output 2>&1; \
1048 if [ 0 = $$? ] ; then \
1049 - $(ECHO) "\t\t\tPassed"; \
1051 - $(ECHO) "\t\t\tFAILED"; \
1053 + $(ECHO) " Passed"; \
1056 + $(ECHO) " FAILED"; \
1060 - @$(ECHO) "\nEND\t\t`date`\n"
1061 + @$(ECHO) "END `date`"
1062 --- pr/tests/cleanup.c.orig 2015-10-16 13:22:19 UTC
1063 +++ pr/tests/cleanup.c
1066 static void PR_CALLBACK Thread(void *sleep)
1068 - PR_Sleep(PR_SecondsToInterval((PRUint32)sleep));
1069 + PR_Sleep(PR_SecondsToInterval((intptr_t)sleep));
1070 printf("Thread exiting\n");
1073 @@ -39,7 +39,8 @@ int main(int argc, char **argv)
1074 PRThreadScope type = PR_LOCAL_THREAD;
1075 PRFileDesc *err = PR_GetSpecialFD(PR_StandardError);
1076 PLOptState *opt = PL_CreateOptState(argc, argv, "Ghs:S:t:cC:");
1077 - PRIntn concurrency = 1, child_sleep = 10, main_sleep = 5, threads = 1;
1078 + PRIntn concurrency = 1, main_sleep = 5, threads = 1;
1079 + intptr_t child_sleep = 10;
1082 while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
1083 @@ -80,7 +81,7 @@ int main(int argc, char **argv)
1084 (PR_LOCAL_THREAD == type) ? "LOCAL" : "GLOBAL");
1085 PR_fprintf(err, "\tConcurrency: %d\n", concurrency);
1086 PR_fprintf(err, "\tNumber of threads: %d\n", threads);
1087 - PR_fprintf(err, "\tThread sleep: %d\n", child_sleep);
1088 + PR_fprintf(err, "\tThread sleep: %d\n", (int)child_sleep);
1089 PR_fprintf(err, "\tMain sleep: %d\n", main_sleep);
1090 PR_fprintf(err, "\tCleanup will %sbe called\n\n", (cleanup) ? "" : "NOT ");
1092 --- pr/tests/cltsrv.c.orig 2015-10-16 13:22:19 UTC
1093 +++ pr/tests/cltsrv.c
1094 @@ -887,7 +887,7 @@ int main(int argc, char** argv)
1098 - CSClient_t *client;
1099 + CSClient_t *client = NULL;
1100 PRStatus rv, joinStatus;
1101 CSServer_t *server = NULL;
1103 --- pr/tests/cvar.c.orig 2015-10-16 13:22:19 UTC
1105 @@ -135,14 +135,14 @@ static int alive;
1106 static void PR_CALLBACK CXReader(void *arg)
1108 CircBuf *cbp = (CircBuf *)arg;
1114 for (i = 0; i < n; i++) {
1115 data = GetCBData(cbp);
1116 - if ((int)data != i)
1117 - if (debug_mode) printf("data mismatch at for i = %d usec\n", i);
1118 + if ((intptr_t)data != i)
1119 + if (debug_mode) printf("data mismatch at for i = %ld usec\n", (long)i);
1122 PR_EnterMonitor(mon);
1123 @@ -154,7 +154,7 @@ static void PR_CALLBACK CXReader(void *a
1124 static void PR_CALLBACK CXWriter(void *arg)
1126 CircBuf *cbp = (CircBuf *)arg;
1131 for (i = 0; i < n; i++)
1132 --- pr/tests/cvar2.c.orig 2015-10-16 13:22:19 UTC
1133 +++ pr/tests/cvar2.c
1134 @@ -95,7 +95,7 @@ PrivateCondVarThread(void *_info)
1135 for (index=0; index<info->loops; index++) {
1136 PR_Lock(info->lock);
1137 if (*info->tcount == 0) {
1138 - DPRINTF(("PrivateCondVarThread: thread 0x%lx waiting on cvar = 0x%lx\n",
1139 + DPRINTF(("PrivateCondVarThread: thread %p waiting on cvar = %p\n",
1140 PR_GetCurrentThread(), info->cvar));
1141 PR_WaitCondVar(info->cvar, info->timeout);
1143 @@ -108,8 +108,8 @@ PrivateCondVarThread(void *_info)
1144 PR_Lock(info->exitlock);
1145 (*info->exitcount)++;
1146 PR_NotifyCondVar(info->exitcvar);
1147 -DPRINTF(("PrivateCondVarThread: thread 0x%lx notified exitcvar = 0x%lx cnt = %ld\n",
1148 - PR_GetCurrentThread(), info->exitcvar,(*info->exitcount)));
1149 +DPRINTF(("PrivateCondVarThread: thread %p notified exitcvar = %p cnt = %d\n",
1150 + PR_GetCurrentThread(), info->exitcvar,(int)(*info->exitcount)));
1151 PR_Unlock(info->exitlock);
1154 @@ -157,7 +157,7 @@ CreateTestThread(threadinfo *info,
1156 CondVarTestSUU(void *_arg)
1158 - PRInt32 arg = (PRInt32)_arg;
1159 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1160 PRInt32 index, loops;
1163 @@ -189,7 +189,7 @@ CondVarTestSUU(void *_arg)
1167 - DPRINTF(("CondVarTestSUU: created thread 0x%lx\n",list[index].thread));
1168 + DPRINTF(("CondVarTestSUU: created thread %p\n",list[index].thread));
1171 for (loops = 0; loops < count; loops++) {
1172 @@ -199,7 +199,7 @@ CondVarTestSUU(void *_arg)
1173 (*list[index].tcount)++;
1174 PR_NotifyCondVar(list[index].cvar);
1175 PR_Unlock(list[index].lock);
1176 - DPRINTF(("PrivateCondVarThread: thread 0x%lx notified cvar = 0x%lx\n",
1177 + DPRINTF(("PrivateCondVarThread: thread %p notified cvar = %p\n",
1178 PR_GetCurrentThread(), list[index].cvar));
1181 @@ -227,7 +227,7 @@ CondVarTestSUU(void *_arg)
1183 CondVarTestSUK(void *_arg)
1185 - PRInt32 arg = (PRInt32)_arg;
1186 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1187 PRInt32 index, loops;
1190 @@ -301,7 +301,7 @@ CondVarTestSUK(void *_arg)
1192 CondVarTestPUU(void *_arg)
1194 - PRInt32 arg = (PRInt32)_arg;
1195 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1196 PRInt32 index, loops;
1199 @@ -336,7 +336,7 @@ CondVarTestPUU(void *_arg)
1203 - DPRINTF(("CondVarTestPUU: created thread 0x%lx\n",list[index].thread));
1204 + DPRINTF(("CondVarTestPUU: created thread %p\n",list[index].thread));
1208 @@ -354,8 +354,8 @@ CondVarTestPUU(void *_arg)
1210 /* Wait for threads to finish */
1211 while(exitcount < arg) {
1212 -DPRINTF(("CondVarTestPUU: thread 0x%lx waiting on exitcvar = 0x%lx cnt = %ld\n",
1213 - PR_GetCurrentThread(), exitcvar, exitcount));
1214 +DPRINTF(("CondVarTestPUU: thread %p waiting on exitcvar = %p cnt = %d\n",
1215 + PR_GetCurrentThread(), exitcvar, (int)exitcount));
1216 PR_WaitCondVar(exitcvar, PR_SecondsToInterval(60));
1218 PR_ASSERT(exitcount >= arg);
1219 @@ -365,7 +365,7 @@ DPRINTF(("CondVarTestPUU: thread 0x%lx w
1221 /* Join all the threads */
1222 for(index=0; index<(arg); index++) {
1223 - DPRINTF(("CondVarTestPUU: joining thread 0x%lx\n",list[index].thread));
1224 + DPRINTF(("CondVarTestPUU: joining thread %p\n",list[index].thread));
1225 PR_JoinThread(list[index].thread);
1226 if (list[index].internal) {
1227 PR_Lock(list[index].lock);
1228 @@ -387,7 +387,7 @@ DPRINTF(("CondVarTestPUU: thread 0x%lx w
1230 CondVarTestPUK(void *_arg)
1232 - PRInt32 arg = (PRInt32)_arg;
1233 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1234 PRInt32 index, loops;
1237 @@ -468,7 +468,7 @@ CondVarTestPUK(void *_arg)
1239 CondVarTest(void *_arg)
1241 - PRInt32 arg = (PRInt32)_arg;
1242 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1243 PRInt32 index, loops;
1246 @@ -601,7 +601,7 @@ CondVarTest(void *_arg)
1248 CondVarTimeoutTest(void *_arg)
1250 - PRInt32 arg = (PRInt32)_arg;
1251 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1252 PRInt32 index, loops;
1255 @@ -712,7 +712,7 @@ CondVarTimeoutTest(void *_arg)
1257 CondVarMixedTest(void *_arg)
1259 - PRInt32 arg = (PRInt32)_arg;
1260 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1261 PRInt32 index, loops;
1264 @@ -802,7 +802,7 @@ CondVarMixedTest(void *_arg)
1265 for(index=0; index<(arg*4); index+=3) {
1267 PR_Lock(list[index].lock);
1268 - *list[index].tcount++;
1269 + list[index].tcount++;
1270 PR_NotifyCondVar(list[index].cvar);
1271 PR_Unlock(list[index].lock);
1273 @@ -873,7 +873,7 @@ static void Measure(void (*func)(void *)
1276 start = PR_IntervalNow();
1277 - (*func)((void *)arg);
1278 + (*func)((void *)(intptr_t)arg);
1279 stop = PR_IntervalNow();
1281 d = (double)PR_IntervalToMicroseconds(stop - start);
1282 @@ -932,7 +932,7 @@ default_threads, default_threads*2, defa
1283 PR_SetConcurrency(2);
1285 for (threads = default_threads; threads < default_threads*5; threads+=default_threads) {
1286 - printf("\n%ld Thread tests\n", threads);
1287 + printf("\n%d Thread tests\n", (int)threads);
1288 Measure(CondVarTestSUU, threads, "Condvar simple test shared UU");
1289 Measure(CondVarTestSUK, threads, "Condvar simple test shared UK");
1290 Measure(CondVarTestPUU, threads, "Condvar simple test priv UU");
1291 --- pr/tests/foreign.c.orig 2015-10-16 13:22:19 UTC
1292 +++ pr/tests/foreign.c
1293 @@ -202,7 +202,7 @@ static void OneShot(void *arg)
1296 PRFileDesc *pair[2];
1297 - PRIntn test = (PRIntn)arg;
1298 + intptr_t test = (intptr_t)arg;
1300 for (test = 0; test < 12; ++test) {
1302 @@ -302,7 +302,7 @@ static void OneShot(void *arg)
1303 int main(int argc, char **argv)
1306 - PRInt32 thread_cnt = DEFAULT_THREAD_COUNT;
1307 + intptr_t thread_cnt = DEFAULT_THREAD_COUNT;
1309 PLOptState *opt = PL_CreateOptState(argc, argv, "dt:");
1311 --- pr/tests/forktest.c.orig 2015-10-16 13:22:19 UTC
1312 +++ pr/tests/forktest.c
1313 @@ -47,7 +47,7 @@ ClientThreadFunc(void *arg)
1316 PRFileDesc *sock = NULL;
1317 - PRInt32 tmp = (PRInt32)arg;
1318 + intptr_t tmp = (intptr_t)arg;
1321 * Make sure the PR_Accept call will block
1322 @@ -143,7 +143,7 @@ DoIO(void)
1325 clientThread = PR_CreateThread( PR_USER_THREAD, ClientThreadFunc,
1326 - (void *) PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1327 + (void *)(intptr_t)PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1328 PR_JOINABLE_THREAD, 0);
1329 if (clientThread == NULL) {
1330 fprintf(stderr, "Cannot create client thread: (%d, %d)\n",
1331 @@ -151,6 +151,9 @@ DoIO(void)
1335 + printf("Wait one second before accept\n");
1337 + PR_Sleep(PR_SecondsToInterval(1));
1338 printf("Accepting connection at port %hu\n", PR_ntohs(addr.inet.port));
1340 sock = PR_Accept(listenSock, &addr, PR_SecondsToInterval(5));
1341 --- pr/tests/getai.c.orig 2015-10-16 13:22:19 UTC
1342 +++ pr/tests/getai.c
1343 @@ -13,8 +13,13 @@ int main(int argc, char **argv)
1349 - ai = PR_GetAddrInfoByName(argv[1], PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1353 + host = "www.FreeBSD.org";
1354 + ai = PR_GetAddrInfoByName(host, PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1356 fprintf(stderr, "PR_GetAddrInfoByName failed: (%d, %d)\n",
1357 PR_GetError(), PR_GetOSError());
1358 --- pr/tests/instrumt.c.orig 2015-10-16 13:22:19 UTC
1359 +++ pr/tests/instrumt.c
1366 #include <prclist.h>
1369 #define COUNT_LIMIT (10 * ( 1024))
1371 #define SMALL_TRACE_BUFSIZE ( 60 * 1024 )
1376 @@ -78,10 +78,10 @@ static void Help(void)
1378 static void ListCounters(void)
1380 +#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
1381 PR_DEFINE_COUNTER( qh );
1382 PR_DEFINE_COUNTER( rh );
1383 const char *qn, *rn, *dn;
1384 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1387 PR_INIT_COUNTER_HANDLE( qh, NULL );
1388 @@ -92,7 +92,7 @@ static void ListCounters(void)
1389 PR_FIND_NEXT_COUNTER_RNAME(rh, rh, qh );
1390 while ( rh != NULL )
1392 - PR_GET_COUNTER_NAME_FROM_HANDLE( rh, qname, rname, desc );
1393 + PR_GET_COUNTER_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1394 PR_GET_COUNTER(tCtr, rh);
1395 PR_LOG( lm, msgLevel,
1396 ( "QName: %s RName: %s Desc: %s Value: %ld\n",
1397 @@ -101,15 +101,15 @@ static void ListCounters(void)
1399 PR_FIND_NEXT_COUNTER_QNAME(qh, qh);
1403 } /* end ListCounters() */
1405 static void ListTraces(void)
1407 +#if defined(DEBUG) || defined(FORCE_NSPR_TRACE)
1408 PR_DEFINE_TRACE( qh );
1409 PR_DEFINE_TRACE( rh );
1410 const char *qn, *rn, *dn;
1411 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1413 PR_INIT_TRACE_HANDLE( qh, NULL );
1414 PR_FIND_NEXT_TRACE_QNAME(qh, qh );
1415 @@ -119,7 +119,7 @@ static void ListTraces(void)
1416 PR_FIND_NEXT_TRACE_RNAME(rh, rh, qh );
1417 while ( rh != NULL )
1419 - PR_GET_TRACE_NAME_FROM_HANDLE( rh, qname, rname, desc );
1420 + PR_GET_TRACE_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1421 PR_LOG( lm, msgLevel,
1422 ( "QName: %s RName: %s Desc: %s",
1424 @@ -127,7 +127,7 @@ static void ListTraces(void)
1426 PR_FIND_NEXT_TRACE_QNAME(qh, qh);
1430 } /* end ListCounters() */
1433 @@ -326,7 +326,7 @@ static void PR_CALLBACK SampleTrace( voi
1435 static void TraceTest( void )
1440 PR_DEFINE_TRACE( th );
1442 --- pr/tests/io_timeout.c.orig 2015-10-16 13:22:19 UTC
1443 +++ pr/tests/io_timeout.c
1445 /* Used to get the command line option */
1446 #include "plgetopt.h"
1450 +#include <string.h>
1453 #define NUM_THREADS 1
1454 -#define BASE_PORT 8000
1455 +#define BASE_PORT 38011
1456 #define DEFAULT_ACCEPT_TIMEOUT 2
1458 typedef struct threadInfo {
1459 @@ -38,7 +40,7 @@ typedef struct threadInfo {
1462 PRIntn failed_already = 0;
1463 -PRIntn debug_mode = 0;
1464 +PRIntn debug_mode = 1;
1466 #define LOCAL_SCOPE_STRING "LOCAL scope"
1467 #define GLOBAL_SCOPE_STRING "GLOBAL scope"
1468 @@ -54,7 +56,7 @@ thread_main(void *_info)
1469 PRFileDesc *clientSock;
1471 PRThreadScope tscope;
1473 + const char *scope_str;
1477 @@ -73,6 +75,7 @@ thread_main(void *_info)
1480 PR_NOT_REACHED("Invalid thread scope");
1484 printf("thread id %d, scope %s\n", info->id, scope_str);
1485 @@ -91,7 +94,12 @@ thread_main(void *_info)
1486 rv = PR_Bind(listenSock, &listenAddr);
1487 if (rv == PR_FAILURE) {
1489 - printf("unable to bind\n");
1490 + printf("unable to bind to %d: %s\n",
1491 + BASE_PORT + info->id, strerror(PR_GetOSError()));
1492 + if (PR_GetOSError() == EADDRINUSE) {
1493 + printf("can not proceed with this test\n");
1499 @@ -113,8 +121,9 @@ thread_main(void *_info)
1500 if (clientSock == NULL) {
1501 if (PR_GetError() == PR_IO_TIMEOUT_ERROR) {
1503 - printf("PR_Accept() timeout worked!\n");
1504 - printf("TEST PASSED! PR_Accept() returned error %d\n",
1505 + printf("PR_Accept() timeout worked!\n"
1506 + "TEST PASSED! PR_Accept() returned error "
1507 + "PR_IO_TIMEOUT_ERROR (%ld)\n",
1508 PR_IO_TIMEOUT_ERROR);
1511 --- pr/tests/layer.c.orig 2015-10-16 13:22:19 UTC
1512 +++ pr/tests/layer.c
1513 @@ -45,7 +45,10 @@ static PRUint16 default_port = 12273;
1514 static PRFileDesc *PushLayer(PRFileDesc *stack)
1516 PRFileDesc *layer = PR_CreateIOLayerStub(identity, &myMethods);
1517 - PRStatus rv = PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
1518 +#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
1519 + PRStatus rv = /* we only need rv for PR_ASSERT() */
1521 + PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
1522 if (verbosity > quiet)
1523 PR_fprintf(logFile, "Pushed layer(0x%x) onto stack(0x%x)\n", layer, stack);
1524 PR_ASSERT(PR_SUCCESS == rv);
1525 --- pr/tests/lazyinit.c.orig 2015-10-16 13:22:19 UTC
1526 +++ pr/tests/lazyinit.c
1527 @@ -43,7 +43,6 @@ int main(int argc, char **argv)
1531 - PRCondVar *cv = NULL;
1532 PRThread *thread = NULL;
1533 PRIntervalTime interval = 0;
1534 PRFileDesc *file, *udp, *tcp, *pair[2];
1535 --- pr/tests/lltest.c.orig 2015-10-16 13:22:19 UTC
1536 +++ pr/tests/lltest.c
1537 @@ -545,6 +545,7 @@ TestConversion( void )
1542 static void ShiftCompileOnly()
1545 @@ -561,6 +562,7 @@ static void ShiftCompileOnly()
1546 LL_ISHL(ia, 49, 32);
1548 } /* ShiftCompileOnly */
1553 @@ -635,7 +637,6 @@ TestArithmetic( void )
1554 PRInt64 largeValPlusOne = LL_INIT( 0x00000002, 0x00000000 );
1555 PRInt64 largeValTimesTwo = LL_INIT( 0x00000003, 0xfffffffe );
1556 PRInt64 largeMultCand = LL_INIT( 0x00000000, 0x7fffffff );
1557 - PRInt64 largeMinusMultCand = LL_INIT( 0xffffffff, 0x10000001 );
1558 PRInt64 largeMultCandx64K = LL_INIT( 0x00007fff, 0xffff0000 );
1559 PRInt64 largeNumSHL5 = LL_INIT( 0x0000001f, 0xffffffe0 );
1560 PRInt64 result, result2;
1561 --- pr/tests/mbcs.c.orig 2015-10-16 13:22:19 UTC
1563 @@ -54,13 +54,12 @@ char *dirName = NULL; /* directory nam
1565 ** Traverse directory
1567 -static void TraverseDirectory( unsigned char *dir )
1568 +static void TraverseDirectory(const char *dir)
1571 PRDirEntry *dirEntry;
1578 @@ -81,16 +80,16 @@ static void TraverseDirectory( unsigned
1581 if ( PR_FILE_FILE == info.type ) {
1582 - printf("File: %s \tsize: %ld\n", dirEntry->name, info.size );
1583 + printf("File: %s \tsize: %ld\n", dirEntry->name, (long)info.size );
1584 fd = PR_Open( file, PR_RDONLY, 0 );
1586 printf("PR_Open() failed. Error: %ld, OSError: %ld\n",
1587 - PR_GetError(), PR_GetOSError());
1588 + (long)PR_GetError(), (long)PR_GetOSError());
1590 rc = PR_Close( fd );
1591 if ( PR_FAILURE == rc ) {
1592 printf("PR_Close() failed. Error: %ld, OSError: %ld\n",
1593 - PR_GetError(), PR_GetOSError());
1594 + (long)PR_GetError(), (long)PR_GetOSError());
1596 } else if ( PR_FILE_DIRECTORY == info.type ) {
1597 sprintf( nextDir, "%s/%s", dir, dirEntry->name );
1598 --- pr/tests/nbconn.c.orig 2015-10-16 13:22:19 UTC
1599 +++ pr/tests/nbconn.c
1600 @@ -54,8 +54,7 @@ int main(int argc, char **argv)
1602 PRSocketOptionData optData;
1603 const char *hostname = NULL;
1604 - PRIntn default_case, n, bytes_read, bytes_sent;
1605 - PRInt32 failed_already = 0;
1606 + PRIntn default_case, n;
1610 @@ -164,7 +163,7 @@ int main(int argc, char **argv)
1613 printf( "PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
1614 - PR_GetError(), PR_GetOSError());
1615 + (long)PR_GetError(), (long)PR_GetOSError());
1619 @@ -235,7 +234,7 @@ connection_success_test()
1620 PRThread *thr = NULL;
1622 char send_buf[DATA_BUF_SIZE], recv_buf[DATA_BUF_SIZE];
1623 - PRIntn default_case, n, bytes_read, bytes_sent;
1624 + PRIntn n, bytes_read, bytes_sent;
1625 PRIntn failed_already = 0;
1628 @@ -311,7 +310,7 @@ connection_success_test()
1632 - DPRINTF(("Created TCP_Server thread [0x%x]\n",thr));
1633 + DPRINTF(("Created TCP_Server thread [%p]\n", thr));
1635 pd.in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT;
1636 n = PR_Poll(&pd, 1, PR_INTERVAL_NO_TIMEOUT);
1637 @@ -390,7 +389,7 @@ connection_success_test()
1638 DPRINTF(("Data integrity verified\n"));
1640 fprintf(stderr,"PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
1641 - PR_GetError(), PR_GetOSError());
1642 + (long)PR_GetError(), (long)PR_GetOSError());
1646 @@ -496,7 +495,6 @@ connection_failure_test()
1649 if (PR_GetConnectStatus(&pd) == PR_SUCCESS) {
1651 fprintf(stderr,"PR_GetConnectStatus succeeded, expected to fail\n");
1654 --- pr/tests/nblayer.c.orig 2015-10-16 13:22:19 UTC
1655 +++ pr/tests/nblayer.c
1656 @@ -299,7 +299,7 @@ static PRStatus PR_CALLBACK MyClose(PRFi
1657 static PRInt16 PR_CALLBACK MyPoll(
1658 PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags)
1660 - PRInt16 my_flags, new_flags;
1661 + PRInt16 my_flags = -1, new_flags;
1662 PRFilePrivate *mine = (PRFilePrivate*)fd->secret;
1663 if (0 != (PR_POLL_READ & in_flags))
1665 @@ -342,7 +342,7 @@ static PRFileDesc * PR_CALLBACK MyAccept
1666 PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
1669 - PRFileDesc *newfd, *layer = fd;
1670 + PRFileDesc *newfd;
1671 PRFileDesc *newstack;
1672 PRFilePrivate *newsecret;
1674 @@ -428,6 +428,8 @@ static PRInt32 PR_CALLBACK MyRecv(
1675 mine->rcvinprogress = 0;
1676 return mine->rcvreq; /* << -- that's it! */
1678 + PR_ASSERT(!"How did I get this mine->rcvstate?");
1683 @@ -484,6 +486,8 @@ static PRInt32 PR_CALLBACK MySend(
1684 mine->xmtinprogress = 0;
1685 return mine->xmtreq; /* <<-- That's the one! */
1687 + PR_ASSERT(!"How did I get this mine->xmtstate?");
1692 --- pr/tests/nonblock.c.orig 2015-10-16 13:22:19 UTC
1693 +++ pr/tests/nonblock.c
1695 static void PR_CALLBACK
1696 clientThreadFunc(void *arg)
1698 - PRUintn port = (PRUintn)arg;
1699 + intptr_t port = (intptr_t)arg;
1702 char buf[CHUNK_SIZE];
1703 @@ -147,7 +147,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1706 clientThread = PR_CreateThread(PR_USER_THREAD,
1707 - clientThreadFunc, (void *) listenPort,
1708 + clientThreadFunc, (void *) (intptr_t)listenPort,
1709 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1710 PR_UNJOINABLE_THREAD, 0);
1711 if (clientThread == NULL) {
1712 @@ -191,7 +191,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1713 if (retVal != -1 || PR_GetError() != PR_WOULD_BLOCK_ERROR) {
1714 PL_PrintError("First Receive:\n");
1715 fprintf(stderr, "First PR_Recv: retVal: %ld, Error: %ld\n",
1716 - retVal, PR_GetError());
1717 + (long)retVal, (long)PR_GetError());
1720 printf("read: EWOULDBLOCK, good\n");
1721 @@ -201,7 +201,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1722 if (retVal != CHUNK_SIZE) {
1723 PL_PrintError("Second Receive:\n");
1724 fprintf(stderr, "Second PR_Recv: retVal: %ld, Error: %ld\n",
1725 - retVal, PR_GetError());
1726 + (long)retVal, (long)PR_GetError());
1729 printf("read: %d bytes, good\n", retVal);
1730 --- pr/tests/obsints.c.orig 2015-10-16 13:22:19 UTC
1731 +++ pr/tests/obsints.c
1732 @@ -25,6 +25,9 @@ int main(int argc, char **argv)
1733 #else /* NO_NSPR_10_SUPPORT */
1735 #include "prtypes.h" /* which includes protypes.h */
1736 +#if !defined(__GNUC__)
1740 int main(int argc, char **argv)
1742 @@ -32,17 +35,17 @@ int main(int argc, char **argv)
1743 * Compilation fails if any of these integer types are not
1744 * defined by protypes.h.
1758 + uintn uin __unused;
1761 + uint8 ui8 __unused;
1762 + int16 i16 __unused;
1763 + uint16 ui16 __unused;
1764 + int32 i32 __unused;
1765 + uint32 ui32 __unused;
1766 + int64 i64 __unused;
1767 + uint64 ui64 __unused;
1771 --- pr/tests/parsetm.c.orig 2015-10-16 13:22:19 UTC
1772 +++ pr/tests/parsetm.c
1773 @@ -31,8 +31,8 @@ static void PrintExplodedTime(const PREx
1775 /* Print day of the week, month, day, hour, minute, and second */
1776 if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
1777 - dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
1778 - et->tm_hour, et->tm_min, et->tm_sec);
1779 + dayOfWeek[et->tm_wday], month[et->tm_month], (long)et->tm_mday,
1780 + (long)et->tm_hour, (long)et->tm_min, (long)et->tm_sec);
1782 /* Print time zone */
1783 totalOffset = et->tm_params.tp_gmt_offset + et->tm_params.tp_dst_offset;
1784 @@ -47,7 +47,7 @@ static void PrintExplodedTime(const PREx
1785 hourOffset = totalOffset / 3600;
1786 minOffset = (totalOffset % 3600) / 60;
1788 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
1789 + printf("%s%02ld%02ld ", sign, (long)hourOffset, (long)minOffset);
1793 --- pr/tests/peek.c.orig 2015-10-16 13:22:19 UTC
1795 @@ -135,7 +135,7 @@ static void ClientNB(void *arg)
1798 PRSocketOptionData opt;
1799 - PRUint16 port = (PRUint16) arg;
1800 + PRUint16 port = (intptr_t) arg;
1802 char buf[BUFFER_SIZE];
1804 @@ -299,7 +299,7 @@ RunTest(PRThreadScope scope, PRFileDesc
1807 client = PR_CreateThread(
1808 - PR_USER_THREAD, ClientNB, (void *) port,
1809 + PR_USER_THREAD, ClientNB, (void *)(intptr_t) port,
1810 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
1811 if (NULL == client) {
1812 fprintf(stderr, "PR_CreateThread failed\n");
1813 --- pr/tests/perf.c.orig 2015-10-16 13:22:19 UTC
1815 @@ -141,7 +141,7 @@ static void PR_CALLBACK CXReader(void *a
1817 for (i = 0; i < n; i++) {
1819 - DPRINTF(("CXReader: thread = 0x%lx waiting\n",
1820 + DPRINTF(("CXReader: thread = %p waiting\n",
1821 PR_GetCurrentThread()));
1822 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
1824 @@ -154,7 +154,7 @@ static void PR_CALLBACK CXReader(void *a
1827 PR_ExitMonitor(mon2);
1828 - DPRINTF(("CXReader: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1829 + DPRINTF(("CXReader: thread = %p exiting\n", PR_GetCurrentThread()));
1832 static void PR_CALLBACK CXWriter(void *arg)
1833 @@ -165,7 +165,7 @@ static void PR_CALLBACK CXWriter(void *a
1835 for (i = 0; i < n; i++) {
1837 - DPRINTF(("CXWriter: thread = 0x%lx waiting\n",
1838 + DPRINTF(("CXWriter: thread = %p waiting\n",
1839 PR_GetCurrentThread()));
1840 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
1842 @@ -178,7 +178,7 @@ static void PR_CALLBACK CXWriter(void *a
1845 PR_ExitMonitor(mon2);
1846 - DPRINTF(("CXWriter: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1847 + DPRINTF(("CXWriter: thread = %p exiting\n", PR_GetCurrentThread()));
1850 static void ContextSwitch(PRThreadScope scope1, PRThreadScope scope2)
1851 @@ -198,7 +198,7 @@ static void ContextSwitch(PRThreadScope
1853 fprintf(stderr, "ContextSwitch: cannot create thread\n");
1855 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
1856 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
1857 (scope1 == PR_GLOBAL_THREAD ?
1858 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1860 @@ -212,7 +212,7 @@ static void ContextSwitch(PRThreadScope
1862 fprintf(stderr, "ContextSwitch: cannot create thread\n");
1864 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
1865 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
1866 (scope2 == PR_GLOBAL_THREAD ?
1867 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1869 @@ -254,10 +254,10 @@ static void PR_CALLBACK SemaThread(void
1872 for (i = 0; i < n; i++) {
1873 - DPRINTF(("SemaThread: thread = 0x%lx waiting on sem = 0x%lx\n",
1874 + DPRINTF(("SemaThread: thread = %p waiting on sem = %p\n",
1875 PR_GetCurrentThread(), sem[0]));
1877 - DPRINTF(("SemaThread: thread = 0x%lx posting on sem = 0x%lx\n",
1878 + DPRINTF(("SemaThread: thread = %p posting on sem = %p\n",
1879 PR_GetCurrentThread(), sem[1]));
1882 @@ -266,7 +266,7 @@ static void PR_CALLBACK SemaThread(void
1885 PR_ExitMonitor(mon2);
1886 - DPRINTF(("SemaThread: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1887 + DPRINTF(("SemaThread: thread = %p exiting\n", PR_GetCurrentThread()));
1890 static PRSemaphore *sem_set1[2];
1891 @@ -294,7 +294,7 @@ static void SemaContextSwitch(PRThreadSc
1893 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
1895 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
1896 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
1897 (scope1 == PR_GLOBAL_THREAD ?
1898 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1900 @@ -309,7 +309,7 @@ static void SemaContextSwitch(PRThreadSc
1902 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
1904 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
1905 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
1906 (scope2 == PR_GLOBAL_THREAD ?
1907 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1909 --- pr/tests/pipepong.c.orig 2015-10-16 13:22:19 UTC
1910 +++ pr/tests/pipepong.c
1911 @@ -36,7 +36,7 @@ int main(int argc, char **argv)
1912 nBytes = fread(buf, 1, 5, stdin);
1913 fprintf(stderr, "pong process: received \"%s\"\n", buf);
1915 - fprintf(stderr, "pong process: expected 5 bytes but got %d bytes\n",
1916 + fprintf(stderr, "pong process: expected 5 bytes but got %zd bytes\n",
1920 --- pr/tests/poll_nm.c.orig 2015-10-16 13:22:19 UTC
1921 +++ pr/tests/poll_nm.c
1922 @@ -47,7 +47,7 @@ PRIntn debug_mode;
1923 static void PR_CALLBACK
1924 clientThreadFunc(void *arg)
1926 - PRUintn port = (PRUintn) arg;
1927 + PRUintn port = (intptr_t) arg;
1931 @@ -196,7 +196,7 @@ int main(int argc, char **argv)
1934 clientThread = PR_CreateThread(PR_USER_THREAD,
1935 - clientThreadFunc, (void *) listenPort1,
1936 + clientThreadFunc, (void *)(intptr_t)listenPort1,
1937 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1938 PR_UNJOINABLE_THREAD, 0);
1939 if (clientThread == NULL) {
1940 @@ -206,7 +206,7 @@ int main(int argc, char **argv)
1943 clientThread = PR_CreateThread(PR_USER_THREAD,
1944 - clientThreadFunc, (void *) listenPort2,
1945 + clientThreadFunc, (void *)(intptr_t)listenPort2,
1946 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1947 PR_UNJOINABLE_THREAD, 0);
1948 if (clientThread == NULL) {
1949 --- pr/tests/prfz.c.orig 2015-10-16 13:22:19 UTC
1955 -#include <sys/types.h>
1956 +#include <stdint.h>
1960 --- pr/tests/provider.c.orig 2015-10-16 13:22:19 UTC
1961 +++ pr/tests/provider.c
1962 @@ -1049,7 +1049,7 @@ int main(int argc, char **argv)
1966 - CSClient_t *client;
1967 + CSClient_t *client = NULL;
1968 PRStatus rv, joinStatus;
1969 CSServer_t *server = NULL;
1971 --- pr/tests/prpoll.c.orig 2015-10-16 13:22:19 UTC
1972 +++ pr/tests/prpoll.c
1973 @@ -39,7 +39,7 @@ int main(int argc, char **argv)
1975 clientThreadFunc(void *arg)
1977 - PRUint16 port = (PRUint16) arg;
1978 + PRUint16 port = (PRUint16)(uintptr_t)arg;
1982 @@ -73,7 +73,7 @@ int main(int argc, char **argv)
1985 struct sockaddr_in saddr;
1987 + socklen_t saddr_len;
1988 PRUint16 listenPort3;
1989 PRFileDesc *socket_poll_fd;
1991 @@ -199,7 +199,7 @@ int main(int argc, char **argv)
1994 clientThread = PR_CreateThread(PR_USER_THREAD,
1995 - clientThreadFunc, (void *) listenPort1,
1996 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
1997 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1998 PR_UNJOINABLE_THREAD, 0);
1999 if (clientThread == NULL) {
2000 @@ -208,7 +208,7 @@ int main(int argc, char **argv)
2003 clientThread = PR_CreateThread(PR_USER_THREAD,
2004 - clientThreadFunc, (void *) listenPort2,
2005 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2006 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
2007 PR_UNJOINABLE_THREAD, 0);
2008 if (clientThread == NULL) {
2009 @@ -217,7 +217,7 @@ int main(int argc, char **argv)
2012 clientThread = PR_CreateThread(PR_USER_THREAD,
2013 - clientThreadFunc, (void *) listenPort3,
2014 + clientThreadFunc, (void *)(uintptr_t)listenPort3,
2015 PR_PRIORITY_NORMAL, PR_GLOBAL_BOUND_THREAD,
2016 PR_UNJOINABLE_THREAD, 0);
2017 if (clientThread == NULL) {
2018 --- pr/tests/randseed.c.orig 2015-10-16 13:22:19 UTC
2019 +++ pr/tests/randseed.c
2020 @@ -48,7 +48,6 @@ static void Help( void )
2021 static void PrintRand( void *buf, PRIntn size )
2026 printf("%4.4d--\n", size );
2028 --- pr/tests/ranfile.c.orig 2015-10-16 13:22:19 UTC
2029 +++ pr/tests/ranfile.c
2030 @@ -130,7 +130,7 @@ static void PR_CALLBACK Thread(void *arg
2031 PRStatus rv = PR_SUCCESS;
2032 Hammer_t *cd = (Hammer_t*)arg;
2034 - (void)sprintf(filename, "%ssg%04ld.dat", baseName, cd->id);
2035 + (void)sprintf(filename, "%ssg%04d.dat", baseName, (int)cd->id);
2037 if (debug_mode) printf("Starting work on %s\n", filename);
2039 @@ -364,14 +364,14 @@ int main(int argc, char **argv)
2042 if (debug_mode) printf(
2043 - "%s: test failed %s after %ld seconds\n",
2044 - programName, where[hammer[poll].problem], duration);
2045 + "%s: test failed %s after %d seconds\n",
2046 + programName, where[hammer[poll].problem], (int)duration);
2047 else failed_already=1;
2051 if (debug_mode) printf(
2052 - "%s: [%ld [%ld] %ld] writes/sec average\n",
2053 + "%s: [%d [%d] %d] writes/sec average\n",
2054 programName, writesMin, writesTot * 1000 / durationTot, writesMax);
2056 PR_DestroyCondVar(cv);
2057 --- pr/tests/runtests.sh.orig 2015-10-16 13:22:19 UTC
2058 +++ pr/tests/runtests.sh
2059 @@ -58,9 +58,6 @@ fi
2060 # Tests not run (but should)
2063 -#forktest (failed on IRIX)
2064 -#nbconn - fails on some platforms
2065 -#poll_er - fails on some platforms? limited use?
2066 #prpoll - the bad-FD test needs to be moved to a different test
2067 #sleep - specific to OS/2
2069 @@ -92,6 +89,7 @@ exit
2077 @@ -99,7 +97,6 @@ getproto
2085 @@ -120,6 +117,7 @@ logger
2093 @@ -136,6 +134,7 @@ perf
2101 @@ -208,7 +207,7 @@ OBJDIR=`basename $PWD`
2102 printf "\nNSPR Test Results - $OBJDIR\n\n"
2103 printf "BEGIN\t\t\t`date`\n"
2104 printf "NSPR_TEST_LOGFILE\t${LOGFILE}\n\n"
2105 -printf "Test\t\t\tResult\n\n"
2106 +printf " Test\t\t\tResult\n\n"
2107 if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_PLATFORM = "Windows_NT" ] || [ $OS_PLATFORM = "OS/2" ] ; then
2110 @@ -226,10 +225,8 @@ if [ $OS_PLATFORM = "Windows_95" ] || [
2115 - printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2117 - ./$prog >> ${LOGFILE} 2>&1 &
2119 + ./$prog >> $prog.output 2>&1 &
2122 if test -n "$TEST_TIMEOUT" && test "$TEST_TIMEOUT" -gt 0
2123 @@ -244,28 +241,11 @@ else
2124 printf "\t\t\tPassed\n";
2126 printf "\t\t\tFAILED\n";
2127 + sed "s,^, $prog: ," < $prog.output
2130 - printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2134 printf "END\t\t\t`date`\n"
2153 --- pr/tests/sel_spd.c.orig 2015-10-16 13:22:19 UTC
2154 +++ pr/tests/sel_spd.c
2159 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
2160 +# include <unistd.h> /* getopt(3) */
2166 #define PORT_BASE 19000
2168 typedef struct timer_slot_t {
2169 - unsigned long d_connect;
2170 - unsigned long d_cl_data;
2171 - unsigned long d_sv_data;
2172 - unsigned long d_close;
2173 - unsigned long d_total;
2174 - unsigned long requests;
2175 + unsigned int d_connect;
2176 + unsigned int d_cl_data;
2177 + unsigned int d_sv_data;
2178 + unsigned int d_close;
2179 + unsigned int d_total;
2180 + unsigned int requests;
2183 -static long _iterations = 5;
2184 -static long _client_data = 8192;
2185 +static int _iterations = 5;
2186 +static int _client_data = 8192;
2190 @@ -40,12 +43,11 @@ static long _client_data = 8192;
2191 * memory and not be able to allocate thread stack or client/server data
2194 -static long _server_data = (8*1024);
2195 -static long _threads_max = 10, _threads = 10;
2196 +static int _server_data = (8*1024);
2198 -static long _server_data = (128*1024);
2199 -static long _threads_max = 10, _threads = 10;
2200 +static int _server_data = (128*1024);
2202 +static int _threads_max = 10, _threads = 10;
2204 static int verbose=0;
2205 static PRMonitor *exit_cv;
2206 @@ -101,7 +103,7 @@ _server_thread(void *arg_id)
2207 void _client_thread(void *);
2209 int *id = (int *)arg_id;
2211 + PRFileDesc *sock = NULL;
2212 PRSocketOptionData sockopt;
2214 PRFileDesc * newsock;
2215 @@ -469,12 +471,12 @@ void
2216 tally_results(int verbose)
2219 - unsigned long tot_connect = 0;
2220 - unsigned long tot_cl_data = 0;
2221 - unsigned long tot_sv_data = 0;
2222 - unsigned long tot_close = 0;
2223 - unsigned long tot_all = 0;
2224 - unsigned long tot_requests = 0;
2225 + unsigned int tot_connect = 0;
2226 + unsigned int tot_cl_data = 0;
2227 + unsigned int tot_sv_data = 0;
2228 + unsigned int tot_close = 0;
2229 + unsigned int tot_all = 0;
2230 + unsigned int tot_requests = 0;
2232 fprintf(stdout, "Server results:\n\n");
2233 for (index=0; index<_threads_max*2; index+=2) {
2234 --- pr/tests/selct_nm.c.orig 2015-10-16 13:22:19 UTC
2235 +++ pr/tests/selct_nm.c
2236 @@ -45,7 +45,7 @@ PRIntn debug_mode;
2238 clientThreadFunc(void *arg)
2240 - PRUintn port = (PRUintn) arg;
2241 + PRUintn port = (PRUintn)(uintptr_t)arg;
2245 @@ -165,7 +165,7 @@ failed_already=1;
2246 if (debug_mode) printf("%s", buf);
2248 clientThread = PR_CreateThread(PR_USER_THREAD,
2249 - clientThreadFunc, (void *) listenPort1,
2250 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
2251 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2252 PR_UNJOINABLE_THREAD, 0);
2253 if (clientThread == NULL) {
2254 @@ -175,7 +175,7 @@ failed_already=1;
2257 clientThread = PR_CreateThread(PR_USER_THREAD,
2258 - clientThreadFunc, (void *) listenPort2,
2259 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2260 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2261 PR_UNJOINABLE_THREAD, 0);
2262 if (clientThread == NULL) {
2263 --- pr/tests/select2.c.orig 2015-10-16 13:22:19 UTC
2264 +++ pr/tests/select2.c
2265 @@ -53,6 +53,7 @@ PRInt32 count;
2267 ***********************************************************************/
2269 +static int exitcode = 2;
2271 static void Test_Result (int result)
2273 @@ -60,9 +61,12 @@ static void Test_Result (int result)
2277 + if (exitcode == 2)
2285 printf ("NOSTATUS\n");
2286 @@ -319,4 +323,5 @@ int main(int argc, char **argv)
2292 --- pr/tests/semaerr.c.orig 2015-10-16 13:22:19 UTC
2293 +++ pr/tests/semaerr.c
2294 @@ -65,7 +65,7 @@ int main(int argc, char **argv)
2297 if (PR_GetError() != PR_FILE_NOT_FOUND_ERROR) {
2298 - fprintf(stderr, "Expected error is %d but got (%d, %d)\n",
2299 + fprintf(stderr, "Expected error is %ld (PR_FILE_NOT_FOUND_ERROR) but got (%d, %d)\n",
2300 PR_FILE_NOT_FOUND_ERROR, PR_GetError(), PR_GetOSError());
2303 --- pr/tests/semaerr1.c.orig 2015-10-16 13:22:19 UTC
2304 +++ pr/tests/semaerr1.c
2305 @@ -75,7 +75,7 @@ int main(int argc, char **argv)
2308 if (PR_GetError() != PR_FILE_EXISTS_ERROR) {
2309 - fprintf(stderr, "Expect %d but got %d\n", PR_FILE_EXISTS_ERROR,
2310 + fprintf(stderr, "Expected %ld (PR_FILE_EXISTS_ERROR) but got %d\n", PR_FILE_EXISTS_ERROR,
2314 --- pr/tests/sendzlf.c.orig 2015-10-16 13:22:19 UTC
2315 +++ pr/tests/sendzlf.c
2316 @@ -26,7 +26,7 @@ static void ClientThread(void *arg)
2320 - PRUint16 port = (PRUint16) arg;
2321 + PRUint16 port = (PRUint16)(uintptr_t)arg;
2325 @@ -184,7 +184,7 @@ int main(int argc, char **argv)
2328 clientThread = PR_CreateThread(PR_USER_THREAD,
2329 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
2330 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
2331 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
2332 if (NULL == clientThread) {
2333 fprintf(stderr, "PR_CreateThread failed\n");
2334 --- pr/tests/server_test.c.orig 2015-10-16 13:22:19 UTC
2335 +++ pr/tests/server_test.c
2336 @@ -60,7 +60,7 @@ PRCondVar *ServerStateCV;
2338 #define DPRINTF printf
2341 +#define DPRINTF(...)
2345 @@ -502,6 +502,7 @@ static void do_workUU(void)
2350 static void do_workUK(void)
2352 ServerScope = PR_LOCAL_THREAD;
2353 @@ -522,6 +523,7 @@ static void do_workKK(void)
2354 ClientScope = PR_GLOBAL_THREAD;
2360 static void Measure(void (*func)(void), const char *msg)
2361 --- pr/tests/servr_kk.c.orig 2015-10-16 13:22:19 UTC
2362 +++ pr/tests/servr_kk.c
2363 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2365 #define DPRINTF printf
2368 +#define DPRINTF(...)
2371 PRIntn failed_already=0;
2372 @@ -472,6 +472,7 @@ void do_work()
2373 PR_JoinThread(ServerThread);
2377 static void do_workUU(void)
2379 ServerScope = PR_LOCAL_THREAD;
2380 @@ -492,6 +493,7 @@ static void do_workKU(void)
2381 ClientScope = PR_LOCAL_THREAD;
2386 static void do_workKK(void)
2388 --- pr/tests/servr_ku.c.orig 2015-10-16 13:22:19 UTC
2389 +++ pr/tests/servr_ku.c
2390 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2392 #define DPRINTF printf
2395 +#define DPRINTF(...)
2398 PRIntn failed_already=0;
2399 --- pr/tests/servr_uk.c.orig 2015-10-16 13:22:19 UTC
2400 +++ pr/tests/servr_uk.c
2401 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2403 #define DPRINTF printf
2406 +#define DPRINTF(...)
2409 PRIntn failed_already=0;
2410 --- pr/tests/servr_uu.c.orig 2015-10-16 13:22:19 UTC
2411 +++ pr/tests/servr_uu.c
2412 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2414 #define DPRINTF printf
2417 +#define DPRINTF(...)
2420 PRIntn failed_already=0;
2421 --- pr/tests/short_thread.c.orig 2015-10-16 13:22:19 UTC
2422 +++ pr/tests/short_thread.c
2423 @@ -43,8 +43,8 @@ int main (int argc, char **argv)
2424 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0))
2427 - "simple_test: Error - PR_CreateThread failed: (%ld, %ld)\n",
2428 - PR_GetError(), PR_GetOSError());
2429 + "simple_test: Error - PR_CreateThread failed: (%d, %d)\n",
2430 + PR_GetError(), PR_GetOSError());
2434 --- pr/tests/socket.c.orig 2015-10-16 13:22:19 UTC
2435 +++ pr/tests/socket.c
2436 @@ -103,13 +103,15 @@ char *LARGE_FILE_NAME = "/tmp/prsocket_t
2439 static PRInt32 num_tcp_clients = NUM_TCP_CLIENTS;
2440 -static PRInt32 num_udp_clients = NUM_UDP_CLIENTS;
2441 static PRInt32 num_transmitfile_clients = NUM_TRANSMITFILE_CLIENTS;
2442 static PRInt32 num_tcp_connections_per_client = NUM_TCP_CONNECTIONS_PER_CLIENT;
2443 static PRInt32 tcp_mesg_size = TCP_MESG_SIZE;
2444 static PRInt32 num_tcp_mesgs_per_connection = NUM_TCP_MESGS_PER_CONNECTION;
2445 +#if defined(SYMBIAN) && !defined(__WINSCW__)
2446 +static PRInt32 num_udp_clients = NUM_UDP_CLIENTS;
2447 static PRInt32 num_udp_datagrams_per_client = NUM_UDP_DATAGRAMS_PER_CLIENT;
2448 static PRInt32 udp_datagram_size = UDP_DGRAM_SIZE;
2451 static PRInt32 thread_count;
2452 PRUint16 server_domain = PR_AF_INET, client_domain = PR_AF_INET;
2453 @@ -181,19 +183,23 @@ readn(PRFileDesc *sockfd, char *buf, int
2460 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
2463 timeout = PR_SecondsToInterval(2);
2465 for (rem=len; rem; offset += bytes, rem -= bytes) {
2466 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
2467 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
2468 PR_GetCurrentThread(), rem));
2472 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
2474 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
2475 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
2476 PR_GetCurrentThread(), bytes));
2479 @@ -224,11 +230,11 @@ writen(PRFileDesc *sockfd, char *buf, in
2482 for (rem=len; rem; offset += bytes, rem -= bytes) {
2483 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
2484 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
2485 PR_GetCurrentThread(), rem));
2486 bytes = PR_Send(sockfd, buf + offset, rem, 0,
2487 PR_INTERVAL_NO_TIMEOUT);
2488 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
2489 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
2490 PR_GetCurrentThread(), bytes));
2493 @@ -279,7 +285,7 @@ Serve_Client(void *arg)
2494 fprintf(stderr,"prsocket_test: ERROR - PR_Shutdown\n");
2497 - DPRINTF(("Serve_Client [0x%lx]: inbuf[0] = 0x%lx\n",PR_GetCurrentThread(),
2498 + DPRINTF(("Serve_Client [%p]: inbuf[0] = %d\n",PR_GetCurrentThread(),
2499 (*((int *) in_buf->data))));
2500 if (writen(sockfd, in_buf->data, bytes) < bytes) {
2501 fprintf(stderr,"prsocket_test: ERROR - Serve_Client:writen\n");
2502 @@ -418,7 +424,7 @@ TCP_Server(void *arg)
2506 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2507 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2508 netaddr.inet.ip, netaddr.inet.port));
2509 if (PR_SetNetAddr(PR_IpAddrLoopback, client_domain,
2510 PR_ntohs(PR_NetAddrInetPort(&netaddr)),
2511 @@ -460,7 +466,7 @@ TCP_Server(void *arg)
2512 scp->datalen = sp->datalen;
2514 t = create_new_thread(PR_USER_THREAD,
2515 - Serve_Client, (void *)scp,
2516 + Serve_Client, (void *)scp,
2519 PR_UNJOINABLE_THREAD,
2520 @@ -470,7 +476,7 @@ TCP_Server(void *arg)
2524 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", t));
2525 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", t));
2529 @@ -486,9 +492,10 @@ exit:
2530 --(*sp->exit_counter);
2531 PR_Notify(sp->exit_mon);
2532 PR_ExitMonitor(sp->exit_mon);
2533 - DPRINTF(("TCP_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2534 + DPRINTF(("TCP_Server [%p] exiting\n", PR_GetCurrentThread()));
2537 +#if defined(SYMBIAN) && !defined(__WINSCW__)
2541 @@ -544,7 +551,7 @@ UDP_Server(void *arg)
2545 - DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2546 + DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2547 netaddr.inet.ip, netaddr.inet.port));
2549 * We can't use the IP address returned by PR_GetSockName in
2550 @@ -582,13 +589,13 @@ UDP_Server(void *arg)
2552 memset(&netaddr, 0 , sizeof(netaddr));
2553 for (i = 0; i < (num_udp_clients * num_udp_datagrams_per_client); i++) {
2554 - DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
2555 + DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
2556 netaddr.inet.ip, netaddr.inet.port, bytes, in_buf->data,
2559 rv = PR_RecvFrom(sockfd, in_buf->data, bytes, 0, &netaddr,
2560 PR_INTERVAL_NO_TIMEOUT);
2561 - DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
2562 + DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
2563 netaddr.inet.ip, netaddr.inet.port, rv, in_buf->data,
2566 @@ -611,8 +618,9 @@ UDP_Server(void *arg)
2567 --(*sp->exit_counter);
2568 PR_Notify(sp->exit_mon);
2569 PR_ExitMonitor(sp->exit_mon);
2570 - DPRINTF(("UDP_Server [0x%x] exiting\n", PR_GetCurrentThread()));
2571 + DPRINTF(("UDP_Server [%p] exiting\n", PR_GetCurrentThread()));
2573 +#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */
2577 @@ -655,7 +663,7 @@ TCP_Client(void *arg)
2579 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0){
2580 fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
2581 - PR_GetError(), PR_GetOSError());
2582 + (long)PR_GetError(), (long)PR_GetOSError());
2586 @@ -663,7 +671,7 @@ TCP_Client(void *arg)
2588 * fill in random data
2590 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
2591 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
2595 @@ -676,7 +684,7 @@ TCP_Client(void *arg)
2599 - DPRINTF(("TCP Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
2600 + DPRINTF(("TCP Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
2601 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
2602 if (readn(sockfd, in_buf->data, bytes) < bytes) {
2603 fprintf(stderr,"prsocket_test: ERROR - TCP_Client:readn\n");
2604 @@ -716,13 +724,14 @@ TCP_Client(void *arg)
2605 --(*cp->exit_counter);
2606 PR_Notify(cp->exit_mon);
2607 PR_ExitMonitor(cp->exit_mon);
2608 - DPRINTF(("TCP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
2609 + DPRINTF(("TCP_Client [%p] exiting\n", PR_GetCurrentThread()));
2612 +#if defined(SYMBIAN) && !defined(__WINSCW__)
2616 - * Create a socket and bind an address
2617 + * Create a socket and bind an address
2618 * Communicate with the server at the address specified in the argument.
2619 * Fill in a buffer, write data to server, read it back and check
2620 * for data corruption.
2621 @@ -780,7 +789,7 @@ UDP_Client(void *arg)
2625 - DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2626 + DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2627 netaddr.inet.ip, netaddr.inet.port));
2629 netaddr = cp->server_addr;
2630 @@ -797,9 +806,9 @@ UDP_Client(void *arg)
2632 * fill in random data
2634 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx bytes = 0x%lx\n",
2635 + DPRINTF(("UDP_Client [%p]: out_buf = %p bytes = %d\n",
2636 PR_GetCurrentThread(), out_buf->data, bytes));
2637 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i, bytes);
2638 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i, bytes);
2642 @@ -812,7 +821,7 @@ UDP_Client(void *arg)
2646 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
2647 + DPRINTF(("UDP_Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
2648 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
2649 if (cp->udp_connect)
2650 rv = PR_Recv(sockfd, in_buf->data, bytes, 0,
2651 @@ -823,7 +832,7 @@ UDP_Client(void *arg)
2655 - DPRINTF(("UDP_Client [0x%lx]: in_buf = 0x%lx in_buf[0] = 0x%lx\n",
2656 + DPRINTF(("UDP_Client [%p]: in_buf = %p in_buf[0] = 0x%x\n",
2657 PR_GetCurrentThread(), in_buf, (*((int *) in_buf->data))));
2659 * verify the data read
2660 @@ -848,12 +857,13 @@ UDP_Client(void *arg)
2661 PR_Notify(cp->exit_mon);
2662 PR_ExitMonitor(cp->exit_mon);
2664 - DPRINTF(("UDP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
2665 + DPRINTF(("UDP_Client [%p] exiting\n", PR_GetCurrentThread()));
2667 +#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */
2670 * TCP_Socket_Client_Server_Test - concurrent server test
2673 * One server and several clients are started
2674 * Each client connects to the server and sends a chunk of data
2675 * For each connection, server starts another thread to read the data
2676 @@ -905,7 +915,7 @@ TCP_Socket_Client_Server_Test(void)
2677 sparamp->exit_counter = &thread_count;
2678 sparamp->datalen = datalen;
2679 t = PR_CreateThread(PR_USER_THREAD,
2680 - TCP_Server, (void *)sparamp,
2681 + TCP_Server, (void *)sparamp,
2684 PR_UNJOINABLE_THREAD,
2685 @@ -915,7 +925,7 @@ TCP_Socket_Client_Server_Test(void)
2689 - DPRINTF(("Created TCP server = 0x%lx\n", t));
2690 + DPRINTF(("Created TCP server = %p\n", t));
2694 @@ -949,7 +959,7 @@ TCP_Socket_Client_Server_Test(void)
2698 - DPRINTF(("Created TCP client = 0x%lx\n", t));
2699 + DPRINTF(("Created TCP client = %p\n", t));
2702 /* Wait for server and client threads to exit */
2703 @@ -959,17 +969,18 @@ TCP_Socket_Client_Server_Test(void)
2705 PR_ExitMonitor(mon2);
2706 printf("%30s","TCP_Socket_Client_Server_Test:");
2707 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
2708 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
2709 num_tcp_clients, num_tcp_connections_per_client);
2710 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
2711 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
2712 num_tcp_mesgs_per_connection, tcp_mesg_size);
2717 +#if defined(SYMBIAN) && !defined(__WINSCW__)
2719 * UDP_Socket_Client_Server_Test - iterative server test
2722 * One server and several clients are started
2723 * Each client connects to the server and sends a chunk of data
2724 * For each connection, server starts another thread to read the data
2725 @@ -1023,7 +1034,7 @@ UDP_Socket_Client_Server_Test(void)
2726 sparamp->datalen = datalen;
2727 DPRINTF(("Creating UDP server"));
2728 t = PR_CreateThread(PR_USER_THREAD,
2729 - UDP_Server, (void *)sparamp,
2730 + UDP_Server, (void *)sparamp,
2733 PR_UNJOINABLE_THREAD,
2734 @@ -1084,12 +1095,13 @@ UDP_Socket_Client_Server_Test(void)
2736 PR_ExitMonitor(mon2);
2737 printf("%30s","UDP_Socket_Client_Server_Test: ");
2738 - printf("%2ld Server %2ld Clients\n",1l, num_udp_clients);
2739 - printf("%30s %2ld datagrams_per_client %4ld bytes_per_datagram\n",":",
2740 + printf(" 1 Server %2d Clients\n", num_udp_clients);
2741 + printf("%30s %2d datagrams_per_client %4d bytes_per_datagram\n",":",
2742 num_udp_datagrams_per_client, udp_datagram_size);
2746 +#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */
2748 static PRFileDesc *small_file_fd, *large_file_fd;
2749 static void *small_file_addr, *small_file_header, *large_file_addr;
2750 @@ -1441,7 +1453,7 @@ TransmitFile_Client(void *arg)
2751 --(*cp->exit_counter);
2752 PR_Notify(cp->exit_mon);
2753 PR_ExitMonitor(cp->exit_mon);
2754 - DPRINTF(("TransmitFile_Client [0x%lx] exiting\n", PR_GetCurrentThread()));
2755 + DPRINTF(("TransmitFile_Client [%p] exiting\n", PR_GetCurrentThread()));
2759 @@ -1484,7 +1496,7 @@ Serve_TransmitFile_Client(void *arg)
2760 if (bytes != (SMALL_FILE_SIZE+ SMALL_FILE_HEADER_SIZE)) {
2762 "prsocet_test: PR_TransmitFile failed: (%ld, %ld)\n",
2763 - PR_GetError(), PR_GetOSError());
2764 + (long)PR_GetError(), (long)PR_GetOSError());
2767 bytes = PR_TransmitFile(sockfd, local_large_file_fd, NULL, 0,
2768 @@ -1492,7 +1504,7 @@ Serve_TransmitFile_Client(void *arg)
2769 if (bytes != LARGE_FILE_SIZE) {
2771 "prsocket_test: PR_TransmitFile failed: (%ld, %ld)\n",
2772 - PR_GetError(), PR_GetOSError());
2773 + (long)PR_GetError(), (long)PR_GetOSError());
2777 @@ -1520,7 +1532,7 @@ Serve_TransmitFile_Client(void *arg)
2780 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2781 - PR_GetError(), PR_GetOSError());
2782 + (long)PR_GetError(), (long)PR_GetOSError());
2786 @@ -1544,7 +1556,7 @@ Serve_TransmitFile_Client(void *arg)
2789 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2790 - PR_GetError(), PR_GetOSError());
2791 + (long)PR_GetError(), (long)PR_GetOSError());
2795 @@ -1566,7 +1578,7 @@ Serve_TransmitFile_Client(void *arg)
2798 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2799 - PR_GetError(), PR_GetOSError());
2800 + (long)PR_GetError(), (long)PR_GetOSError());
2804 @@ -1588,7 +1600,7 @@ Serve_TransmitFile_Client(void *arg)
2807 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2808 - PR_GetError(), PR_GetOSError());
2809 + (long)PR_GetError(), (long)PR_GetOSError());
2813 @@ -1610,7 +1622,7 @@ Serve_TransmitFile_Client(void *arg)
2816 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2817 - PR_GetError(), PR_GetOSError());
2818 + (long)PR_GetError(), (long)PR_GetOSError());
2822 @@ -1632,7 +1644,7 @@ Serve_TransmitFile_Client(void *arg)
2825 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2826 - PR_GetError(), PR_GetOSError());
2827 + (long)PR_GetError(), (long)PR_GetOSError());
2831 @@ -1654,7 +1666,7 @@ Serve_TransmitFile_Client(void *arg)
2834 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2835 - PR_GetError(), PR_GetOSError());
2836 + (long)PR_GetError(), (long)PR_GetOSError());
2840 @@ -1678,7 +1690,7 @@ Serve_TransmitFile_Client(void *arg)
2843 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2844 - PR_GetError(), PR_GetOSError());
2845 + (long)PR_GetError(), (long)PR_GetOSError());
2849 @@ -1752,7 +1764,7 @@ TransmitFile_Server(void *arg)
2853 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2854 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2855 netaddr.inet.ip, netaddr.inet.port));
2856 tcp_server_addr.inet.family = netaddr.inet.family;
2857 tcp_server_addr.inet.port = netaddr.inet.port;
2858 @@ -1807,7 +1819,7 @@ TransmitFile_Server(void *arg)
2859 scp->datalen = sp->datalen;
2861 t[i] = PR_CreateThread(PR_USER_THREAD,
2862 - Serve_TransmitFile_Client, (void *)scp,
2863 + Serve_TransmitFile_Client, (void *)scp,
2867 @@ -1818,7 +1830,7 @@ TransmitFile_Server(void *arg)
2871 - DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = 0x%lx\n", t));
2872 + DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = %p\n", t));
2876 @@ -1846,12 +1858,12 @@ exit:
2877 --(*sp->exit_counter);
2878 PR_Notify(sp->exit_mon);
2879 PR_ExitMonitor(sp->exit_mon);
2880 - DPRINTF(("TransmitFile_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2881 + DPRINTF(("TransmitFile_Server [%p] exiting\n", PR_GetCurrentThread()));
2885 - * Socket_Misc_Test - test miscellaneous functions
2887 + * Socket_Misc_Test - test miscellaneous functions
2891 Socket_Misc_Test(void)
2892 @@ -1986,7 +1998,7 @@ Socket_Misc_Test(void)
2894 "prsocket_test failed to write to file %s: (%ld, %ld)\n",
2896 - PR_GetError(), PR_GetOSError());
2897 + (long)PR_GetError(), (long)PR_GetOSError());
2901 @@ -2065,7 +2077,7 @@ Socket_Misc_Test(void)
2902 sparamp->exit_counter = &thread_count;
2903 sparamp->datalen = datalen;
2904 t = PR_CreateThread(PR_USER_THREAD,
2905 - TransmitFile_Server, (void *)sparamp,
2906 + TransmitFile_Server, (void *)sparamp,
2909 PR_UNJOINABLE_THREAD,
2910 @@ -2076,7 +2088,7 @@ Socket_Misc_Test(void)
2914 - DPRINTF(("Created TCP server = 0x%x\n", t));
2915 + DPRINTF(("Created TCP server = %p\n", t));
2919 @@ -2113,7 +2125,7 @@ Socket_Misc_Test(void)
2923 - DPRINTF(("Created TransmitFile client = 0x%lx\n", t));
2924 + DPRINTF(("Created TransmitFile client = %p\n", t));
2927 /* Wait for server and client threads to exit */
2928 @@ -2144,7 +2156,7 @@ done:
2930 if ((PR_RmDir(TEST_DIR)) == PR_FAILURE) {
2931 fprintf(stderr,"prsocket_test failed to rmdir %s: (%ld, %ld)\n",
2932 - TEST_DIR, PR_GetError(), PR_GetOSError());
2933 + TEST_DIR, (long)PR_GetError(), (long)PR_GetOSError());
2937 --- pr/tests/sprintf.c.orig 2015-10-16 13:22:19 UTC
2938 +++ pr/tests/sprintf.c
2939 @@ -127,7 +127,7 @@ static void test_l(char *pattern, char *
2940 (strncmp(s, sbuf, sizeof(sbuf)) != 0)) {
2942 "pattern='%s' l=%ld\nPR_smprintf='%s'\nPR_snprintf='%s'\n sprintf='%s'\n",
2943 - pattern, l, s, buf, sbuf);
2944 + pattern, (long)l, s, buf, sbuf);
2945 PR_smprintf_free(s);
2948 --- pr/tests/stack.c.orig 2015-10-16 13:22:19 UTC
2949 +++ pr/tests/stack.c
2950 @@ -54,7 +54,7 @@ PRFileDesc *errhandle;
2951 int main(int argc, char **argv)
2953 #if !(defined(SYMBIAN) && defined(__WINS__))
2954 - PRInt32 rv, cnt, sum;
2957 PRStack *list1, *list2;
2959 @@ -209,7 +209,7 @@ int main(int argc, char **argv)
2960 static void stackop(void *thread_arg)
2962 PRInt32 val, cnt, index, loops;
2963 - DataRecord *Items, *Item;
2964 + DataRecord *Items;
2965 PRStack *list1, *list2;
2967 stack_data *arg = (stack_data *) thread_arg;
2968 --- pr/tests/suspend.c.orig 2015-10-16 13:22:19 UTC
2969 +++ pr/tests/suspend.c
2970 @@ -30,14 +30,14 @@ void PR_CALLBACK
2971 Level_2_Thread(void *arg)
2973 PR_Sleep(PR_MillisecondsToInterval(4 * 1000));
2974 - printf("Level_2_Thread[0x%lx] exiting\n",PR_GetCurrentThread());
2975 + printf("Level_2_Thread[%p] exiting\n",PR_GetCurrentThread());
2980 Level_1_Thread(void *arg)
2982 - PRUint32 tmp = (PRUint32)arg;
2983 + PRUint32 tmp = (PRUint32)(uintptr_t)arg;
2984 PRThreadScope scope = (PRThreadScope) tmp;
2987 @@ -52,7 +52,7 @@ Level_1_Thread(void *arg)
2989 printf("Could not create thread!\n");
2991 - printf("Level_1_Thread[0x%lx] created %15s thread 0x%lx\n",
2992 + printf("Level_1_Thread[%p] created %15s thread %p\n",
2993 PR_GetCurrentThread(),
2994 (scope == PR_GLOBAL_THREAD) ?
2995 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
2996 @@ -63,7 +63,7 @@ Level_1_Thread(void *arg)
2999 PR_ExitMonitor(mon);
3000 - printf("Thread[0x%lx] exiting\n",PR_GetCurrentThread());
3001 + printf("Thread[%p] exiting\n",PR_GetCurrentThread());
3004 static PRStatus PR_CALLBACK print_thread(PRThread *thread, int i, void *arg)
3005 @@ -72,14 +72,15 @@ static PRStatus PR_CALLBACK print_thread
3009 - "\nprint_thread[0x%lx]: %-20s - i = %ld\n",thread,
3010 + "\nprint_thread[%p]: %-20s - i = %ld\n",thread,
3011 (PR_GLOBAL_THREAD == PR_GetThreadScope(thread)) ?
3012 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", i);
3013 registers = PR_GetGCRegisters(thread, 0, (int *)&words);
3015 - printf("Registers R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
3016 - registers[0],registers[1],registers[2],registers[3]);
3017 - printf("Stack Pointer = 0x%lx\n", PR_GetSP(thread));
3018 + printf("Regsters R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
3019 + (unsigned long)registers[0], (unsigned long)registers[1],
3020 + (unsigned long)registers[2], (unsigned long)registers[3]);
3021 + printf("Stack Pointer = %p\n", PR_GetSP(thread));
3025 @@ -107,7 +108,7 @@ static void Level_0_Thread(PRThreadScope
3026 printf("Could not create thread!\n");
3029 - printf("Level_0_Thread[0x%lx] created %15s thread 0x%lx\n",
3030 + printf("Level_0_Thread[%p] created %15s thread %p\n",
3031 PR_GetCurrentThread(),
3032 (scope1 == PR_GLOBAL_THREAD) ?
3033 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
3034 @@ -119,9 +120,10 @@ static void Level_0_Thread(PRThreadScope
3035 PR_EnumerateThreads(print_thread, NULL);
3036 registers = PR_GetGCRegisters(me, 1, (int *)&words);
3038 - printf("My Registers: R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
3039 - registers[0],registers[1],registers[2],registers[3]);
3040 - printf("My Stack Pointer = 0x%lx\n", PR_GetSP(me));
3041 + printf("My Registers: R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
3042 + (unsigned long)registers[0], (unsigned long)registers[1],
3043 + (unsigned long)registers[2], (unsigned long)registers[3]);
3044 + printf("My Stack Pointer = %p\n", PR_GetSP(me));
3047 /* Wait for all threads to exit */
3048 --- pr/tests/switch.c.orig 2015-10-16 13:22:19 UTC
3049 +++ pr/tests/switch.c
3050 @@ -80,7 +80,7 @@ PRIntn PR_CALLBACK Switch(PRIntn argc, c
3052 PRBool help = PR_FALSE;
3053 PRUintn concurrency = 1;
3054 - Shared *shared, *link;
3055 + Shared *shared = NULL, *link;
3056 PRIntervalTime timein, timeout;
3057 PRThreadScope thread_scope = PR_LOCAL_THREAD;
3058 PRUintn thread_count, inner_count, loop_count, average;
3059 --- pr/tests/testfile.c.orig 2015-10-16 13:22:19 UTC
3060 +++ pr/tests/testfile.c
3061 @@ -36,6 +36,9 @@ static int _debug_on = 0;
3065 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
3066 +# include <unistd.h> /* getopt(3) */
3069 #define DPRINTF(arg) if (_debug_on) printf arg
3071 @@ -93,7 +96,7 @@ static PRInt32 PR_CALLBACK DirTest(void
3072 PRInt32 dirtest_failed = 0;
3074 PRThread* create_new_thread(PRThreadType type,
3075 - void (*start)(void *arg),
3076 + void *(*start)(void *arg),
3078 PRThreadPriority priority,
3079 PRThreadScope scope,
3080 @@ -155,7 +158,7 @@ PRInt32 native_thread = 0;
3081 return((PRThread *) thandle);
3084 - return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3085 + return(PR_CreateThread(type,(void (*)(void*))start,arg,priority,scope,state,stackSize));
3088 return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3089 @@ -316,8 +319,8 @@ char tmpname[1024];
3091 "testfile PR_GetFileInfo returned incorrect status-change time: %s\n",
3093 - printf("ft = %lld, ft1 = %lld\n",file_info.creationTime,
3094 - file_info1.creationTime);
3095 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.creationTime,
3096 + (long long)file_info1.creationTime);
3100 @@ -342,8 +345,8 @@ char tmpname[1024];
3102 "testfile PR_GetFileInfo returned incorrect modify time: %s\n",
3104 - printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime,
3105 - file_info1.modifyTime);
3106 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.modifyTime,
3107 + (long long)file_info1.modifyTime);
3111 @@ -469,7 +472,7 @@ File_Rdwr_Param *fparamp;
3112 memset(fparamp->buf, i, len);
3114 t = create_new_thread(PR_USER_THREAD,
3115 - File_Write, (void *)fparamp,
3116 + (void *(*)(void *))File_Write, (void *)fparamp,
3119 PR_UNJOINABLE_THREAD,
3120 @@ -504,7 +507,7 @@ File_Rdwr_Param *fparamp;
3123 t = create_new_thread(PR_USER_THREAD,
3124 - File_Read, (void *)fparamp,
3125 + (void *(*)(void *))File_Read, (void *)fparamp,
3128 PR_UNJOINABLE_THREAD,
3129 @@ -572,7 +575,7 @@ struct dirtest_arg thrarg;
3132 t = create_new_thread(PR_USER_THREAD,
3134 + (void *(*)(void *))DirTest, &thrarg,
3137 PR_UNJOINABLE_THREAD,
3138 @@ -895,8 +898,6 @@ int main(int argc, char **argv)
3140 #if defined(XP_UNIX) || defined(XP_OS2)
3142 - extern char *optarg;
3143 - extern int optind;
3145 #if defined(XP_UNIX) || defined(XP_OS2)
3146 while ((opt = getopt(argc, argv, "d")) != EOF) {
3147 --- pr/tests/threads.c.orig 2015-10-16 13:22:19 UTC
3148 +++ pr/tests/threads.c
3149 @@ -27,7 +27,7 @@ void
3151 DumbThread(void *arg)
3153 - PRInt32 tmp = (PRInt32)arg;
3154 + PRInt32 tmp = (PRInt32)(intptr_t)arg;
3155 PRThreadScope scope = (PRThreadScope)tmp;
3158 @@ -167,10 +167,10 @@ int main(int argc, char **argv)
3163 -** Tests lots of thread creations. \n\
3164 -** Create %ld native threads %ld times. \n\
3165 -** Create %ld user threads %ld times \n", iterations,count,iterations,count);
3166 + printf("** Tests lots of thread creations.\n"
3167 + "** Create %d native threads %d times.\n"
3168 + "** Create %d user threads %d times.\n", iterations, count,
3169 + iterations, count);
3172 for (index=0; index<iterations; index++) {
3173 --- pr/tests/thrpool_client.c.orig 2015-10-16 13:22:19 UTC
3174 +++ pr/tests/thrpool_client.c
3175 @@ -82,11 +82,11 @@ readn(PRFileDesc *sockfd, char *buf, int
3176 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
3178 for (rem=len; rem; offset += bytes, rem -= bytes) {
3179 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
3180 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
3181 PR_GetCurrentThread(), rem));
3182 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
3184 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
3185 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
3186 PR_GetCurrentThread(), bytes));
3189 @@ -107,11 +107,11 @@ writen(PRFileDesc *sockfd, char *buf, in
3192 for (rem=len; rem; offset += bytes, rem -= bytes) {
3193 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
3194 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
3195 PR_GetCurrentThread(), rem));
3196 bytes = PR_Send(sockfd, buf + offset, rem, 0,
3197 PR_INTERVAL_NO_TIMEOUT);
3198 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
3199 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
3200 PR_GetCurrentThread(), bytes));
3203 @@ -164,7 +164,7 @@ TCP_Client(void *arg)
3205 DPRINTF(("TCP client connecting to server:%d\n", server_port));
3206 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0){
3207 - fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
3208 + fprintf(stderr, "PR_Connect failed: (%d, %d)\n",
3209 PR_GetError(), PR_GetOSError());
3212 @@ -173,7 +173,7 @@ TCP_Client(void *arg)
3214 * fill in random data
3216 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
3217 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
3221 @@ -281,7 +281,7 @@ TCP_Socket_Client_Server_Test(void)
3222 PR_EnterMonitor(mon2);
3224 PR_ExitMonitor(mon2);
3225 - DPRINTF(("Created TCP client = 0x%lx\n", thr));
3226 + DPRINTF(("Created TCP client = %p\n", thr));
3228 /* Wait for client jobs to exit */
3229 PR_EnterMonitor(mon2);
3230 @@ -291,9 +291,9 @@ TCP_Socket_Client_Server_Test(void)
3232 PR_ExitMonitor(mon2);
3233 printf("%30s","TCP_Socket_Client_Server_Test:");
3234 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3235 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3236 num_tcp_clients, num_tcp_connections_per_client);
3237 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3238 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3239 num_tcp_mesgs_per_connection, tcp_mesg_size);
3242 --- pr/tests/thrpool_server.c.orig 2015-10-16 13:22:19 UTC
3243 +++ pr/tests/thrpool_server.c
3244 @@ -329,7 +329,7 @@ TCP_Server(void *arg)
3248 - "TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3249 + "TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3250 netaddr.inet.ip, netaddr.inet.port));
3252 sp = PR_NEW(Server_Param);
3253 @@ -341,7 +341,7 @@ TCP_Server(void *arg)
3254 sp->iod.socket = sockfd;
3255 sp->iod.timeout = PR_SecondsToInterval(60);
3256 sp->datalen = tcp_mesg_size;
3257 - sp->exit_mon = sc_mon;
3258 + sp->exit_mon = NULL;
3259 sp->job_counterp = &job_counter;
3260 sp->conn_counter = 0;
3262 @@ -464,7 +464,7 @@ TCP_Server_Accept(void *arg)
3265 PR_ASSERT(NULL != jobp);
3266 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", jobp));
3267 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", jobp));
3270 * single-threaded update; no lock needed
3271 @@ -481,7 +481,7 @@ TCP_Server_Accept(void *arg)
3272 print_stats, sp, PR_FALSE);
3274 PR_ASSERT(NULL != jobp);
3275 - DPRINTF(("TCP_Server: Created print_stats timer job = 0x%lx\n", jobp));
3276 + DPRINTF(("TCP_Server: Created print_stats timer job = %p\n", jobp));
3279 PR_EnterMonitor(sp->exit_mon);
3280 @@ -498,9 +498,9 @@ exit:
3282 PR_DestroyMonitor(sp->exit_mon);
3283 printf("%30s","TCP_Socket_Client_Server_Test:");
3284 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3285 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3286 num_tcp_clients, num_tcp_connections_per_client);
3287 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3288 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3289 num_tcp_mesgs_per_connection, tcp_mesg_size);
3291 DPRINTF(("%s: calling PR_ShutdownThreadPool\n", program_name));
3292 --- pr/tests/thruput.c.orig 2015-10-16 13:22:19 UTC
3293 +++ pr/tests/thruput.c
3294 @@ -66,7 +66,7 @@ static void PR_CALLBACK Clientel(void *a
3298 - PRInt32 bytes, sampled;
3299 + PRInt32 bytes, sampled = -1;
3300 PRIntervalTime now, interval;
3301 PRBool do_display = PR_FALSE;
3302 Shared *shared = (Shared*)arg;
3303 @@ -175,7 +175,7 @@ static void Client(const char *server_na
3305 static void PR_CALLBACK Servette(void *arg)
3307 - PRInt32 bytes, sampled;
3308 + PRInt32 bytes, sampled = -1;
3309 PRIntervalTime now, interval;
3310 PRBool do_display = PR_FALSE;
3311 PRFileDesc *client = (PRFileDesc*)arg;
3312 @@ -373,6 +373,7 @@ int main(int argc, char **argv)
3313 else Client(server_name);
3320 --- pr/tests/timemac.c.orig 2015-10-16 13:22:19 UTC
3321 +++ pr/tests/timemac.c
3322 @@ -24,7 +24,7 @@ static void printExplodedTime(const PREx
3325 /* Print day of the week, month, day, hour, minute, and second */
3326 - printf( "%s %s %ld %02ld:%02ld:%02ld ",
3327 + printf( "%s %s %d %02d:%02d:%02d ",
3328 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3329 et->tm_hour, et->tm_min, et->tm_sec);
3331 @@ -40,7 +40,7 @@ static void printExplodedTime(const PREx
3333 hourOffset = totalOffset / 3600;
3334 minOffset = (totalOffset % 3600) / 60;
3335 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3336 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3340 @@ -97,7 +97,7 @@ int main(int argc, char** argv)
3341 printf("Current local time is ");
3342 printExplodedTime(&et);
3344 - printf("GMT offset is %ld, DST offset is %ld\n",
3345 + printf("GMT offset is %d, DST offset is %d\n",
3346 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3347 t2 = PR_ImplodeTime(&et);
3348 if (LL_NE(t1, t2)) {
3349 --- pr/tests/timetest.c.orig 2015-10-16 13:22:19 UTC
3350 +++ pr/tests/timetest.c
3351 @@ -36,7 +36,7 @@ static void PrintExplodedTime(const PREx
3354 /* Print day of the week, month, day, hour, minute, and second */
3355 - if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
3356 + if (debug_mode) printf("%s %s %d %02d:%02d:%02d ",
3357 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3358 et->tm_hour, et->tm_min, et->tm_sec);
3360 @@ -53,7 +53,7 @@ static void PrintExplodedTime(const PREx
3361 hourOffset = totalOffset / 3600;
3362 minOffset = (totalOffset % 3600) / 60;
3364 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3365 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3369 @@ -232,7 +232,7 @@ int main(int argc, char** argv)
3370 if (debug_mode) printf("Current local time is ");
3371 PrintExplodedTime(&et);
3372 if (debug_mode) printf("\n");
3373 - if (debug_mode) printf("GMT offset is %ld, DST offset is %ld\n",
3374 + if (debug_mode) printf("GMT offset is %d, DST offset is %d\n",
3375 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3376 t2 = PR_ImplodeTime(&et);
3377 if (LL_NE(t1, t2)) {
3378 --- pr/tests/y2k.c.orig 2015-10-16 13:22:19 UTC
3380 @@ -43,7 +43,7 @@ static void PrintExplodedTime(const PREx
3383 /* Print day of the week, month, day, hour, minute, and second */
3384 - printf("%s %s %2ld %02ld:%02ld:%02ld ",
3385 + printf("%s %s %2d %02d:%02d:%02d ",
3386 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3387 et->tm_hour, et->tm_min, et->tm_sec);
3389 @@ -62,7 +62,7 @@ static void PrintExplodedTime(const PREx
3391 hourOffset = totalOffset / 3600;
3392 minOffset = (totalOffset % 3600) / 60;
3393 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3394 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3396 #ifdef PRINT_DETAILS
3397 printf("{%d, %d, %d, %d, %d, %d, %d, %d, %d, { %d, %d}}\n",et->tm_usec,
3398 --- pr/tests/y2ktmo.c.orig 2015-10-16 13:22:19 UTC
3399 +++ pr/tests/y2ktmo.c
3400 @@ -70,7 +70,7 @@ static struct _timeb start_time_tb;
3402 static void SleepThread(void *arg)
3404 - PRIntervalTime timeout = (PRIntervalTime) arg;
3405 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3406 PRIntervalTime elapsed;
3407 #if defined(XP_UNIX) || defined(WIN32)
3408 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3409 @@ -121,7 +121,7 @@ static void SleepThread(void *arg)
3411 static void AcceptThread(void *arg)
3413 - PRIntervalTime timeout = (PRIntervalTime) arg;
3414 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3415 PRIntervalTime elapsed;
3416 #if defined(XP_UNIX) || defined(WIN32)
3417 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3418 @@ -197,7 +197,7 @@ static void AcceptThread(void *arg)
3420 static void PollThread(void *arg)
3422 - PRIntervalTime timeout = (PRIntervalTime) arg;
3423 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3424 PRIntervalTime elapsed;
3425 #if defined(XP_UNIX) || defined(WIN32)
3426 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3427 @@ -276,7 +276,7 @@ static void PollThread(void *arg)
3429 static void WaitCondVarThread(void *arg)
3431 - PRIntervalTime timeout = (PRIntervalTime) arg;
3432 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3433 PRIntervalTime elapsed;
3434 #if defined(XP_UNIX) || defined(WIN32)
3435 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3436 @@ -340,7 +340,7 @@ static void WaitCondVarThread(void *arg)
3438 static void WaitMonitorThread(void *arg)
3440 - PRIntervalTime timeout = (PRIntervalTime) arg;
3441 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3442 PRIntervalTime elapsed;
3443 #if defined(XP_UNIX) || defined(WIN32)
3444 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3445 @@ -397,7 +397,7 @@ static void WaitMonitorThread(void *arg)
3447 static void WaitCMonitorThread(void *arg)
3449 - PRIntervalTime timeout = (PRIntervalTime) arg;
3450 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3451 PRIntervalTime elapsed;
3452 #if defined(XP_UNIX) || defined(WIN32)
3453 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3454 @@ -528,7 +528,7 @@ int main(int argc, char **argv)
3455 for (i = 0; i < num_thread_scopes; i++) {
3456 for (j = 0; j < num_thread_funcs; j++) {
3457 threads[idx] = PR_CreateThread(PR_USER_THREAD, threadFuncs[j],
3458 - (void*)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3459 + (void*)(intptr_t)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3460 threadScopes[i], PR_JOINABLE_THREAD, 0);
3461 if (threads[idx] == NULL) {
3462 fprintf(stderr, "PR_CreateThread failed\n");
3463 --- pr/tests/zerolen.c.orig 2015-10-16 13:22:19 UTC
3464 +++ pr/tests/zerolen.c
3465 @@ -45,7 +45,7 @@ static void ClientThread(void *arg)
3469 - PRUint16 port = (PRUint16) arg;
3470 + PRUint16 port = (PRUint16)(uintptr_t)arg;
3474 @@ -127,7 +127,7 @@ int main()
3475 * First test PR_Writev.
3477 clientThread = PR_CreateThread(PR_USER_THREAD,
3478 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3479 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3480 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3481 if (NULL == clientThread) {
3482 fprintf(stderr, "PR_CreateThread failed\n");
3483 @@ -171,7 +171,7 @@ int main()
3484 * Then test PR_Write.
3486 clientThread = PR_CreateThread(PR_USER_THREAD,
3487 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3488 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3489 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3490 if (NULL == clientThread) {
3491 fprintf(stderr, "PR_CreateThread failed\n");
3492 @@ -216,7 +216,7 @@ int main()
3493 * Finally test PR_Send.
3495 clientThread = PR_CreateThread(PR_USER_THREAD,
3496 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3497 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3498 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3499 if (NULL == clientThread) {
3500 fprintf(stderr, "PR_CreateThread failed\n");
3503 [FILE:2133:patches/patch-warnings]
3504 --- pr/include/prcountr.h.orig 2015-10-16 13:22:19 UTC
3505 +++ pr/include/prcountr.h
3506 @@ -394,7 +394,7 @@ NSPR_API(void)
3507 #define PR_GET_COUNTER(counter,handle)\
3508 (counter) = PR_GetCounter((handle))
3510 -#define PR_GET_COUNTER(counter,handle) 0
3511 +#define PR_GET_COUNTER(counter,handle)
3515 @@ -468,7 +468,7 @@ NSPR_API(void)
3516 #define PR_FIND_NEXT_COUNTER_QNAME(next,handle)\
3517 (next) = PR_FindNextCounterQname((handle))
3519 -#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
3520 +#define PR_FIND_NEXT_COUNTER_QNAME(next,handle)
3523 NSPR_API(PRCounterHandle)
3524 --- pr/src/misc/pralarm.c.orig 2015-10-16 13:22:19 UTC
3525 +++ pr/src/misc/pralarm.c
3526 @@ -101,7 +101,7 @@ static void PR_CALLBACK pr_alarmNotifier
3528 while (why != abort)
3530 - PRIntervalTime pause;
3531 + PRIntervalTime pause = 0;
3533 PR_Lock(alarm->lock);
3535 --- pr/src/misc/prdtoa.c.orig 2015-10-16 13:22:19 UTC
3536 +++ pr/src/misc/prdtoa.c
3537 @@ -2751,7 +2751,7 @@ dtoa
3538 to hold the suppressed trailing zeros.
3541 - int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
3542 + int bbits, b2, b5, be, dig, i, ieps, ilim = -1, ilim0, ilim1 = -1,
3543 j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3544 spec_case, try_quick;
3546 --- pr/src/pthreads/ptio.c.orig 2015-10-16 13:22:19 UTC
3547 +++ pr/src/pthreads/ptio.c
3548 @@ -4934,6 +4934,7 @@ PR_IMPLEMENT(PRInt32) PR_Select(
3550 if (timeout == PR_INTERVAL_NO_TIMEOUT) {
3552 + start = 0; /* Not needed, but shuts down a warning */
3554 tv.tv_sec = (PRInt32)PR_IntervalToSeconds(timeout);
3555 tv.tv_usec = (PRInt32)PR_IntervalToMicroseconds(
3556 --- pr/src/pthreads/ptsynch.c.orig 2015-10-16 13:22:19 UTC
3557 +++ pr/src/pthreads/ptsynch.c
3558 @@ -30,7 +30,7 @@ static pthread_t pt_zero_tid; /* a null
3559 #endif /* defined(_PR_DCETHREADS) */
3560 #endif /* defined(DEBUG) */
3562 -#if defined(FREEBSD)
3563 +#if defined(FREEBSD) && (defined(DEBUG) || defined(FORCE_PR_ASSERT))
3565 * On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
3566 * Newer versions return EBUSY. We still need to support both.
3569 [FILE:1620:dragonfly/patch-nsprpub_configure]
3570 --- configure.intermediate 2015-11-29 10:31:49 UTC
3572 @@ -6661,6 +6661,27 @@ tools are selected during the Xcode/Deve
3577 + if test -z "$USE_NSPR_THREADS"; then
3580 + $as_echo "#define XP_UNIX 1" >>confdefs.h
3582 + $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
3584 + $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
3586 + CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
3590 + MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
3592 + DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
3593 + MDCPUCFG_H=_dragonfly.cfg
3594 + PR_MD_CSRCS=freebsd.c
3598 if test -z "$USE_NSPR_THREADS"; then
3600 @@ -8284,7 +8305,7 @@ $as_echo_n "checking whether ${CC-cc} ac
3601 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3602 ac_cv_have_dash_pthread=yes
3603 case "$target_os" in
3605 + freebsd*|dragonfly*)
3606 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3609 @@ -8322,7 +8343,7 @@ $as_echo "$ac_cv_have_dash_pthreads" >&6
3614 + *-freebsd*|*-dragonfly*)
3615 $as_echo "#define _REENTRANT 1" >>confdefs.h
3617 $as_echo "#define _THREAD_SAFE 1" >>confdefs.h
3618 @@ -8410,7 +8431,7 @@ case "$target" in
3623 +*-freebsd*|*dragonfly*)
3624 if test -n "$USE_NSPR_THREADS"; then
3625 $as_echo "#define _PR_LOCAL_THREADS_ONLY 1" >>confdefs.h
3629 [FILE:6239:dragonfly/patch-nsprpub_pr_include_md___dragonfly.cfg]
3630 --- pr/include/md/_dragonfly.cfg.orig 2013-06-06 16:24:16.620788000 +0000
3631 +++ pr/include/md/_dragonfly.cfg
3633 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3634 +/* This Source Code Form is subject to the terms of the Mozilla Public
3635 + * License, v. 2.0. If a copy of the MPL was not distributed with this
3636 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
3638 +#ifndef nspr_cpucfg___
3639 +#define nspr_cpucfg___
3645 +#define PR_AF_INET6 28 /* same as AF_INET6 */
3647 +#ifndef HAVE_LONG_LONG
3648 +#define HAVE_LONG_LONG
3651 +#if defined(__i386__)
3653 +#define IS_LITTLE_ENDIAN 1
3654 +#undef IS_BIG_ENDIAN
3655 +#undef HAVE_ALIGNED_DOUBLES
3656 +#undef HAVE_ALIGNED_LONGLONGS
3658 +#define PR_BYTES_PER_BYTE 1
3659 +#define PR_BYTES_PER_SHORT 2
3660 +#define PR_BYTES_PER_INT 4
3661 +#define PR_BYTES_PER_INT64 8
3662 +#define PR_BYTES_PER_LONG 4
3663 +#define PR_BYTES_PER_FLOAT 4
3664 +#define PR_BYTES_PER_DOUBLE 8
3665 +#define PR_BYTES_PER_WORD 4
3666 +#define PR_BYTES_PER_DWORD 8
3667 +#define PR_BYTES_PER_WORD_LOG2 2
3668 +#define PR_BYTES_PER_DWORD_LOG2 3
3670 +#define PR_BITS_PER_BYTE 8
3671 +#define PR_BITS_PER_SHORT 16
3672 +#define PR_BITS_PER_INT 32
3673 +#define PR_BITS_PER_INT64 64
3674 +#define PR_BITS_PER_LONG 32
3675 +#define PR_BITS_PER_FLOAT 32
3676 +#define PR_BITS_PER_DOUBLE 64
3677 +#define PR_BITS_PER_WORD 32
3679 +#define PR_BITS_PER_BYTE_LOG2 3
3680 +#define PR_BITS_PER_SHORT_LOG2 4
3681 +#define PR_BITS_PER_INT_LOG2 5
3682 +#define PR_BITS_PER_INT64_LOG2 6
3683 +#define PR_BITS_PER_LONG_LOG2 5
3684 +#define PR_BITS_PER_FLOAT_LOG2 5
3685 +#define PR_BITS_PER_DOUBLE_LOG2 6
3686 +#define PR_BITS_PER_WORD_LOG2 5
3688 +#define PR_ALIGN_OF_SHORT 2
3689 +#define PR_ALIGN_OF_INT 4
3690 +#define PR_ALIGN_OF_LONG 4
3691 +#define PR_ALIGN_OF_INT64 4
3692 +#define PR_ALIGN_OF_FLOAT 4
3693 +#define PR_ALIGN_OF_DOUBLE 4
3694 +#define PR_ALIGN_OF_POINTER 4
3696 +#elif defined(__alpha__)
3698 +#define IS_LITTLE_ENDIAN 1
3699 +#undef IS_BIG_ENDIAN
3700 +#define HAVE_ALIGNED_DOUBLES
3701 +#define HAVE_ALIGNED_LONGLONGS
3704 +#define PR_BYTES_PER_BYTE 1
3705 +#define PR_BYTES_PER_SHORT 2
3706 +#define PR_BYTES_PER_INT 4
3707 +#define PR_BYTES_PER_INT64 8
3708 +#define PR_BYTES_PER_LONG 8
3709 +#define PR_BYTES_PER_FLOAT 4
3710 +#define PR_BYTES_PER_DOUBLE 8
3711 +#define PR_BYTES_PER_WORD 8
3712 +#define PR_BYTES_PER_DWORD 8
3713 +#define PR_BYTES_PER_WORD_LOG2 3
3714 +#define PR_BYTES_PER_DWORD_LOG2 3
3716 +#define PR_BITS_PER_BYTE 8
3717 +#define PR_BITS_PER_SHORT 16
3718 +#define PR_BITS_PER_INT 32
3719 +#define PR_BITS_PER_INT64 64
3720 +#define PR_BITS_PER_LONG 64
3721 +#define PR_BITS_PER_FLOAT 32
3722 +#define PR_BITS_PER_DOUBLE 64
3723 +#define PR_BITS_PER_WORD 64
3725 +#define PR_BITS_PER_BYTE_LOG2 3
3726 +#define PR_BITS_PER_SHORT_LOG2 4
3727 +#define PR_BITS_PER_INT_LOG2 5
3728 +#define PR_BITS_PER_INT64_LOG2 6
3729 +#define PR_BITS_PER_LONG_LOG2 6
3730 +#define PR_BITS_PER_FLOAT_LOG2 5
3731 +#define PR_BITS_PER_DOUBLE_LOG2 6
3732 +#define PR_BITS_PER_WORD_LOG2 6
3734 +#define PR_ALIGN_OF_SHORT 2
3735 +#define PR_ALIGN_OF_INT 4
3736 +#define PR_ALIGN_OF_LONG 8
3737 +#define PR_ALIGN_OF_INT64 8
3738 +#define PR_ALIGN_OF_FLOAT 4
3739 +#define PR_ALIGN_OF_DOUBLE 8
3740 +#define PR_ALIGN_OF_POINTER 8
3742 +#elif defined(__amd64__)
3744 +#define IS_LITTLE_ENDIAN 1
3745 +#undef IS_BIG_ENDIAN
3746 +#define HAVE_ALIGNED_DOUBLES
3747 +#define HAVE_ALIGNED_LONGLONGS
3750 +#define PR_BYTES_PER_BYTE 1
3751 +#define PR_BYTES_PER_SHORT 2
3752 +#define PR_BYTES_PER_INT 4
3753 +#define PR_BYTES_PER_INT64 8
3754 +#define PR_BYTES_PER_LONG 8
3755 +#define PR_BYTES_PER_FLOAT 4
3756 +#define PR_BYTES_PER_DOUBLE 8
3757 +#define PR_BYTES_PER_WORD 8
3758 +#define PR_BYTES_PER_DWORD 8
3759 +#define PR_BYTES_PER_WORD_LOG2 3
3760 +#define PR_BYTES_PER_DWORD_LOG2 3
3762 +#define PR_BITS_PER_BYTE 8
3763 +#define PR_BITS_PER_SHORT 16
3764 +#define PR_BITS_PER_INT 32
3765 +#define PR_BITS_PER_INT64 64
3766 +#define PR_BITS_PER_LONG 64
3767 +#define PR_BITS_PER_FLOAT 32
3768 +#define PR_BITS_PER_DOUBLE 64
3769 +#define PR_BITS_PER_WORD 64
3771 +#define PR_BITS_PER_BYTE_LOG2 3
3772 +#define PR_BITS_PER_SHORT_LOG2 4
3773 +#define PR_BITS_PER_INT_LOG2 5
3774 +#define PR_BITS_PER_INT64_LOG2 6
3775 +#define PR_BITS_PER_LONG_LOG2 6
3776 +#define PR_BITS_PER_FLOAT_LOG2 5
3777 +#define PR_BITS_PER_DOUBLE_LOG2 6
3778 +#define PR_BITS_PER_WORD_LOG2 6
3780 +#define PR_ALIGN_OF_SHORT 2
3781 +#define PR_ALIGN_OF_INT 4
3782 +#define PR_ALIGN_OF_LONG 8
3783 +#define PR_ALIGN_OF_INT64 8
3784 +#define PR_ALIGN_OF_FLOAT 4
3785 +#define PR_ALIGN_OF_DOUBLE 8
3786 +#define PR_ALIGN_OF_POINTER 8
3787 +#define PR_ALIGN_OF_WORD 8
3791 +#error "Unknown CPU architecture"
3795 +#ifndef NO_NSPR_10_SUPPORT
3797 +#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
3798 +#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
3799 +#define BYTES_PER_INT PR_BYTES_PER_INT
3800 +#define BYTES_PER_INT64 PR_BYTES_PER_INT64
3801 +#define BYTES_PER_LONG PR_BYTES_PER_LONG
3802 +#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
3803 +#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
3804 +#define BYTES_PER_WORD PR_BYTES_PER_WORD
3805 +#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
3807 +#define BITS_PER_BYTE PR_BITS_PER_BYTE
3808 +#define BITS_PER_SHORT PR_BITS_PER_SHORT
3809 +#define BITS_PER_INT PR_BITS_PER_INT
3810 +#define BITS_PER_INT64 PR_BITS_PER_INT64
3811 +#define BITS_PER_LONG PR_BITS_PER_LONG
3812 +#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
3813 +#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
3814 +#define BITS_PER_WORD PR_BITS_PER_WORD
3816 +#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
3817 +#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
3818 +#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
3819 +#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
3820 +#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
3821 +#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
3822 +#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
3823 +#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
3825 +#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
3826 +#define ALIGN_OF_INT PR_ALIGN_OF_INT
3827 +#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
3828 +#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
3829 +#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
3830 +#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
3831 +#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
3832 +#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
3834 +#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
3835 +#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
3836 +#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
3838 +#endif /* NO_NSPR_10_SUPPORT */
3840 +#endif /* nspr_cpucfg___ */
3843 [FILE:6235:dragonfly/patch-nsprpub_pr_include_md___dragonfly.h]
3844 --- pr/include/md/_dragonfly.h.orig 2013-06-06 18:49:02.829118000 +0000
3845 +++ pr/include/md/_dragonfly.h
3847 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3848 +/* This Source Code Form is subject to the terms of the Mozilla Public
3849 + * License, v. 2.0. If a copy of the MPL was not distributed with this
3850 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
3852 +#ifndef nspr_dragonfly_defs_h___
3853 +#define nspr_dragonfly_defs_h___
3855 +#include "prthread.h"
3858 +#if __FreeBSD__ >= 2
3859 +#include <osreldate.h> /* for __FreeBSD_version */
3861 +#include <sys/syscall.h>
3864 +#define PR_LINKER_ARCH "dragonfly"
3865 +#define _PR_SI_SYSNAME "DRAGONFLY"
3866 +#if defined(__i386__)
3867 +#define _PR_SI_ARCHITECTURE "x86"
3868 +#elif defined(__amd64__)
3869 +#define _PR_SI_ARCHITECTURE "amd64"
3871 +#error "Unknown CPU architecture"
3874 +#define PR_DLL_SUFFIX ".so"
3876 +#define _PR_VMBASE 0x30000000
3877 +#define _PR_STACK_VMBASE 0x50000000
3878 +#define _MD_DEFAULT_STACK_SIZE 65536L
3879 +#define _MD_MMAP_FLAGS MAP_PRIVATE
3881 +#undef HAVE_STACK_GROWING_UP
3884 +#define _PR_HAVE_SOCKADDR_LEN
3885 +#define _PR_STAT_HAS_ST_ATIMESPEC
3886 +#define _PR_HAVE_LARGE_OFF_T
3888 +#define _PR_HAVE_GETPROTO_R
3889 +#define _PR_HAVE_5_ARG_GETPROTO_R
3890 +#define _PR_HAVE_GETHOST_R
3891 +#define _PR_HAVE_GETHOST_R_INT
3893 +#define _PR_POLL_AVAILABLE
3895 +#define _PR_HAVE_SYSV_SEMAPHORES
3896 +#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
3899 +#define _PR_HAVE_INET_NTOP
3900 +#define _PR_HAVE_GETHOSTBYNAME2
3901 +#define _PR_HAVE_GETADDRINFO
3902 +#define _PR_INET6_PROBE
3903 +#define _PR_IPV6_V6ONLY_PROBE
3907 +#ifndef _PR_PTHREADS
3908 +#include <setjmp.h>
3910 +#define PR_CONTEXT_TYPE sigjmp_buf
3912 +#define CONTEXT(_th) ((_th)->md.context)
3914 +#define _MD_GET_SP(_th) (_th)->md.context[0]._sjb[2]
3915 +#define PR_NUM_GCREGS _JBLEN
3918 +** Initialize a thread context to run "_main()" when started
3920 +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
3922 + *status = PR_TRUE; \
3923 + if (sigsetjmp(CONTEXT(_thread), 1)) { \
3926 + _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
3929 +#define _MD_SWITCH_CONTEXT(_thread) \
3930 + if (!sigsetjmp(CONTEXT(_thread), 1)) { \
3931 + (_thread)->md.errcode = errno; \
3936 +** Restore a thread context, saved by _MD_SWITCH_CONTEXT
3938 +#define _MD_RESTORE_CONTEXT(_thread) \
3940 + errno = (_thread)->md.errcode; \
3941 + _MD_SET_CURRENT_THREAD(_thread); \
3942 + siglongjmp(CONTEXT(_thread), 1); \
3945 +/* Machine-dependent (MD) data structures */
3948 + PR_CONTEXT_TYPE context;
3953 +struct _MDThreadStack {
3961 +struct _MDSemaphore {
3969 +struct _MDSegment {
3974 + * md-specific cpu structure field
3976 +#define _PR_MD_MAX_OSFD FD_SETSIZE
3978 +struct _MDCPU_Unix {
3980 + PRUint32 ioq_timeout;
3981 + PRInt32 ioq_max_osfd;
3982 + PRInt32 ioq_osfd_cnt;
3983 +#ifndef _PR_USE_POLL
3984 + fd_set fd_read_set, fd_write_set, fd_exception_set;
3985 + PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
3986 + fd_exception_cnt[_PR_MD_MAX_OSFD];
3988 + struct pollfd *ioq_pollfds;
3989 + int ioq_pollfds_size;
3990 +#endif /* _PR_USE_POLL */
3993 +#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
3994 +#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
3995 +#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
3996 +#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
3997 +#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
3998 +#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
3999 +#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
4000 +#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
4001 +#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
4002 +#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
4003 +#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
4004 +#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
4005 +#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
4007 +#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
4010 + struct _MDCPU_Unix md_unix;
4013 +#define _MD_INIT_LOCKS()
4014 +#define _MD_NEW_LOCK(lock) PR_SUCCESS
4015 +#define _MD_FREE_LOCK(lock)
4016 +#define _MD_LOCK(lock)
4017 +#define _MD_UNLOCK(lock)
4018 +#define _MD_INIT_IO()
4019 +#define _MD_IOQ_LOCK()
4020 +#define _MD_IOQ_UNLOCK()
4022 +extern PRStatus _MD_InitializeThread(PRThread *thread);
4024 +#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
4025 +#define _MD_INIT_THREAD _MD_InitializeThread
4026 +#define _MD_EXIT_THREAD(thread)
4027 +#define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread
4028 +#define _MD_RESUME_THREAD(thread) _MD_resume_thread
4029 +#define _MD_CLEAN_THREAD(_thread)
4031 +extern PRStatus _MD_CREATE_THREAD(
4033 + void (*start) (void *),
4034 + PRThreadPriority priority,
4035 + PRThreadScope scope,
4036 + PRThreadState state,
4037 + PRUint32 stackSize);
4038 +extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
4039 +extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
4040 +extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
4041 +extern void _MD_YIELD(void);
4043 +#endif /* ! _PR_PTHREADS */
4045 +extern void _MD_EarlyInit(void);
4047 +#define _MD_EARLY_INIT _MD_EarlyInit
4048 +#define _MD_FINAL_INIT _PR_UnixInit
4049 +#define _MD_INTERVAL_USE_GTOD
4052 + * We wrapped the select() call. _MD_SELECT refers to the built-in,
4053 + * unwrapped version.
4055 +#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
4057 +#if defined(_PR_POLL_AVAILABLE)
4059 +#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
4062 +/* freebsd has INADDR_LOOPBACK defined, but in /usr/include/rpc/types.h, and I didn't
4063 + want to be including that.. */
4064 +#ifndef INADDR_LOOPBACK
4065 +#define INADDR_LOOPBACK (u_long)0x7F000001
4069 +#include <sys/uio.h>
4071 +#endif /* nspr_freebsd_defs_h___ */
4074 [FILE:895:dragonfly/patch-nsprpub_pr_include_md__freebsd.h]
4075 --- pr/include/md/_freebsd.h.intermediate 2014-06-20 12:34:59.566379000 +0000
4076 +++ pr/include/md/_freebsd.h
4078 #define _PR_HAVE_GETHOST_R
4079 #define _PR_HAVE_GETHOST_R_INT
4081 -#if __FreeBSD_version >= 400008
4082 +#if defined(__DragonFly__) || __FreeBSD_version >= 400008
4084 * libc_r before this version of FreeBSD doesn't have poll().
4085 * Although libc has poll(), it is not thread-safe so we can't
4087 #define _PR_POLL_AVAILABLE
4090 -#if __FreeBSD_version >= 300000
4091 +#if defined(__DragonFly__) || __FreeBSD_version >= 300000
4092 #define _PR_POLL_AVAILABLE
4093 #define _PR_USE_POLL
4096 #define _PR_HAVE_SYSV_SEMAPHORES
4097 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
4099 -#if __FreeBSD_version >= 400014
4100 +#if defined(__DragonFly__) || __FreeBSD_version >= 400014
4102 #define _PR_HAVE_INET_NTOP
4103 #define _PR_HAVE_GETHOSTBYNAME2
4106 [FILE:1399:dragonfly/patch-nsprpub_pr_include_md__pth.h]
4107 --- pr/include/md/_pth.h.orig 2014-06-05 21:42:08.000000000 +0000
4108 +++ pr/include/md/_pth.h
4110 #define _PT_PTHREAD_COPY_THR_HANDLE(st, dt) (dt) = (st)
4111 #elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \
4112 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4113 - || defined(HPUX) || defined(FREEBSD) \
4114 + || defined(HPUX) || defined(FREEBSD) || defined(__DragonFly__) \
4115 || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
4116 || defined(NTO) || defined(DARWIN) \
4117 || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN)
4119 #endif /* defined(_PR_DCETHREADS) */
4121 #elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4122 - || defined(FREEBSD) || defined(SYMBIAN)
4123 + || defined(FREEBSD) || defined(SYMBIAN) || defined(__DragonFly__)
4124 #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
4125 #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
4127 @@ -260,6 +260,7 @@ extern int (*_PT_aix_yield_fcn)();
4128 #elif defined(HPUX) || defined(SOLARIS) \
4129 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4130 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
4131 + || defined(__DragonFly__) \
4132 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
4133 || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN)
4134 #define _PT_PTHREAD_YIELD() sched_yield()
4137 [FILE:291:dragonfly/patch-nsprpub_pr_include_md_prosdep.h]
4138 --- pr/include/md/prosdep.h.orig 2014-06-05 21:42:08.000000000 +0000
4139 +++ pr/include/md/prosdep.h
4140 @@ -43,6 +43,9 @@ PR_BEGIN_EXTERN_C
4141 #elif defined(OPENBSD)
4142 #include "md/_openbsd.h"
4144 +#elif defined(__DragonFly__)
4145 +#include "md/_dragonfly.h"
4148 #include "md/_bsdi.h"
4152 [FILE:494:dragonfly/patch-nsprpub_pr_src_md_unix_uxrng.c]
4153 --- pr/src/md/unix/uxrng.c.orig 2014-06-05 21:42:08.000000000 +0000
4154 +++ pr/src/md/unix/uxrng.c
4155 @@ -86,7 +86,7 @@ GetHighResClock(void *buf, size_t maxbyt
4157 #elif (defined(LINUX) || defined(FREEBSD) || defined(__FreeBSD_kernel__) \
4158 || defined(NETBSD) || defined(__NetBSD_kernel__) || defined(OPENBSD) \
4159 - || defined(SYMBIAN) || defined(__GNU__))
4160 + || defined(SYMBIAN) || defined(__GNU__)) || defined(__DragonFly__)
4161 #include <sys/types.h>
4162 #include <sys/stat.h>
4166 [FILE:723:dragonfly/patch-nsprpub_pr_src_misc_prnetdb.c]
4167 --- pr/src/misc/prnetdb.c.orig 2014-06-20 12:34:59.566379000 +0000
4168 +++ pr/src/misc/prnetdb.c
4169 @@ -78,6 +78,11 @@ PRLock *_pr_dnsLock = NULL;
4170 #define _PR_HAVE_GETPROTO_R_INT
4173 +#if defined(DRAGONFLY)
4174 +#define _PR_HAVE_GETPROTO_R
4175 +#define _PR_HAVE_5_ARG_GETPROTO_R
4178 /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
4179 #if (defined(__GLIBC__) && __GLIBC__ >= 2 && !defined(XP_BEOS))
4180 #define _PR_HAVE_GETPROTO_R
4181 @@ -295,7 +300,7 @@ _pr_QueryNetIfs(void)
4184 #elif (defined(DARWIN) && defined(HAVE_GETIFADDRS)) || defined(FREEBSD) \
4185 - || defined(NETBSD) || defined(OPENBSD)
4186 + || defined(NETBSD) || defined(OPENBSD) || defined(DRAGONFLY)
4189 * Use the BSD getifaddrs function.
4192 [FILE:1005:dragonfly/patch-nsprpub_pr_src_pthreads_ptio.c]
4193 --- pr/src/pthreads/ptio.c.orig 2014-06-20 12:34:59.616376000 +0000
4194 +++ pr/src/pthreads/ptio.c
4195 @@ -180,7 +180,8 @@ static PRBool _pr_ipv6_v6only_on_by_defa
4196 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4197 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
4198 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
4199 - || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN)
4200 + || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN) \
4201 + || defined(__DragonFly__)
4202 #define _PRSelectFdSetArg_t fd_set *
4204 #error "Cannot determine architecture"
4205 @@ -3256,7 +3257,7 @@ static PRIOMethods _pr_socketpollfd_meth
4206 || defined(AIX) || defined(FREEBSD) || defined(NETBSD) \
4207 || defined(OPENBSD) || defined(BSDI) || defined(NTO) \
4208 || defined(DARWIN) || defined(UNIXWARE) || defined(RISCOS) \
4209 - || defined(SYMBIAN)
4210 + || defined(SYMBIAN) || defined(__DragonFly__)
4211 #define _PR_FCNTL_FLAGS O_NONBLOCK
4213 #error "Can't determine architecture"
4216 [FILE:533:dragonfly/patch-nsprpub_pr_src_pthreads_ptsynch.c]
4217 --- pr/src/pthreads/ptsynch.c.orig 2014-06-20 12:34:59.616376000 +0000
4218 +++ pr/src/pthreads/ptsynch.c
4219 @@ -919,7 +919,7 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphor
4221 #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
4222 || defined(FREEBSD) || defined(OPENBSD) || defined(BSDI) \
4223 - || defined(DARWIN) || defined(SYMBIAN)
4224 + || defined(DARWIN) || defined(SYMBIAN) || defined(__DragonFly__)
4225 /* union semun is defined by including <sys/sem.h> */
4227 /* according to X/OPEN we have to define it ourselves */
4230 [FILE:700:dragonfly/patch-pr_tests_Makefile.in]
4231 --- pr/tests/Makefile.in.intermediate 2016-01-08 16:56:54.000000000 +0200
4232 +++ pr/tests/Makefile.in
4233 @@ -342,6 +342,12 @@ ifeq ($(OS_ARCH), UNIXWARE)
4234 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
4237 +ifeq ($(OS_ARCH),DragonFly)
4238 +ifeq ($(USE_PTHREADS),1)
4243 ifeq ($(OS_ARCH),FreeBSD)
4244 ifeq ($(USE_PTHREADS),1)
4246 @@ -370,7 +376,7 @@ LIBPTHREAD = -lpthread
4247 ifeq ($(OS_ARCH),AIX)
4248 LIBPTHREAD = -lpthreads
4250 -ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS QNX Darwin OpenUNIX,$(OS_ARCH)))
4251 +ifeq (,$(filter-out DragonFly FreeBSD OpenBSD BSD_OS QNX Darwin OpenUNIX,$(OS_ARCH)))
4254 ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)