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
26 FPC_EQUIVALENT= devel/nspr
29 CONFIGURE_ARGS= --enable-64bit
32 # Do not install tools to build itself
33 @${REINPLACE_CMD} -e '/RELEASE_BINS/d' \
34 ${WRKSRC}/pr/src/misc/Makefile.in
37 @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.so
39 [FILE:207:descriptions/desc.single]
40 Netscape Portable Runtime (NSPR) provides a platform-neutral API for
41 system level and libc like functions. The API is used in the Mozilla
42 client, many of Netscape/AOL/iPlanet's and other software offerings.
46 64fc18826257403a9132240aa3c45193d577a84b08e96f7e7770a97c074d17d5 1136626 nspr-4.14.tar.gz
49 [FILE:1258:manifests/plist.single]
58 %%ONLY-DRAGONFLY%%include/nspr/md/_dragonfly.cfg
81 include/nspr/obsolete/
110 include/nspr/private/
139 @(,,444) lib/libnspr4.a
140 @(,,444) lib/libnspr4.so
141 @(,,444) lib/libplc4.a
142 @(,,444) lib/libplc4.so
143 @(,,444) lib/libplds4.a
144 @(,,444) lib/libplds4.so
145 lib/pkgconfig/nspr.pc
146 share/aclocal/nspr.m4
149 [FILE:2077:patches/patch-bug1350414]
152 @@ -6730,6 +6730,8 @@ tools are selected during the Xcode/Developer Tools installation." "$LINENO" 5
154 $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
156 + $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
158 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
159 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
160 if test "$MOZ_OBJFORMAT" = "elf"; then
161 @@ -7340,6 +7342,8 @@ $as_echo "$as_me: WARNING: Unknown version of the Microsoft (R) Manifest Tool."
163 $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
165 + $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
167 if test -z "$USE_NSPR_THREADS"; then
170 @@ -7396,6 +7400,8 @@ $as_echo "$as_me: WARNING: Unknown version of the Microsoft (R) Manifest Tool."
172 $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
174 + $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
176 CFLAGS="$CFLAGS -ansi -Wall"
177 CXXFLAGS="$CXXFLAGS -ansi -Wall"
181 @@ -1554,6 +1554,7 @@ tools are selected during the Xcode/Developer Tools installation.])
183 AC_DEFINE(HAVE_BSD_FLOCK)
184 AC_DEFINE(HAVE_SOCKLEN_T)
185 + AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
186 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
187 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
188 if test "$MOZ_OBJFORMAT" = "elf"; then
189 @@ -2114,6 +2115,7 @@ tools are selected during the Xcode/Developer Tools installation.])
191 AC_DEFINE(HAVE_BSD_FLOCK)
192 AC_DEFINE(HAVE_SOCKLEN_T)
193 + AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
194 if test -z "$USE_NSPR_THREADS"; then
197 @@ -2162,6 +2164,7 @@ tools are selected during the Xcode/Developer Tools installation.])
199 AC_DEFINE(HAVE_BSD_FLOCK)
200 AC_DEFINE(HAVE_SOCKLEN_T)
201 + AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
202 CFLAGS="$CFLAGS -ansi -Wall"
203 CXXFLAGS="$CXXFLAGS -ansi -Wall"
207 [FILE:604:patches/patch-bug1350966]
208 --- pr/src/pthreads/ptsynch.c~
209 +++ pr/src/pthreads/ptsynch.c
210 @@ -55,12 +55,11 @@ void _PR_InitLocks(void)
211 rv = _PT_PTHREAD_MUTEXATTR_INIT(&_pt_mattr);
215 -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
216 +#if (defined(LINUX) && (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) || \
217 + (defined(FREEBSD) && __FreeBSD_version > 700055)
218 rv = pthread_mutexattr_settype(&_pt_mattr, PTHREAD_MUTEX_ADAPTIVE_NP);
223 rv = _PT_PTHREAD_CONDATTR_INIT(&_pt_cvar_attr);
227 [FILE:1298:patches/patch-bug301986]
228 pthread_t can well be a 64-bit value -- on FreeBSD/amd64, for example.
229 Better to just keep calling it pthread_t isntead of casting to anything.
233 --- pr/include/private/pprthred.h.orig 2015-10-16 13:22:19 UTC
234 +++ pr/include/private/pprthred.h
239 +#include <pthread.h>
243 @@ -59,7 +60,7 @@ NSPR_API(void) PR_DetachThread(void);
244 ** Get the id of the named thread. Each thread is assigned a unique id
245 ** when it is created or attached.
247 -NSPR_API(PRUint32) PR_GetThreadID(PRThread *thread);
248 +NSPR_API(pthread_t) PR_GetThreadID(PRThread *thread);
251 ** Set the procedure that is called when a thread is dumped. The procedure
252 --- pr/src/pthreads/ptthread.c.orig 2015-10-16 13:22:19 UTC
253 +++ pr/src/pthreads/ptthread.c
254 @@ -1155,12 +1155,12 @@ PR_IMPLEMENT(void) PR_ProcessExit(PRIntn
258 -PR_IMPLEMENT(PRUint32) PR_GetThreadID(PRThread *thred)
259 +PR_IMPLEMENT(pthread_t) PR_GetThreadID(PRThread *thred)
261 #if defined(_PR_DCETHREADS)
262 return (PRUint32)&thred->id; /* this is really a sham! */
264 - return (PRUint32)thred->id; /* and I don't know what they will do with it */
265 + return thred->id; /* and I don't know what they will do with it */
271 [FILE:916:patches/patch-bug782109]
272 --- pr/include/md/_freebsd.h.orig 2015-10-16 13:22:19 UTC
273 +++ pr/include/md/_freebsd.h
275 #define _PR_HAVE_LARGE_OFF_T
277 #if defined(_PR_PTHREADS)
278 +#if __FreeBSD_version >= 602000
279 +#define _PR_HAVE_GETPROTO_R
280 +#define _PR_HAVE_5_ARG_GETPROTO_R
282 +#if __FreeBSD_version >= 700016
283 +#define _PR_HAVE_GETHOST_R
284 +#define _PR_HAVE_GETHOST_R_INT
286 #if __FreeBSD_version >= 400008
288 * libc_r before this version of FreeBSD doesn't have poll().
289 --- pr/src/misc/prnetdb.c.orig 2015-10-16 13:22:19 UTC
290 +++ pr/src/misc/prnetdb.c
291 @@ -78,11 +78,6 @@ PRLock *_pr_dnsLock = NULL;
292 #define _PR_HAVE_GETPROTO_R_INT
295 -#if __FreeBSD_version >= 602000
296 -#define _PR_HAVE_GETPROTO_R
297 -#define _PR_HAVE_5_ARG_GETPROTO_R
300 /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
301 #if (defined(__GLIBC__) && __GLIBC__ >= 2 && !defined(XP_BEOS))
302 #define _PR_HAVE_GETPROTO_R
305 [FILE:489:patches/patch-config_nspr.pc.in]
306 --- config/nspr.pc.in.orig 2015-10-16 13:22:19 UTC
307 +++ config/nspr.pc.in
308 @@ -6,5 +6,5 @@ includedir=@includedir@
310 Description: The Netscape Portable Runtime
311 Version: @MOD_MAJOR_VERSION@.@MOD_MINOR_VERSION@.@MOD_PATCH_VERSION@
312 -Libs: -L@libdir@ -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@
313 -Cflags: -I@includedir@
314 +Libs: -L${libdir} -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@ @OS_LIBS@
315 +Cflags: -I${includedir}
318 [FILE:29847:patches/patch-libtests]
319 --- lib/tests/arena.c.orig 2015-10-16 13:22:19 UTC
320 +++ lib/tests/arena.c
321 @@ -36,6 +36,7 @@ void DumpAll( void )
327 ** Test Arena allocation.
329 @@ -96,6 +97,7 @@ static void ArenaGrow( void )
332 } /* end ArenaGrow() */
337 --- lib/tests/base64t.c.orig 2015-10-16 13:22:19 UTC
338 +++ lib/tests/base64t.c
339 @@ -1987,7 +1987,6 @@ PRBool test_008(void)
340 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
342 PRUint32 plen = PL_strlen(array[i].plaintext);
343 - PRUint32 clen = ((plen + 2)/3)*4;
345 char *rv = PL_Base64Encode(array[i].plaintext, plen, (char *)0);
347 @@ -2747,9 +2746,6 @@ PRBool test_024(void)
349 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
351 - PRUint32 plen = PL_strlen(array[i].plaintext);
352 - PRUint32 clen = ((plen + 2)/3)*4;
354 char *rv = PL_Base64Encode(array[i].plaintext, 0, (char *)0);
356 if( (char *)0 == rv )
357 @@ -2883,8 +2879,6 @@ PRBool test_027(void)
359 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
361 - PRUint32 clen = PL_strlen(array[i].cyphertext);
363 char *rv = PL_Base64Decode(array[i].cyphertext, 0, (char *)0);
365 if( (char *)0 == rv )
366 --- lib/tests/string.c.orig 2015-10-16 13:22:19 UTC
367 +++ lib/tests/string.c
368 @@ -127,7 +127,7 @@ PRBool test_003(void)
369 rv = PL_strcpy(array[i].dest, array[i].str);
370 if( array[i].rv != rv )
372 - printf("FAIL %d: (0x%x, %s)->0x%x\n", i, array[i].dest,
373 + printf("FAIL %d: (%p, %s)->%p\n", i, array[i].dest,
374 array[i].str ? array[i].str : "(null)", rv);
377 @@ -237,8 +237,8 @@ PRBool test_004(void)
378 rv = PL_strncpy(array[i].dest, array[i].str, array[i].len);
379 if( array[i].rv != rv )
381 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
382 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
383 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
384 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
388 @@ -363,8 +363,8 @@ PRBool test_005(void)
389 rv = PL_strncpyz(array[i].dest, array[i].str, array[i].len);
390 if( array[i].rv != rv )
392 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
393 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
394 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
395 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
399 @@ -415,7 +415,7 @@ PRBool test_006(void)
401 if( (char *)0 == rv )
403 - printf("FAIL %d: 0x%x -> 0\n", i, array[i]);
404 + printf("FAIL %d: %p -> 0\n", i, array[i]);
408 @@ -499,8 +499,8 @@ PRBool test_007(void)
410 if( (char *)0 == rv )
412 - printf("FAIL %d: %s,%lu -> 0\n", i,
413 - array[i].str ? array[i].str : "(null)", array[i].len);
414 + printf("FAIL %d: %s,%u -> 0\n", i,
415 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len);
419 @@ -684,10 +684,10 @@ PRBool test_009(void)
421 if( (char *)0 != rv )
423 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
424 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
425 array[i].first ? array[i].first : "(null)",
426 array[i].second ? array[i].second : "(null)",
427 - array[i].length, rv);
428 + (unsigned)array[i].length, rv);
432 @@ -695,10 +695,10 @@ PRBool test_009(void)
434 if( (char *)0 == rv )
436 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
437 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
438 array[i].first ? array[i].first : "(null)",
439 array[i].second ? array[i].second : "(null)",
440 - array[i].length, array[i].result);
441 + (unsigned)array[i].length, array[i].result);
445 @@ -710,10 +710,10 @@ PRBool test_009(void)
449 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
450 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
451 array[i].first ? array[i].first : "(null)",
452 array[i].second ? array[i].second : "(null)",
453 - array[i].length, rv, array[i].result);
454 + (unsigned)array[i].length, rv, array[i].result);
458 @@ -725,10 +725,10 @@ PRBool test_009(void)
462 - printf("FAIL %d: %s+%s/%lu -> not nulled\n", i,
463 + printf("FAIL %d: %s+%s/%u -> not nulled\n", i,
464 array[i].first ? array[i].first : "(null)",
465 array[i].second ? array[i].second : "(null)",
467 + (unsigned)array[i].length);
471 @@ -736,10 +736,10 @@ PRBool test_009(void)
475 - printf("FAIL %d: %s+%s/%lu -> overrun\n", i,
476 + printf("FAIL %d: %s+%s/%u -> overrun\n", i,
477 array[i].first ? array[i].first : "(null)",
478 array[i].second ? array[i].second : "(null)",
480 + (unsigned)array[i].length);
484 @@ -814,10 +814,10 @@ PRBool test_010(void)
486 if( (char *)0 != rv )
488 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
489 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
490 array[i].first ? array[i].first : "(null)",
491 array[i].second ? array[i].second : "(null)",
492 - array[i].length, rv);
493 + (unsigned)array[i].length, rv);
497 @@ -825,10 +825,10 @@ PRBool test_010(void)
499 if( (char *)0 == rv )
501 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
502 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
503 array[i].first ? array[i].first : "(null)",
504 array[i].second ? array[i].second : "(null)",
505 - array[i].length, array[i].result);
506 + (unsigned)array[i].length, array[i].result);
510 @@ -840,10 +840,10 @@ PRBool test_010(void)
514 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
515 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
516 array[i].first ? array[i].first : "(null)",
517 array[i].second ? array[i].second : "(null)",
518 - array[i].length, rv, array[i].result);
519 + (unsigned)array[i].length, rv, array[i].result);
523 @@ -1072,10 +1072,10 @@ PRBool test_012(void)
527 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
528 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
529 array[i].one ? array[i].one : "(null)",
530 array[i].two ? array[i].two : "(null)",
531 - array[i].max, rv, array[i].sign);
532 + (int)array[i].max, rv, array[i].sign);
536 @@ -1294,10 +1294,10 @@ PRBool test_014(void)
540 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
541 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
542 array[i].one ? array[i].one : "(null)",
543 array[i].two ? array[i].two : "(null)",
544 - array[i].max, rv, array[i].sign);
545 + (int)array[i].max, rv, array[i].sign);
549 @@ -1367,15 +1367,15 @@ PRBool test_015(void)
551 if( (char *)0 == rv )
553 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
554 - array[i].chr, array[i].off);
555 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
556 + array[i].chr, (unsigned)array[i].off);
560 if( &array[i].str[ array[i].off ] != rv )
562 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
563 - array[i].chr, rv, array[i].str, array[i].off);
564 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
565 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
569 @@ -1447,15 +1447,15 @@ PRBool test_016(void)
571 if( (char *)0 == rv )
573 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
574 - array[i].chr, array[i].off);
575 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
576 + array[i].chr, (unsigned)array[i].off);
580 if( &array[i].str[ array[i].off ] != rv )
582 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
583 - array[i].chr, rv, array[i].str, array[i].off);
584 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
585 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
589 @@ -1522,8 +1522,8 @@ PRBool test_017(void)
591 if( (char *)0 != rv )
593 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
594 - array[i].chr, array[i].max, rv);
595 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
596 + array[i].chr, (unsigned)array[i].max, rv);
600 @@ -1531,15 +1531,15 @@ PRBool test_017(void)
602 if( (char *)0 == rv )
604 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
605 - array[i].chr, array[i].max, array[i].off);
606 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
607 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
611 if( &array[i].str[ array[i].off ] != rv )
613 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
614 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
615 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
616 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
620 @@ -1606,8 +1606,8 @@ PRBool test_018(void)
622 if( (char *)0 != rv )
624 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
625 - array[i].chr, array[i].max, rv);
626 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
627 + array[i].chr, (unsigned)array[i].max, rv);
631 @@ -1615,15 +1615,15 @@ PRBool test_018(void)
633 if( (char *)0 == rv )
635 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
636 - array[i].chr, array[i].max, array[i].off);
637 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
638 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
642 - if( &array[i].str[ array[i].off ] != rv )
643 + if( &array[i].str[ array[i].off ] != rv)
645 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
646 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
647 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
648 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
652 @@ -1702,19 +1702,19 @@ PRBool test_019(void)
654 if( (char *)0 == rv )
656 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
657 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
658 array[i].str ? array[i].str : "(null)",
659 array[i].chrs ? array[i].chrs : "(null)",
661 + (unsigned)array[i].off);
665 if( &array[i].str[ array[i].off ] != rv )
667 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
668 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
669 array[i].str ? array[i].str : "(null)",
670 array[i].chrs ? array[i].chrs : "(null)",
671 - rv, array[i].str, array[i].off);
672 + rv, array[i].str, (unsigned)array[i].off);
676 @@ -1793,19 +1793,19 @@ PRBool test_020(void)
678 if( (char *)0 == rv )
680 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
681 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
682 array[i].str ? array[i].str : "(null)",
683 array[i].chrs ? array[i].chrs : "(null)",
685 + (unsigned)array[i].off);
689 if( &array[i].str[ array[i].off ] != rv )
691 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
692 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
693 array[i].str ? array[i].str : "(null)",
694 array[i].chrs ? array[i].chrs : "(null)",
695 - rv, array[i].str, array[i].off);
696 + rv, array[i].str, (unsigned)array[i].off);
700 @@ -1879,10 +1879,10 @@ PRBool test_021(void)
702 if( (char *)0 != rv )
704 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
705 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
706 array[i].str ? array[i].str : "(null)",
707 array[i].chrs ? array[i].chrs : "(null)",
709 + (unsigned)array[i].max, rv);
713 @@ -1890,19 +1890,19 @@ PRBool test_021(void)
715 if( (char *)0 == rv )
717 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
718 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
719 array[i].str ? array[i].str : "(null)",
720 array[i].chrs ? array[i].chrs : "(null)",
721 - array[i].max, array[i].off);
722 + (unsigned)array[i].max, array[i].off);
726 if( &array[i].str[ array[i].off ] != rv )
728 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
729 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
730 array[i].str ? array[i].str : "(null)",
731 array[i].chrs ? array[i].chrs : "(null)",
732 - array[i].max, rv, array[i].str, array[i].off);
733 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
737 @@ -1985,10 +1985,10 @@ PRBool test_022(void)
739 if( (char *)0 != rv )
741 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
742 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
743 array[i].str ? array[i].str : "(null)",
744 array[i].chrs ? array[i].chrs : "(null)",
746 + (unsigned)array[i].max, rv);
750 @@ -1996,19 +1996,19 @@ PRBool test_022(void)
752 if( (char *)0 == rv )
754 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
755 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
756 array[i].str ? array[i].str : "(null)",
757 array[i].chrs ? array[i].chrs : "(null)",
758 - array[i].max, array[i].off);
759 + (unsigned)array[i].max, array[i].off);
763 if( &array[i].str[ array[i].off ] != rv )
765 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
766 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
767 array[i].str ? array[i].str : "(null)",
768 array[i].chrs ? array[i].chrs : "(null)",
769 - array[i].max, rv, array[i].str, array[i].off);
770 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
774 @@ -2104,19 +2104,19 @@ PRBool test_023(void)
776 if( (char *)0 == rv )
778 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
779 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
780 array[i].str ? array[i].str : "(null)",
781 array[i].sub ? array[i].sub : "(null)",
782 - array[i].str, array[i].off);
783 + array[i].str, (unsigned)array[i].off);
787 if( &array[i].str[ array[i].off ] != rv )
789 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
790 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
791 array[i].str ? array[i].str : "(null)",
792 array[i].sub ? array[i].sub : "(null)",
793 - rv, array[i].str, array[i].off);
794 + rv, array[i].str, (unsigned)array[i].off);
798 @@ -2212,19 +2212,19 @@ PRBool test_024(void)
800 if( (char *)0 == rv )
802 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
803 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
804 array[i].str ? array[i].str : "(null)",
805 array[i].sub ? array[i].sub : "(null)",
806 - array[i].str, array[i].off);
807 + array[i].str, (unsigned)array[i].off);
811 if( &array[i].str[ array[i].off ] != rv )
813 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
814 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
815 array[i].str ? array[i].str : "(null)",
816 array[i].sub ? array[i].sub : "(null)",
817 - rv, array[i].str, array[i].off);
818 + rv, array[i].str, (unsigned)array[i].off);
822 @@ -2331,10 +2331,10 @@ PRBool test_025(void)
824 if( (char *)0 != rv )
826 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
827 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
828 array[i].str ? array[i].str : "(null)",
829 array[i].sub ? array[i].sub : "(null)",
831 + (unsigned)array[i].max, rv);
835 @@ -2342,19 +2342,19 @@ PRBool test_025(void)
837 if( (char *)0 == rv )
839 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
840 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
841 array[i].str ? array[i].str : "(null)",
842 array[i].sub ? array[i].sub : "(null)",
843 - array[i].max, array[i].str, array[i].off);
844 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
848 if( &array[i].str[ array[i].off ] != rv )
850 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
851 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
852 array[i].str ? array[i].str : "(null)",
853 array[i].sub ? array[i].sub : "(null)",
854 - array[i].max, rv, array[i].str, array[i].off);
855 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
859 @@ -2463,10 +2463,10 @@ PRBool test_026(void)
861 if( (char *)0 != rv )
863 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
864 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
865 array[i].str ? array[i].str : "(null)",
866 array[i].sub ? array[i].sub : "(null)",
868 + (unsigned)array[i].max, rv);
872 @@ -2474,19 +2474,19 @@ PRBool test_026(void)
874 if( (char *)0 == rv )
876 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
877 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
878 array[i].str ? array[i].str : "(null)",
879 array[i].sub ? array[i].sub : "(null)",
880 - array[i].max, array[i].str, array[i].off);
881 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
885 if( &array[i].str[ array[i].off ] != rv )
887 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
888 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
889 array[i].str ? array[i].str : "(null)",
890 array[i].sub ? array[i].sub : "(null)",
891 - array[i].max, rv, array[i].str, array[i].off);
892 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
896 @@ -2582,19 +2582,19 @@ PRBool test_027(void)
898 if( (char *)0 == rv )
900 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
901 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
902 array[i].str ? array[i].str : "(null)",
903 array[i].sub ? array[i].sub : "(null)",
904 - array[i].str, array[i].off);
905 + array[i].str, (unsigned)array[i].off);
909 if( &array[i].str[ array[i].off ] != rv )
911 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
912 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
913 array[i].str ? array[i].str : "(null)",
914 array[i].sub ? array[i].sub : "(null)",
915 - rv, array[i].str, array[i].off);
916 + rv, array[i].str, (unsigned)array[i].off);
920 @@ -2690,19 +2690,19 @@ PRBool test_028(void)
922 if( (char *)0 == rv )
924 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
925 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
926 array[i].str ? array[i].str : "(null)",
927 array[i].sub ? array[i].sub : "(null)",
928 - array[i].str, array[i].off);
929 + array[i].str, (unsigned)array[i].off);
933 if( &array[i].str[ array[i].off ] != rv )
935 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
936 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
937 array[i].str ? array[i].str : "(null)",
938 array[i].sub ? array[i].sub : "(null)",
939 - rv, array[i].str, array[i].off);
940 + rv, array[i].str, (unsigned)array[i].off);
944 @@ -2809,10 +2809,10 @@ PRBool test_029(void)
946 if( (char *)0 != rv )
948 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
949 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
950 array[i].str ? array[i].str : "(null)",
951 array[i].sub ? array[i].sub : "(null)",
953 + (unsigned)array[i].max, rv);
957 @@ -2820,19 +2820,19 @@ PRBool test_029(void)
959 if( (char *)0 == rv )
961 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
962 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
963 array[i].str ? array[i].str : "(null)",
964 array[i].sub ? array[i].sub : "(null)",
965 - array[i].max, array[i].str, array[i].off);
966 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
970 if( &array[i].str[ array[i].off ] != rv )
972 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
973 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
974 array[i].str ? array[i].str : "(null)",
975 array[i].sub ? array[i].sub : "(null)",
976 - array[i].max, rv, array[i].str, array[i].off);
977 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
981 @@ -2941,10 +2941,10 @@ PRBool test_030(void)
983 if( (char *)0 != rv )
985 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
986 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
987 array[i].str ? array[i].str : "(null)",
988 array[i].sub ? array[i].sub : "(null)",
990 + (unsigned)array[i].max, rv);
994 @@ -2952,19 +2952,19 @@ PRBool test_030(void)
996 if( (char *)0 == rv )
998 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
999 + printf("FAIL %d: %s,%s/%u -> null, not %p+%u\n", i,
1000 array[i].str ? array[i].str : "(null)",
1001 array[i].sub ? array[i].sub : "(null)",
1002 - array[i].max, array[i].str, array[i].off);
1003 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
1007 if( &array[i].str[ array[i].off ] != rv )
1009 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
1010 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
1011 array[i].str ? array[i].str : "(null)",
1012 array[i].sub ? array[i].sub : "(null)",
1013 - array[i].max, rv, array[i].str, array[i].off);
1014 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
1020 [FILE:85333:patches/patch-tests]
1021 --- lib/tests/Makefile.in.orig 2015-10-16 13:22:19 UTC
1022 +++ lib/tests/Makefile.in
1023 @@ -167,7 +167,7 @@ else
1024 ifeq ($(OS_ARCH),OS2)
1025 $(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS)
1027 - $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@
1028 + $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) -o $@
1032 --- pr/tests/Makefile.in.orig 2015-10-16 13:22:19 UTC
1033 +++ pr/tests/Makefile.in
1034 @@ -489,17 +489,18 @@ endif
1037 runtests:: $(PROGS) ALWAYS
1038 - @$(ECHO) "\nNSPR Test Results - $(OBJDIR)\n"
1039 - @$(ECHO) "BEGIN\t\t\t`date`"
1040 - @$(ECHO) "NSPR_TEST_LOGFILE\t$(LOGFILE)\n"
1041 - @$(ECHO) "Test\t\t\tResult\n"
1042 + @$(ECHO) "NSPR Test Results - $(OBJDIR)"
1043 + @$(ECHO) "BEGIN `date`"
1044 + @$(ECHO) "Test Result"
1045 @cd $(OBJDIR); for i in $(PROGRAMS); do \
1046 - $(ECHO) "$$i\c"; \
1047 - ./$$i >> $(LOGFILE) 2>&1 ; \
1049 + ./$$i > $$i.output 2>&1; \
1050 if [ 0 = $$? ] ; then \
1051 - $(ECHO) "\t\t\tPassed"; \
1053 - $(ECHO) "\t\t\tFAILED"; \
1055 + $(ECHO) " Passed"; \
1058 + $(ECHO) " FAILED"; \
1062 - @$(ECHO) "\nEND\t\t`date`\n"
1063 + @$(ECHO) "END `date`"
1064 --- pr/tests/cleanup.c.orig 2015-10-16 13:22:19 UTC
1065 +++ pr/tests/cleanup.c
1068 static void PR_CALLBACK Thread(void *sleep)
1070 - PR_Sleep(PR_SecondsToInterval((PRUint32)sleep));
1071 + PR_Sleep(PR_SecondsToInterval((intptr_t)sleep));
1072 printf("Thread exiting\n");
1075 @@ -39,7 +39,8 @@ int main(int argc, char **argv)
1076 PRThreadScope type = PR_LOCAL_THREAD;
1077 PRFileDesc *err = PR_GetSpecialFD(PR_StandardError);
1078 PLOptState *opt = PL_CreateOptState(argc, argv, "Ghs:S:t:cC:");
1079 - PRIntn concurrency = 1, child_sleep = 10, main_sleep = 5, threads = 1;
1080 + PRIntn concurrency = 1, main_sleep = 5, threads = 1;
1081 + intptr_t child_sleep = 10;
1084 while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
1085 @@ -80,7 +81,7 @@ int main(int argc, char **argv)
1086 (PR_LOCAL_THREAD == type) ? "LOCAL" : "GLOBAL");
1087 PR_fprintf(err, "\tConcurrency: %d\n", concurrency);
1088 PR_fprintf(err, "\tNumber of threads: %d\n", threads);
1089 - PR_fprintf(err, "\tThread sleep: %d\n", child_sleep);
1090 + PR_fprintf(err, "\tThread sleep: %d\n", (int)child_sleep);
1091 PR_fprintf(err, "\tMain sleep: %d\n", main_sleep);
1092 PR_fprintf(err, "\tCleanup will %sbe called\n\n", (cleanup) ? "" : "NOT ");
1094 --- pr/tests/cltsrv.c.orig 2015-10-16 13:22:19 UTC
1095 +++ pr/tests/cltsrv.c
1096 @@ -887,7 +887,7 @@ int main(int argc, char** argv)
1100 - CSClient_t *client;
1101 + CSClient_t *client = NULL;
1102 PRStatus rv, joinStatus;
1103 CSServer_t *server = NULL;
1105 --- pr/tests/cvar.c.orig 2015-10-16 13:22:19 UTC
1107 @@ -135,14 +135,14 @@ static int alive;
1108 static void PR_CALLBACK CXReader(void *arg)
1110 CircBuf *cbp = (CircBuf *)arg;
1116 for (i = 0; i < n; i++) {
1117 data = GetCBData(cbp);
1118 - if ((int)data != i)
1119 - if (debug_mode) printf("data mismatch at for i = %d usec\n", i);
1120 + if ((intptr_t)data != i)
1121 + if (debug_mode) printf("data mismatch at for i = %ld usec\n", (long)i);
1124 PR_EnterMonitor(mon);
1125 @@ -154,7 +154,7 @@ static void PR_CALLBACK CXReader(void *a
1126 static void PR_CALLBACK CXWriter(void *arg)
1128 CircBuf *cbp = (CircBuf *)arg;
1133 for (i = 0; i < n; i++)
1134 --- pr/tests/cvar2.c.orig 2015-10-16 13:22:19 UTC
1135 +++ pr/tests/cvar2.c
1136 @@ -95,7 +95,7 @@ PrivateCondVarThread(void *_info)
1137 for (index=0; index<info->loops; index++) {
1138 PR_Lock(info->lock);
1139 if (*info->tcount == 0) {
1140 - DPRINTF(("PrivateCondVarThread: thread 0x%lx waiting on cvar = 0x%lx\n",
1141 + DPRINTF(("PrivateCondVarThread: thread %p waiting on cvar = %p\n",
1142 PR_GetCurrentThread(), info->cvar));
1143 PR_WaitCondVar(info->cvar, info->timeout);
1145 @@ -108,8 +108,8 @@ PrivateCondVarThread(void *_info)
1146 PR_Lock(info->exitlock);
1147 (*info->exitcount)++;
1148 PR_NotifyCondVar(info->exitcvar);
1149 -DPRINTF(("PrivateCondVarThread: thread 0x%lx notified exitcvar = 0x%lx cnt = %ld\n",
1150 - PR_GetCurrentThread(), info->exitcvar,(*info->exitcount)));
1151 +DPRINTF(("PrivateCondVarThread: thread %p notified exitcvar = %p cnt = %d\n",
1152 + PR_GetCurrentThread(), info->exitcvar,(int)(*info->exitcount)));
1153 PR_Unlock(info->exitlock);
1156 @@ -157,7 +157,7 @@ CreateTestThread(threadinfo *info,
1158 CondVarTestSUU(void *_arg)
1160 - PRInt32 arg = (PRInt32)_arg;
1161 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1162 PRInt32 index, loops;
1165 @@ -189,7 +189,7 @@ CondVarTestSUU(void *_arg)
1169 - DPRINTF(("CondVarTestSUU: created thread 0x%lx\n",list[index].thread));
1170 + DPRINTF(("CondVarTestSUU: created thread %p\n",list[index].thread));
1173 for (loops = 0; loops < count; loops++) {
1174 @@ -199,7 +199,7 @@ CondVarTestSUU(void *_arg)
1175 (*list[index].tcount)++;
1176 PR_NotifyCondVar(list[index].cvar);
1177 PR_Unlock(list[index].lock);
1178 - DPRINTF(("PrivateCondVarThread: thread 0x%lx notified cvar = 0x%lx\n",
1179 + DPRINTF(("PrivateCondVarThread: thread %p notified cvar = %p\n",
1180 PR_GetCurrentThread(), list[index].cvar));
1183 @@ -227,7 +227,7 @@ CondVarTestSUU(void *_arg)
1185 CondVarTestSUK(void *_arg)
1187 - PRInt32 arg = (PRInt32)_arg;
1188 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1189 PRInt32 index, loops;
1192 @@ -301,7 +301,7 @@ CondVarTestSUK(void *_arg)
1194 CondVarTestPUU(void *_arg)
1196 - PRInt32 arg = (PRInt32)_arg;
1197 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1198 PRInt32 index, loops;
1201 @@ -336,7 +336,7 @@ CondVarTestPUU(void *_arg)
1205 - DPRINTF(("CondVarTestPUU: created thread 0x%lx\n",list[index].thread));
1206 + DPRINTF(("CondVarTestPUU: created thread %p\n",list[index].thread));
1210 @@ -354,8 +354,8 @@ CondVarTestPUU(void *_arg)
1212 /* Wait for threads to finish */
1213 while(exitcount < arg) {
1214 -DPRINTF(("CondVarTestPUU: thread 0x%lx waiting on exitcvar = 0x%lx cnt = %ld\n",
1215 - PR_GetCurrentThread(), exitcvar, exitcount));
1216 +DPRINTF(("CondVarTestPUU: thread %p waiting on exitcvar = %p cnt = %d\n",
1217 + PR_GetCurrentThread(), exitcvar, (int)exitcount));
1218 PR_WaitCondVar(exitcvar, PR_SecondsToInterval(60));
1220 PR_ASSERT(exitcount >= arg);
1221 @@ -365,7 +365,7 @@ DPRINTF(("CondVarTestPUU: thread 0x%lx w
1223 /* Join all the threads */
1224 for(index=0; index<(arg); index++) {
1225 - DPRINTF(("CondVarTestPUU: joining thread 0x%lx\n",list[index].thread));
1226 + DPRINTF(("CondVarTestPUU: joining thread %p\n",list[index].thread));
1227 PR_JoinThread(list[index].thread);
1228 if (list[index].internal) {
1229 PR_Lock(list[index].lock);
1230 @@ -387,7 +387,7 @@ DPRINTF(("CondVarTestPUU: thread 0x%lx w
1232 CondVarTestPUK(void *_arg)
1234 - PRInt32 arg = (PRInt32)_arg;
1235 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1236 PRInt32 index, loops;
1239 @@ -468,7 +468,7 @@ CondVarTestPUK(void *_arg)
1241 CondVarTest(void *_arg)
1243 - PRInt32 arg = (PRInt32)_arg;
1244 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1245 PRInt32 index, loops;
1248 @@ -601,7 +601,7 @@ CondVarTest(void *_arg)
1250 CondVarTimeoutTest(void *_arg)
1252 - PRInt32 arg = (PRInt32)_arg;
1253 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1254 PRInt32 index, loops;
1257 @@ -712,7 +712,7 @@ CondVarTimeoutTest(void *_arg)
1259 CondVarMixedTest(void *_arg)
1261 - PRInt32 arg = (PRInt32)_arg;
1262 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1263 PRInt32 index, loops;
1266 @@ -802,7 +802,7 @@ CondVarMixedTest(void *_arg)
1267 for(index=0; index<(arg*4); index+=3) {
1269 PR_Lock(list[index].lock);
1270 - *list[index].tcount++;
1271 + list[index].tcount++;
1272 PR_NotifyCondVar(list[index].cvar);
1273 PR_Unlock(list[index].lock);
1275 @@ -873,7 +873,7 @@ static void Measure(void (*func)(void *)
1278 start = PR_IntervalNow();
1279 - (*func)((void *)arg);
1280 + (*func)((void *)(intptr_t)arg);
1281 stop = PR_IntervalNow();
1283 d = (double)PR_IntervalToMicroseconds(stop - start);
1284 @@ -932,7 +932,7 @@ default_threads, default_threads*2, defa
1285 PR_SetConcurrency(2);
1287 for (threads = default_threads; threads < default_threads*5; threads+=default_threads) {
1288 - printf("\n%ld Thread tests\n", threads);
1289 + printf("\n%d Thread tests\n", (int)threads);
1290 Measure(CondVarTestSUU, threads, "Condvar simple test shared UU");
1291 Measure(CondVarTestSUK, threads, "Condvar simple test shared UK");
1292 Measure(CondVarTestPUU, threads, "Condvar simple test priv UU");
1293 --- pr/tests/foreign.c.orig 2015-10-16 13:22:19 UTC
1294 +++ pr/tests/foreign.c
1295 @@ -202,7 +202,7 @@ static void OneShot(void *arg)
1298 PRFileDesc *pair[2];
1299 - PRIntn test = (PRIntn)arg;
1300 + intptr_t test = (intptr_t)arg;
1302 for (test = 0; test < 12; ++test) {
1304 @@ -302,7 +302,7 @@ static void OneShot(void *arg)
1305 int main(int argc, char **argv)
1308 - PRInt32 thread_cnt = DEFAULT_THREAD_COUNT;
1309 + intptr_t thread_cnt = DEFAULT_THREAD_COUNT;
1311 PLOptState *opt = PL_CreateOptState(argc, argv, "dt:");
1313 --- pr/tests/forktest.c.orig 2015-10-16 13:22:19 UTC
1314 +++ pr/tests/forktest.c
1315 @@ -47,7 +47,7 @@ ClientThreadFunc(void *arg)
1318 PRFileDesc *sock = NULL;
1319 - PRInt32 tmp = (PRInt32)arg;
1320 + intptr_t tmp = (intptr_t)arg;
1323 * Make sure the PR_Accept call will block
1324 @@ -143,7 +143,7 @@ DoIO(void)
1327 clientThread = PR_CreateThread( PR_USER_THREAD, ClientThreadFunc,
1328 - (void *) PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1329 + (void *)(intptr_t)PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1330 PR_JOINABLE_THREAD, 0);
1331 if (clientThread == NULL) {
1332 fprintf(stderr, "Cannot create client thread: (%d, %d)\n",
1333 @@ -151,6 +151,9 @@ DoIO(void)
1337 + printf("Wait one second before accept\n");
1339 + PR_Sleep(PR_SecondsToInterval(1));
1340 printf("Accepting connection at port %hu\n", PR_ntohs(addr.inet.port));
1342 sock = PR_Accept(listenSock, &addr, PR_SecondsToInterval(5));
1343 --- pr/tests/getai.c.orig 2015-10-16 13:22:19 UTC
1344 +++ pr/tests/getai.c
1345 @@ -13,8 +13,13 @@ int main(int argc, char **argv)
1351 - ai = PR_GetAddrInfoByName(argv[1], PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1355 + host = "www.FreeBSD.org";
1356 + ai = PR_GetAddrInfoByName(host, PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1358 fprintf(stderr, "PR_GetAddrInfoByName failed: (%d, %d)\n",
1359 PR_GetError(), PR_GetOSError());
1360 --- pr/tests/instrumt.c.orig 2015-10-16 13:22:19 UTC
1361 +++ pr/tests/instrumt.c
1368 #include <prclist.h>
1371 #define COUNT_LIMIT (10 * ( 1024))
1373 #define SMALL_TRACE_BUFSIZE ( 60 * 1024 )
1378 @@ -78,10 +78,10 @@ static void Help(void)
1380 static void ListCounters(void)
1382 +#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
1383 PR_DEFINE_COUNTER( qh );
1384 PR_DEFINE_COUNTER( rh );
1385 const char *qn, *rn, *dn;
1386 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1389 PR_INIT_COUNTER_HANDLE( qh, NULL );
1390 @@ -92,7 +92,7 @@ static void ListCounters(void)
1391 PR_FIND_NEXT_COUNTER_RNAME(rh, rh, qh );
1392 while ( rh != NULL )
1394 - PR_GET_COUNTER_NAME_FROM_HANDLE( rh, qname, rname, desc );
1395 + PR_GET_COUNTER_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1396 PR_GET_COUNTER(tCtr, rh);
1397 PR_LOG( lm, msgLevel,
1398 ( "QName: %s RName: %s Desc: %s Value: %ld\n",
1399 @@ -101,15 +101,15 @@ static void ListCounters(void)
1401 PR_FIND_NEXT_COUNTER_QNAME(qh, qh);
1405 } /* end ListCounters() */
1407 static void ListTraces(void)
1409 +#if defined(DEBUG) || defined(FORCE_NSPR_TRACE)
1410 PR_DEFINE_TRACE( qh );
1411 PR_DEFINE_TRACE( rh );
1412 const char *qn, *rn, *dn;
1413 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1415 PR_INIT_TRACE_HANDLE( qh, NULL );
1416 PR_FIND_NEXT_TRACE_QNAME(qh, qh );
1417 @@ -119,7 +119,7 @@ static void ListTraces(void)
1418 PR_FIND_NEXT_TRACE_RNAME(rh, rh, qh );
1419 while ( rh != NULL )
1421 - PR_GET_TRACE_NAME_FROM_HANDLE( rh, qname, rname, desc );
1422 + PR_GET_TRACE_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1423 PR_LOG( lm, msgLevel,
1424 ( "QName: %s RName: %s Desc: %s",
1426 @@ -127,7 +127,7 @@ static void ListTraces(void)
1428 PR_FIND_NEXT_TRACE_QNAME(qh, qh);
1432 } /* end ListCounters() */
1435 @@ -326,7 +326,7 @@ static void PR_CALLBACK SampleTrace( voi
1437 static void TraceTest( void )
1442 PR_DEFINE_TRACE( th );
1444 --- pr/tests/io_timeout.c.orig 2015-10-16 13:22:19 UTC
1445 +++ pr/tests/io_timeout.c
1447 /* Used to get the command line option */
1448 #include "plgetopt.h"
1452 +#include <string.h>
1455 #define NUM_THREADS 1
1456 -#define BASE_PORT 8000
1457 +#define BASE_PORT 38011
1458 #define DEFAULT_ACCEPT_TIMEOUT 2
1460 typedef struct threadInfo {
1461 @@ -38,7 +40,7 @@ typedef struct threadInfo {
1464 PRIntn failed_already = 0;
1465 -PRIntn debug_mode = 0;
1466 +PRIntn debug_mode = 1;
1468 #define LOCAL_SCOPE_STRING "LOCAL scope"
1469 #define GLOBAL_SCOPE_STRING "GLOBAL scope"
1470 @@ -54,7 +56,7 @@ thread_main(void *_info)
1471 PRFileDesc *clientSock;
1473 PRThreadScope tscope;
1475 + const char *scope_str;
1479 @@ -73,6 +75,7 @@ thread_main(void *_info)
1482 PR_NOT_REACHED("Invalid thread scope");
1486 printf("thread id %d, scope %s\n", info->id, scope_str);
1487 @@ -91,7 +94,12 @@ thread_main(void *_info)
1488 rv = PR_Bind(listenSock, &listenAddr);
1489 if (rv == PR_FAILURE) {
1491 - printf("unable to bind\n");
1492 + printf("unable to bind to %d: %s\n",
1493 + BASE_PORT + info->id, strerror(PR_GetOSError()));
1494 + if (PR_GetOSError() == EADDRINUSE) {
1495 + printf("can not proceed with this test\n");
1501 @@ -113,8 +121,9 @@ thread_main(void *_info)
1502 if (clientSock == NULL) {
1503 if (PR_GetError() == PR_IO_TIMEOUT_ERROR) {
1505 - printf("PR_Accept() timeout worked!\n");
1506 - printf("TEST PASSED! PR_Accept() returned error %d\n",
1507 + printf("PR_Accept() timeout worked!\n"
1508 + "TEST PASSED! PR_Accept() returned error "
1509 + "PR_IO_TIMEOUT_ERROR (%ld)\n",
1510 PR_IO_TIMEOUT_ERROR);
1513 --- pr/tests/layer.c.orig 2015-10-16 13:22:19 UTC
1514 +++ pr/tests/layer.c
1515 @@ -45,7 +45,10 @@ static PRUint16 default_port = 12273;
1516 static PRFileDesc *PushLayer(PRFileDesc *stack)
1518 PRFileDesc *layer = PR_CreateIOLayerStub(identity, &myMethods);
1519 - PRStatus rv = PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
1520 +#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
1521 + PRStatus rv = /* we only need rv for PR_ASSERT() */
1523 + PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
1524 if (verbosity > quiet)
1525 PR_fprintf(logFile, "Pushed layer(0x%x) onto stack(0x%x)\n", layer, stack);
1526 PR_ASSERT(PR_SUCCESS == rv);
1527 --- pr/tests/lazyinit.c.orig 2015-10-16 13:22:19 UTC
1528 +++ pr/tests/lazyinit.c
1529 @@ -43,7 +43,6 @@ int main(int argc, char **argv)
1533 - PRCondVar *cv = NULL;
1534 PRThread *thread = NULL;
1535 PRIntervalTime interval = 0;
1536 PRFileDesc *file, *udp, *tcp, *pair[2];
1537 --- pr/tests/lltest.c.orig 2015-10-16 13:22:19 UTC
1538 +++ pr/tests/lltest.c
1539 @@ -545,6 +545,7 @@ TestConversion( void )
1544 static void ShiftCompileOnly()
1547 @@ -561,6 +562,7 @@ static void ShiftCompileOnly()
1548 LL_ISHL(ia, 49, 32);
1550 } /* ShiftCompileOnly */
1555 @@ -635,7 +637,6 @@ TestArithmetic( void )
1556 PRInt64 largeValPlusOne = LL_INIT( 0x00000002, 0x00000000 );
1557 PRInt64 largeValTimesTwo = LL_INIT( 0x00000003, 0xfffffffe );
1558 PRInt64 largeMultCand = LL_INIT( 0x00000000, 0x7fffffff );
1559 - PRInt64 largeMinusMultCand = LL_INIT( 0xffffffff, 0x10000001 );
1560 PRInt64 largeMultCandx64K = LL_INIT( 0x00007fff, 0xffff0000 );
1561 PRInt64 largeNumSHL5 = LL_INIT( 0x0000001f, 0xffffffe0 );
1562 PRInt64 result, result2;
1563 --- pr/tests/mbcs.c.orig 2015-10-16 13:22:19 UTC
1565 @@ -54,13 +54,12 @@ char *dirName = NULL; /* directory nam
1567 ** Traverse directory
1569 -static void TraverseDirectory( unsigned char *dir )
1570 +static void TraverseDirectory(const char *dir)
1573 PRDirEntry *dirEntry;
1580 @@ -81,16 +80,16 @@ static void TraverseDirectory( unsigned
1583 if ( PR_FILE_FILE == info.type ) {
1584 - printf("File: %s \tsize: %ld\n", dirEntry->name, info.size );
1585 + printf("File: %s \tsize: %ld\n", dirEntry->name, (long)info.size );
1586 fd = PR_Open( file, PR_RDONLY, 0 );
1588 printf("PR_Open() failed. Error: %ld, OSError: %ld\n",
1589 - PR_GetError(), PR_GetOSError());
1590 + (long)PR_GetError(), (long)PR_GetOSError());
1592 rc = PR_Close( fd );
1593 if ( PR_FAILURE == rc ) {
1594 printf("PR_Close() failed. Error: %ld, OSError: %ld\n",
1595 - PR_GetError(), PR_GetOSError());
1596 + (long)PR_GetError(), (long)PR_GetOSError());
1598 } else if ( PR_FILE_DIRECTORY == info.type ) {
1599 sprintf( nextDir, "%s/%s", dir, dirEntry->name );
1600 --- pr/tests/nbconn.c.orig 2015-10-16 13:22:19 UTC
1601 +++ pr/tests/nbconn.c
1602 @@ -54,8 +54,7 @@ int main(int argc, char **argv)
1604 PRSocketOptionData optData;
1605 const char *hostname = NULL;
1606 - PRIntn default_case, n, bytes_read, bytes_sent;
1607 - PRInt32 failed_already = 0;
1608 + PRIntn default_case, n;
1612 @@ -164,7 +163,7 @@ int main(int argc, char **argv)
1615 printf( "PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
1616 - PR_GetError(), PR_GetOSError());
1617 + (long)PR_GetError(), (long)PR_GetOSError());
1621 @@ -235,7 +234,7 @@ connection_success_test()
1622 PRThread *thr = NULL;
1624 char send_buf[DATA_BUF_SIZE], recv_buf[DATA_BUF_SIZE];
1625 - PRIntn default_case, n, bytes_read, bytes_sent;
1626 + PRIntn n, bytes_read, bytes_sent;
1627 PRIntn failed_already = 0;
1630 @@ -311,7 +310,7 @@ connection_success_test()
1634 - DPRINTF(("Created TCP_Server thread [0x%x]\n",thr));
1635 + DPRINTF(("Created TCP_Server thread [%p]\n", thr));
1637 pd.in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT;
1638 n = PR_Poll(&pd, 1, PR_INTERVAL_NO_TIMEOUT);
1639 @@ -390,7 +389,7 @@ connection_success_test()
1640 DPRINTF(("Data integrity verified\n"));
1642 fprintf(stderr,"PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
1643 - PR_GetError(), PR_GetOSError());
1644 + (long)PR_GetError(), (long)PR_GetOSError());
1648 @@ -496,7 +495,6 @@ connection_failure_test()
1651 if (PR_GetConnectStatus(&pd) == PR_SUCCESS) {
1653 fprintf(stderr,"PR_GetConnectStatus succeeded, expected to fail\n");
1656 --- pr/tests/nblayer.c.orig 2015-10-16 13:22:19 UTC
1657 +++ pr/tests/nblayer.c
1658 @@ -299,7 +299,7 @@ static PRStatus PR_CALLBACK MyClose(PRFi
1659 static PRInt16 PR_CALLBACK MyPoll(
1660 PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags)
1662 - PRInt16 my_flags, new_flags;
1663 + PRInt16 my_flags = -1, new_flags;
1664 PRFilePrivate *mine = (PRFilePrivate*)fd->secret;
1665 if (0 != (PR_POLL_READ & in_flags))
1667 @@ -342,7 +342,7 @@ static PRFileDesc * PR_CALLBACK MyAccept
1668 PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
1671 - PRFileDesc *newfd, *layer = fd;
1672 + PRFileDesc *newfd;
1673 PRFileDesc *newstack;
1674 PRFilePrivate *newsecret;
1676 @@ -428,6 +428,8 @@ static PRInt32 PR_CALLBACK MyRecv(
1677 mine->rcvinprogress = 0;
1678 return mine->rcvreq; /* << -- that's it! */
1680 + PR_ASSERT(!"How did I get this mine->rcvstate?");
1685 @@ -484,6 +486,8 @@ static PRInt32 PR_CALLBACK MySend(
1686 mine->xmtinprogress = 0;
1687 return mine->xmtreq; /* <<-- That's the one! */
1689 + PR_ASSERT(!"How did I get this mine->xmtstate?");
1694 --- pr/tests/nonblock.c.orig 2015-10-16 13:22:19 UTC
1695 +++ pr/tests/nonblock.c
1697 static void PR_CALLBACK
1698 clientThreadFunc(void *arg)
1700 - PRUintn port = (PRUintn)arg;
1701 + intptr_t port = (intptr_t)arg;
1704 char buf[CHUNK_SIZE];
1705 @@ -147,7 +147,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1708 clientThread = PR_CreateThread(PR_USER_THREAD,
1709 - clientThreadFunc, (void *) listenPort,
1710 + clientThreadFunc, (void *) (intptr_t)listenPort,
1711 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1712 PR_UNJOINABLE_THREAD, 0);
1713 if (clientThread == NULL) {
1714 @@ -191,7 +191,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1715 if (retVal != -1 || PR_GetError() != PR_WOULD_BLOCK_ERROR) {
1716 PL_PrintError("First Receive:\n");
1717 fprintf(stderr, "First PR_Recv: retVal: %ld, Error: %ld\n",
1718 - retVal, PR_GetError());
1719 + (long)retVal, (long)PR_GetError());
1722 printf("read: EWOULDBLOCK, good\n");
1723 @@ -201,7 +201,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1724 if (retVal != CHUNK_SIZE) {
1725 PL_PrintError("Second Receive:\n");
1726 fprintf(stderr, "Second PR_Recv: retVal: %ld, Error: %ld\n",
1727 - retVal, PR_GetError());
1728 + (long)retVal, (long)PR_GetError());
1731 printf("read: %d bytes, good\n", retVal);
1732 --- pr/tests/obsints.c.orig 2015-10-16 13:22:19 UTC
1733 +++ pr/tests/obsints.c
1734 @@ -25,6 +25,9 @@ int main(int argc, char **argv)
1735 #else /* NO_NSPR_10_SUPPORT */
1737 #include "prtypes.h" /* which includes protypes.h */
1738 +#if !defined(__GNUC__)
1742 int main(int argc, char **argv)
1744 @@ -32,17 +35,17 @@ int main(int argc, char **argv)
1745 * Compilation fails if any of these integer types are not
1746 * defined by protypes.h.
1760 + uintn uin __unused;
1763 + uint8 ui8 __unused;
1764 + int16 i16 __unused;
1765 + uint16 ui16 __unused;
1766 + int32 i32 __unused;
1767 + uint32 ui32 __unused;
1768 + int64 i64 __unused;
1769 + uint64 ui64 __unused;
1773 --- pr/tests/parsetm.c.orig 2015-10-16 13:22:19 UTC
1774 +++ pr/tests/parsetm.c
1775 @@ -31,8 +31,8 @@ static void PrintExplodedTime(const PREx
1777 /* Print day of the week, month, day, hour, minute, and second */
1778 if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
1779 - dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
1780 - et->tm_hour, et->tm_min, et->tm_sec);
1781 + dayOfWeek[et->tm_wday], month[et->tm_month], (long)et->tm_mday,
1782 + (long)et->tm_hour, (long)et->tm_min, (long)et->tm_sec);
1784 /* Print time zone */
1785 totalOffset = et->tm_params.tp_gmt_offset + et->tm_params.tp_dst_offset;
1786 @@ -47,7 +47,7 @@ static void PrintExplodedTime(const PREx
1787 hourOffset = totalOffset / 3600;
1788 minOffset = (totalOffset % 3600) / 60;
1790 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
1791 + printf("%s%02ld%02ld ", sign, (long)hourOffset, (long)minOffset);
1795 --- pr/tests/peek.c.orig 2015-10-16 13:22:19 UTC
1797 @@ -135,7 +135,7 @@ static void ClientNB(void *arg)
1800 PRSocketOptionData opt;
1801 - PRUint16 port = (PRUint16) arg;
1802 + PRUint16 port = (intptr_t) arg;
1804 char buf[BUFFER_SIZE];
1806 @@ -299,7 +299,7 @@ RunTest(PRThreadScope scope, PRFileDesc
1809 client = PR_CreateThread(
1810 - PR_USER_THREAD, ClientNB, (void *) port,
1811 + PR_USER_THREAD, ClientNB, (void *)(intptr_t) port,
1812 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
1813 if (NULL == client) {
1814 fprintf(stderr, "PR_CreateThread failed\n");
1815 --- pr/tests/perf.c.orig 2015-10-16 13:22:19 UTC
1817 @@ -141,7 +141,7 @@ static void PR_CALLBACK CXReader(void *a
1819 for (i = 0; i < n; i++) {
1821 - DPRINTF(("CXReader: thread = 0x%lx waiting\n",
1822 + DPRINTF(("CXReader: thread = %p waiting\n",
1823 PR_GetCurrentThread()));
1824 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
1826 @@ -154,7 +154,7 @@ static void PR_CALLBACK CXReader(void *a
1829 PR_ExitMonitor(mon2);
1830 - DPRINTF(("CXReader: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1831 + DPRINTF(("CXReader: thread = %p exiting\n", PR_GetCurrentThread()));
1834 static void PR_CALLBACK CXWriter(void *arg)
1835 @@ -165,7 +165,7 @@ static void PR_CALLBACK CXWriter(void *a
1837 for (i = 0; i < n; i++) {
1839 - DPRINTF(("CXWriter: thread = 0x%lx waiting\n",
1840 + DPRINTF(("CXWriter: thread = %p waiting\n",
1841 PR_GetCurrentThread()));
1842 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
1844 @@ -178,7 +178,7 @@ static void PR_CALLBACK CXWriter(void *a
1847 PR_ExitMonitor(mon2);
1848 - DPRINTF(("CXWriter: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1849 + DPRINTF(("CXWriter: thread = %p exiting\n", PR_GetCurrentThread()));
1852 static void ContextSwitch(PRThreadScope scope1, PRThreadScope scope2)
1853 @@ -198,7 +198,7 @@ static void ContextSwitch(PRThreadScope
1855 fprintf(stderr, "ContextSwitch: cannot create thread\n");
1857 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
1858 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
1859 (scope1 == PR_GLOBAL_THREAD ?
1860 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1862 @@ -212,7 +212,7 @@ static void ContextSwitch(PRThreadScope
1864 fprintf(stderr, "ContextSwitch: cannot create thread\n");
1866 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
1867 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
1868 (scope2 == PR_GLOBAL_THREAD ?
1869 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1871 @@ -254,10 +254,10 @@ static void PR_CALLBACK SemaThread(void
1874 for (i = 0; i < n; i++) {
1875 - DPRINTF(("SemaThread: thread = 0x%lx waiting on sem = 0x%lx\n",
1876 + DPRINTF(("SemaThread: thread = %p waiting on sem = %p\n",
1877 PR_GetCurrentThread(), sem[0]));
1879 - DPRINTF(("SemaThread: thread = 0x%lx posting on sem = 0x%lx\n",
1880 + DPRINTF(("SemaThread: thread = %p posting on sem = %p\n",
1881 PR_GetCurrentThread(), sem[1]));
1884 @@ -266,7 +266,7 @@ static void PR_CALLBACK SemaThread(void
1887 PR_ExitMonitor(mon2);
1888 - DPRINTF(("SemaThread: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1889 + DPRINTF(("SemaThread: thread = %p exiting\n", PR_GetCurrentThread()));
1892 static PRSemaphore *sem_set1[2];
1893 @@ -294,7 +294,7 @@ static void SemaContextSwitch(PRThreadSc
1895 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
1897 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
1898 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
1899 (scope1 == PR_GLOBAL_THREAD ?
1900 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1902 @@ -309,7 +309,7 @@ static void SemaContextSwitch(PRThreadSc
1904 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
1906 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
1907 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
1908 (scope2 == PR_GLOBAL_THREAD ?
1909 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1911 --- pr/tests/pipepong.c.orig 2015-10-16 13:22:19 UTC
1912 +++ pr/tests/pipepong.c
1913 @@ -36,7 +36,7 @@ int main(int argc, char **argv)
1914 nBytes = fread(buf, 1, 5, stdin);
1915 fprintf(stderr, "pong process: received \"%s\"\n", buf);
1917 - fprintf(stderr, "pong process: expected 5 bytes but got %d bytes\n",
1918 + fprintf(stderr, "pong process: expected 5 bytes but got %zd bytes\n",
1922 --- pr/tests/poll_nm.c.orig 2015-10-16 13:22:19 UTC
1923 +++ pr/tests/poll_nm.c
1924 @@ -47,7 +47,7 @@ PRIntn debug_mode;
1925 static void PR_CALLBACK
1926 clientThreadFunc(void *arg)
1928 - PRUintn port = (PRUintn) arg;
1929 + PRUintn port = (intptr_t) arg;
1933 @@ -196,7 +196,7 @@ int main(int argc, char **argv)
1936 clientThread = PR_CreateThread(PR_USER_THREAD,
1937 - clientThreadFunc, (void *) listenPort1,
1938 + clientThreadFunc, (void *)(intptr_t)listenPort1,
1939 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1940 PR_UNJOINABLE_THREAD, 0);
1941 if (clientThread == NULL) {
1942 @@ -206,7 +206,7 @@ int main(int argc, char **argv)
1945 clientThread = PR_CreateThread(PR_USER_THREAD,
1946 - clientThreadFunc, (void *) listenPort2,
1947 + clientThreadFunc, (void *)(intptr_t)listenPort2,
1948 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1949 PR_UNJOINABLE_THREAD, 0);
1950 if (clientThread == NULL) {
1951 --- pr/tests/prfz.c.orig 2015-10-16 13:22:19 UTC
1957 -#include <sys/types.h>
1958 +#include <stdint.h>
1962 --- pr/tests/provider.c.orig 2015-10-16 13:22:19 UTC
1963 +++ pr/tests/provider.c
1964 @@ -1049,7 +1049,7 @@ int main(int argc, char **argv)
1968 - CSClient_t *client;
1969 + CSClient_t *client = NULL;
1970 PRStatus rv, joinStatus;
1971 CSServer_t *server = NULL;
1973 --- pr/tests/prpoll.c.orig 2015-10-16 13:22:19 UTC
1974 +++ pr/tests/prpoll.c
1975 @@ -39,7 +39,7 @@ int main(int argc, char **argv)
1977 clientThreadFunc(void *arg)
1979 - PRUint16 port = (PRUint16) arg;
1980 + PRUint16 port = (PRUint16)(uintptr_t)arg;
1984 @@ -73,7 +73,7 @@ int main(int argc, char **argv)
1987 struct sockaddr_in saddr;
1989 + socklen_t saddr_len;
1990 PRUint16 listenPort3;
1991 PRFileDesc *socket_poll_fd;
1993 @@ -199,7 +199,7 @@ int main(int argc, char **argv)
1996 clientThread = PR_CreateThread(PR_USER_THREAD,
1997 - clientThreadFunc, (void *) listenPort1,
1998 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
1999 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2000 PR_UNJOINABLE_THREAD, 0);
2001 if (clientThread == NULL) {
2002 @@ -208,7 +208,7 @@ int main(int argc, char **argv)
2005 clientThread = PR_CreateThread(PR_USER_THREAD,
2006 - clientThreadFunc, (void *) listenPort2,
2007 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2008 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
2009 PR_UNJOINABLE_THREAD, 0);
2010 if (clientThread == NULL) {
2011 @@ -217,7 +217,7 @@ int main(int argc, char **argv)
2014 clientThread = PR_CreateThread(PR_USER_THREAD,
2015 - clientThreadFunc, (void *) listenPort3,
2016 + clientThreadFunc, (void *)(uintptr_t)listenPort3,
2017 PR_PRIORITY_NORMAL, PR_GLOBAL_BOUND_THREAD,
2018 PR_UNJOINABLE_THREAD, 0);
2019 if (clientThread == NULL) {
2020 --- pr/tests/randseed.c.orig 2015-10-16 13:22:19 UTC
2021 +++ pr/tests/randseed.c
2022 @@ -48,7 +48,6 @@ static void Help( void )
2023 static void PrintRand( void *buf, PRIntn size )
2028 printf("%4.4d--\n", size );
2030 --- pr/tests/ranfile.c.orig 2015-10-16 13:22:19 UTC
2031 +++ pr/tests/ranfile.c
2032 @@ -130,7 +130,7 @@ static void PR_CALLBACK Thread(void *arg
2033 PRStatus rv = PR_SUCCESS;
2034 Hammer_t *cd = (Hammer_t*)arg;
2036 - (void)sprintf(filename, "%ssg%04ld.dat", baseName, cd->id);
2037 + (void)sprintf(filename, "%ssg%04d.dat", baseName, (int)cd->id);
2039 if (debug_mode) printf("Starting work on %s\n", filename);
2041 @@ -364,14 +364,14 @@ int main(int argc, char **argv)
2044 if (debug_mode) printf(
2045 - "%s: test failed %s after %ld seconds\n",
2046 - programName, where[hammer[poll].problem], duration);
2047 + "%s: test failed %s after %d seconds\n",
2048 + programName, where[hammer[poll].problem], (int)duration);
2049 else failed_already=1;
2053 if (debug_mode) printf(
2054 - "%s: [%ld [%ld] %ld] writes/sec average\n",
2055 + "%s: [%d [%d] %d] writes/sec average\n",
2056 programName, writesMin, writesTot * 1000 / durationTot, writesMax);
2058 PR_DestroyCondVar(cv);
2059 --- pr/tests/runtests.sh.orig 2015-10-16 13:22:19 UTC
2060 +++ pr/tests/runtests.sh
2061 @@ -58,9 +58,6 @@ fi
2062 # Tests not run (but should)
2065 -#forktest (failed on IRIX)
2066 -#nbconn - fails on some platforms
2067 -#poll_er - fails on some platforms? limited use?
2068 #prpoll - the bad-FD test needs to be moved to a different test
2069 #sleep - specific to OS/2
2071 @@ -92,6 +89,7 @@ exit
2079 @@ -99,7 +97,6 @@ getproto
2087 @@ -120,6 +117,7 @@ logger
2095 @@ -136,6 +134,7 @@ perf
2103 @@ -208,7 +207,7 @@ OBJDIR=`basename $PWD`
2104 printf "\nNSPR Test Results - $OBJDIR\n\n"
2105 printf "BEGIN\t\t\t`date`\n"
2106 printf "NSPR_TEST_LOGFILE\t${LOGFILE}\n\n"
2107 -printf "Test\t\t\tResult\n\n"
2108 +printf " Test\t\t\tResult\n\n"
2109 if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_PLATFORM = "Windows_NT" ] || [ $OS_PLATFORM = "OS/2" ] ; then
2112 @@ -226,10 +225,8 @@ if [ $OS_PLATFORM = "Windows_95" ] || [
2117 - printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2119 - ./$prog >> ${LOGFILE} 2>&1 &
2121 + ./$prog >> $prog.output 2>&1 &
2124 if test -n "$TEST_TIMEOUT" && test "$TEST_TIMEOUT" -gt 0
2125 @@ -244,28 +241,11 @@ else
2126 printf "\t\t\tPassed\n";
2128 printf "\t\t\tFAILED\n";
2129 + sed "s,^, $prog: ," < $prog.output
2132 - printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2136 printf "END\t\t\t`date`\n"
2155 --- pr/tests/sel_spd.c.orig 2015-10-16 13:22:19 UTC
2156 +++ pr/tests/sel_spd.c
2161 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
2162 +# include <unistd.h> /* getopt(3) */
2168 #define PORT_BASE 19000
2170 typedef struct timer_slot_t {
2171 - unsigned long d_connect;
2172 - unsigned long d_cl_data;
2173 - unsigned long d_sv_data;
2174 - unsigned long d_close;
2175 - unsigned long d_total;
2176 - unsigned long requests;
2177 + unsigned int d_connect;
2178 + unsigned int d_cl_data;
2179 + unsigned int d_sv_data;
2180 + unsigned int d_close;
2181 + unsigned int d_total;
2182 + unsigned int requests;
2185 -static long _iterations = 5;
2186 -static long _client_data = 8192;
2187 +static int _iterations = 5;
2188 +static int _client_data = 8192;
2192 @@ -40,12 +43,11 @@ static long _client_data = 8192;
2193 * memory and not be able to allocate thread stack or client/server data
2196 -static long _server_data = (8*1024);
2197 -static long _threads_max = 10, _threads = 10;
2198 +static int _server_data = (8*1024);
2200 -static long _server_data = (128*1024);
2201 -static long _threads_max = 10, _threads = 10;
2202 +static int _server_data = (128*1024);
2204 +static int _threads_max = 10, _threads = 10;
2206 static int verbose=0;
2207 static PRMonitor *exit_cv;
2208 @@ -101,7 +103,7 @@ _server_thread(void *arg_id)
2209 void _client_thread(void *);
2211 int *id = (int *)arg_id;
2213 + PRFileDesc *sock = NULL;
2214 PRSocketOptionData sockopt;
2216 PRFileDesc * newsock;
2217 @@ -469,12 +471,12 @@ void
2218 tally_results(int verbose)
2221 - unsigned long tot_connect = 0;
2222 - unsigned long tot_cl_data = 0;
2223 - unsigned long tot_sv_data = 0;
2224 - unsigned long tot_close = 0;
2225 - unsigned long tot_all = 0;
2226 - unsigned long tot_requests = 0;
2227 + unsigned int tot_connect = 0;
2228 + unsigned int tot_cl_data = 0;
2229 + unsigned int tot_sv_data = 0;
2230 + unsigned int tot_close = 0;
2231 + unsigned int tot_all = 0;
2232 + unsigned int tot_requests = 0;
2234 fprintf(stdout, "Server results:\n\n");
2235 for (index=0; index<_threads_max*2; index+=2) {
2236 --- pr/tests/selct_nm.c.orig 2015-10-16 13:22:19 UTC
2237 +++ pr/tests/selct_nm.c
2238 @@ -45,7 +45,7 @@ PRIntn debug_mode;
2240 clientThreadFunc(void *arg)
2242 - PRUintn port = (PRUintn) arg;
2243 + PRUintn port = (PRUintn)(uintptr_t)arg;
2247 @@ -165,7 +165,7 @@ failed_already=1;
2248 if (debug_mode) printf("%s", buf);
2250 clientThread = PR_CreateThread(PR_USER_THREAD,
2251 - clientThreadFunc, (void *) listenPort1,
2252 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
2253 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2254 PR_UNJOINABLE_THREAD, 0);
2255 if (clientThread == NULL) {
2256 @@ -175,7 +175,7 @@ failed_already=1;
2259 clientThread = PR_CreateThread(PR_USER_THREAD,
2260 - clientThreadFunc, (void *) listenPort2,
2261 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2262 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2263 PR_UNJOINABLE_THREAD, 0);
2264 if (clientThread == NULL) {
2265 --- pr/tests/select2.c.orig 2015-10-16 13:22:19 UTC
2266 +++ pr/tests/select2.c
2267 @@ -53,6 +53,7 @@ PRInt32 count;
2269 ***********************************************************************/
2271 +static int exitcode = 2;
2273 static void Test_Result (int result)
2275 @@ -60,9 +61,12 @@ static void Test_Result (int result)
2279 + if (exitcode == 2)
2287 printf ("NOSTATUS\n");
2288 @@ -319,4 +323,5 @@ int main(int argc, char **argv)
2294 --- pr/tests/semaerr.c.orig 2015-10-16 13:22:19 UTC
2295 +++ pr/tests/semaerr.c
2296 @@ -65,7 +65,7 @@ int main(int argc, char **argv)
2299 if (PR_GetError() != PR_FILE_NOT_FOUND_ERROR) {
2300 - fprintf(stderr, "Expected error is %d but got (%d, %d)\n",
2301 + fprintf(stderr, "Expected error is %ld (PR_FILE_NOT_FOUND_ERROR) but got (%d, %d)\n",
2302 PR_FILE_NOT_FOUND_ERROR, PR_GetError(), PR_GetOSError());
2305 --- pr/tests/semaerr1.c.orig 2015-10-16 13:22:19 UTC
2306 +++ pr/tests/semaerr1.c
2307 @@ -75,7 +75,7 @@ int main(int argc, char **argv)
2310 if (PR_GetError() != PR_FILE_EXISTS_ERROR) {
2311 - fprintf(stderr, "Expect %d but got %d\n", PR_FILE_EXISTS_ERROR,
2312 + fprintf(stderr, "Expected %ld (PR_FILE_EXISTS_ERROR) but got %d\n", PR_FILE_EXISTS_ERROR,
2316 --- pr/tests/sendzlf.c.orig 2015-10-16 13:22:19 UTC
2317 +++ pr/tests/sendzlf.c
2318 @@ -26,7 +26,7 @@ static void ClientThread(void *arg)
2322 - PRUint16 port = (PRUint16) arg;
2323 + PRUint16 port = (PRUint16)(uintptr_t)arg;
2327 @@ -184,7 +184,7 @@ int main(int argc, char **argv)
2330 clientThread = PR_CreateThread(PR_USER_THREAD,
2331 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
2332 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
2333 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
2334 if (NULL == clientThread) {
2335 fprintf(stderr, "PR_CreateThread failed\n");
2336 --- pr/tests/server_test.c.orig 2015-10-16 13:22:19 UTC
2337 +++ pr/tests/server_test.c
2338 @@ -60,7 +60,7 @@ PRCondVar *ServerStateCV;
2340 #define DPRINTF printf
2343 +#define DPRINTF(...)
2347 @@ -502,6 +502,7 @@ static void do_workUU(void)
2352 static void do_workUK(void)
2354 ServerScope = PR_LOCAL_THREAD;
2355 @@ -522,6 +523,7 @@ static void do_workKK(void)
2356 ClientScope = PR_GLOBAL_THREAD;
2362 static void Measure(void (*func)(void), const char *msg)
2363 --- pr/tests/servr_kk.c.orig 2015-10-16 13:22:19 UTC
2364 +++ pr/tests/servr_kk.c
2365 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2367 #define DPRINTF printf
2370 +#define DPRINTF(...)
2373 PRIntn failed_already=0;
2374 @@ -472,6 +472,7 @@ void do_work()
2375 PR_JoinThread(ServerThread);
2379 static void do_workUU(void)
2381 ServerScope = PR_LOCAL_THREAD;
2382 @@ -492,6 +493,7 @@ static void do_workKU(void)
2383 ClientScope = PR_LOCAL_THREAD;
2388 static void do_workKK(void)
2390 --- pr/tests/servr_ku.c.orig 2015-10-16 13:22:19 UTC
2391 +++ pr/tests/servr_ku.c
2392 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2394 #define DPRINTF printf
2397 +#define DPRINTF(...)
2400 PRIntn failed_already=0;
2401 --- pr/tests/servr_uk.c.orig 2015-10-16 13:22:19 UTC
2402 +++ pr/tests/servr_uk.c
2403 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2405 #define DPRINTF printf
2408 +#define DPRINTF(...)
2411 PRIntn failed_already=0;
2412 --- pr/tests/servr_uu.c.orig 2015-10-16 13:22:19 UTC
2413 +++ pr/tests/servr_uu.c
2414 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2416 #define DPRINTF printf
2419 +#define DPRINTF(...)
2422 PRIntn failed_already=0;
2423 --- pr/tests/short_thread.c.orig 2015-10-16 13:22:19 UTC
2424 +++ pr/tests/short_thread.c
2425 @@ -43,8 +43,8 @@ int main (int argc, char **argv)
2426 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0))
2429 - "simple_test: Error - PR_CreateThread failed: (%ld, %ld)\n",
2430 - PR_GetError(), PR_GetOSError());
2431 + "simple_test: Error - PR_CreateThread failed: (%d, %d)\n",
2432 + PR_GetError(), PR_GetOSError());
2436 --- pr/tests/socket.c.orig 2015-10-16 13:22:19 UTC
2437 +++ pr/tests/socket.c
2438 @@ -103,13 +103,15 @@ char *LARGE_FILE_NAME = "/tmp/prsocket_t
2441 static PRInt32 num_tcp_clients = NUM_TCP_CLIENTS;
2442 -static PRInt32 num_udp_clients = NUM_UDP_CLIENTS;
2443 static PRInt32 num_transmitfile_clients = NUM_TRANSMITFILE_CLIENTS;
2444 static PRInt32 num_tcp_connections_per_client = NUM_TCP_CONNECTIONS_PER_CLIENT;
2445 static PRInt32 tcp_mesg_size = TCP_MESG_SIZE;
2446 static PRInt32 num_tcp_mesgs_per_connection = NUM_TCP_MESGS_PER_CONNECTION;
2447 +#if defined(SYMBIAN) && !defined(__WINSCW__)
2448 +static PRInt32 num_udp_clients = NUM_UDP_CLIENTS;
2449 static PRInt32 num_udp_datagrams_per_client = NUM_UDP_DATAGRAMS_PER_CLIENT;
2450 static PRInt32 udp_datagram_size = UDP_DGRAM_SIZE;
2453 static PRInt32 thread_count;
2454 PRUint16 server_domain = PR_AF_INET, client_domain = PR_AF_INET;
2455 @@ -181,19 +183,23 @@ readn(PRFileDesc *sockfd, char *buf, int
2462 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
2465 timeout = PR_SecondsToInterval(2);
2467 for (rem=len; rem; offset += bytes, rem -= bytes) {
2468 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
2469 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
2470 PR_GetCurrentThread(), rem));
2474 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
2476 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
2477 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
2478 PR_GetCurrentThread(), bytes));
2481 @@ -224,11 +230,11 @@ writen(PRFileDesc *sockfd, char *buf, in
2484 for (rem=len; rem; offset += bytes, rem -= bytes) {
2485 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
2486 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
2487 PR_GetCurrentThread(), rem));
2488 bytes = PR_Send(sockfd, buf + offset, rem, 0,
2489 PR_INTERVAL_NO_TIMEOUT);
2490 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
2491 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
2492 PR_GetCurrentThread(), bytes));
2495 @@ -279,7 +285,7 @@ Serve_Client(void *arg)
2496 fprintf(stderr,"prsocket_test: ERROR - PR_Shutdown\n");
2499 - DPRINTF(("Serve_Client [0x%lx]: inbuf[0] = 0x%lx\n",PR_GetCurrentThread(),
2500 + DPRINTF(("Serve_Client [%p]: inbuf[0] = %d\n",PR_GetCurrentThread(),
2501 (*((int *) in_buf->data))));
2502 if (writen(sockfd, in_buf->data, bytes) < bytes) {
2503 fprintf(stderr,"prsocket_test: ERROR - Serve_Client:writen\n");
2504 @@ -418,7 +424,7 @@ TCP_Server(void *arg)
2508 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2509 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2510 netaddr.inet.ip, netaddr.inet.port));
2511 if (PR_SetNetAddr(PR_IpAddrLoopback, client_domain,
2512 PR_ntohs(PR_NetAddrInetPort(&netaddr)),
2513 @@ -460,7 +466,7 @@ TCP_Server(void *arg)
2514 scp->datalen = sp->datalen;
2516 t = create_new_thread(PR_USER_THREAD,
2517 - Serve_Client, (void *)scp,
2518 + Serve_Client, (void *)scp,
2521 PR_UNJOINABLE_THREAD,
2522 @@ -470,7 +476,7 @@ TCP_Server(void *arg)
2526 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", t));
2527 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", t));
2531 @@ -486,9 +492,10 @@ exit:
2532 --(*sp->exit_counter);
2533 PR_Notify(sp->exit_mon);
2534 PR_ExitMonitor(sp->exit_mon);
2535 - DPRINTF(("TCP_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2536 + DPRINTF(("TCP_Server [%p] exiting\n", PR_GetCurrentThread()));
2539 +#if defined(SYMBIAN) && !defined(__WINSCW__)
2543 @@ -544,7 +551,7 @@ UDP_Server(void *arg)
2547 - DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2548 + DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2549 netaddr.inet.ip, netaddr.inet.port));
2551 * We can't use the IP address returned by PR_GetSockName in
2552 @@ -582,13 +589,13 @@ UDP_Server(void *arg)
2554 memset(&netaddr, 0 , sizeof(netaddr));
2555 for (i = 0; i < (num_udp_clients * num_udp_datagrams_per_client); i++) {
2556 - DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
2557 + DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
2558 netaddr.inet.ip, netaddr.inet.port, bytes, in_buf->data,
2561 rv = PR_RecvFrom(sockfd, in_buf->data, bytes, 0, &netaddr,
2562 PR_INTERVAL_NO_TIMEOUT);
2563 - DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
2564 + DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
2565 netaddr.inet.ip, netaddr.inet.port, rv, in_buf->data,
2568 @@ -611,8 +618,9 @@ UDP_Server(void *arg)
2569 --(*sp->exit_counter);
2570 PR_Notify(sp->exit_mon);
2571 PR_ExitMonitor(sp->exit_mon);
2572 - DPRINTF(("UDP_Server [0x%x] exiting\n", PR_GetCurrentThread()));
2573 + DPRINTF(("UDP_Server [%p] exiting\n", PR_GetCurrentThread()));
2575 +#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */
2579 @@ -655,7 +663,7 @@ TCP_Client(void *arg)
2581 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0){
2582 fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
2583 - PR_GetError(), PR_GetOSError());
2584 + (long)PR_GetError(), (long)PR_GetOSError());
2588 @@ -663,7 +671,7 @@ TCP_Client(void *arg)
2590 * fill in random data
2592 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
2593 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
2597 @@ -676,7 +684,7 @@ TCP_Client(void *arg)
2601 - DPRINTF(("TCP Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
2602 + DPRINTF(("TCP Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
2603 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
2604 if (readn(sockfd, in_buf->data, bytes) < bytes) {
2605 fprintf(stderr,"prsocket_test: ERROR - TCP_Client:readn\n");
2606 @@ -716,13 +724,14 @@ TCP_Client(void *arg)
2607 --(*cp->exit_counter);
2608 PR_Notify(cp->exit_mon);
2609 PR_ExitMonitor(cp->exit_mon);
2610 - DPRINTF(("TCP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
2611 + DPRINTF(("TCP_Client [%p] exiting\n", PR_GetCurrentThread()));
2614 +#if defined(SYMBIAN) && !defined(__WINSCW__)
2618 - * Create a socket and bind an address
2619 + * Create a socket and bind an address
2620 * Communicate with the server at the address specified in the argument.
2621 * Fill in a buffer, write data to server, read it back and check
2622 * for data corruption.
2623 @@ -780,7 +789,7 @@ UDP_Client(void *arg)
2627 - DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2628 + DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2629 netaddr.inet.ip, netaddr.inet.port));
2631 netaddr = cp->server_addr;
2632 @@ -797,9 +806,9 @@ UDP_Client(void *arg)
2634 * fill in random data
2636 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx bytes = 0x%lx\n",
2637 + DPRINTF(("UDP_Client [%p]: out_buf = %p bytes = %d\n",
2638 PR_GetCurrentThread(), out_buf->data, bytes));
2639 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i, bytes);
2640 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i, bytes);
2644 @@ -812,7 +821,7 @@ UDP_Client(void *arg)
2648 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
2649 + DPRINTF(("UDP_Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
2650 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
2651 if (cp->udp_connect)
2652 rv = PR_Recv(sockfd, in_buf->data, bytes, 0,
2653 @@ -823,7 +832,7 @@ UDP_Client(void *arg)
2657 - DPRINTF(("UDP_Client [0x%lx]: in_buf = 0x%lx in_buf[0] = 0x%lx\n",
2658 + DPRINTF(("UDP_Client [%p]: in_buf = %p in_buf[0] = 0x%x\n",
2659 PR_GetCurrentThread(), in_buf, (*((int *) in_buf->data))));
2661 * verify the data read
2662 @@ -848,12 +857,13 @@ UDP_Client(void *arg)
2663 PR_Notify(cp->exit_mon);
2664 PR_ExitMonitor(cp->exit_mon);
2666 - DPRINTF(("UDP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
2667 + DPRINTF(("UDP_Client [%p] exiting\n", PR_GetCurrentThread()));
2669 +#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */
2672 * TCP_Socket_Client_Server_Test - concurrent server test
2675 * One server and several clients are started
2676 * Each client connects to the server and sends a chunk of data
2677 * For each connection, server starts another thread to read the data
2678 @@ -905,7 +915,7 @@ TCP_Socket_Client_Server_Test(void)
2679 sparamp->exit_counter = &thread_count;
2680 sparamp->datalen = datalen;
2681 t = PR_CreateThread(PR_USER_THREAD,
2682 - TCP_Server, (void *)sparamp,
2683 + TCP_Server, (void *)sparamp,
2686 PR_UNJOINABLE_THREAD,
2687 @@ -915,7 +925,7 @@ TCP_Socket_Client_Server_Test(void)
2691 - DPRINTF(("Created TCP server = 0x%lx\n", t));
2692 + DPRINTF(("Created TCP server = %p\n", t));
2696 @@ -949,7 +959,7 @@ TCP_Socket_Client_Server_Test(void)
2700 - DPRINTF(("Created TCP client = 0x%lx\n", t));
2701 + DPRINTF(("Created TCP client = %p\n", t));
2704 /* Wait for server and client threads to exit */
2705 @@ -959,17 +969,18 @@ TCP_Socket_Client_Server_Test(void)
2707 PR_ExitMonitor(mon2);
2708 printf("%30s","TCP_Socket_Client_Server_Test:");
2709 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
2710 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
2711 num_tcp_clients, num_tcp_connections_per_client);
2712 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
2713 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
2714 num_tcp_mesgs_per_connection, tcp_mesg_size);
2719 +#if defined(SYMBIAN) && !defined(__WINSCW__)
2721 * UDP_Socket_Client_Server_Test - iterative server test
2724 * One server and several clients are started
2725 * Each client connects to the server and sends a chunk of data
2726 * For each connection, server starts another thread to read the data
2727 @@ -1023,7 +1034,7 @@ UDP_Socket_Client_Server_Test(void)
2728 sparamp->datalen = datalen;
2729 DPRINTF(("Creating UDP server"));
2730 t = PR_CreateThread(PR_USER_THREAD,
2731 - UDP_Server, (void *)sparamp,
2732 + UDP_Server, (void *)sparamp,
2735 PR_UNJOINABLE_THREAD,
2736 @@ -1084,12 +1095,13 @@ UDP_Socket_Client_Server_Test(void)
2738 PR_ExitMonitor(mon2);
2739 printf("%30s","UDP_Socket_Client_Server_Test: ");
2740 - printf("%2ld Server %2ld Clients\n",1l, num_udp_clients);
2741 - printf("%30s %2ld datagrams_per_client %4ld bytes_per_datagram\n",":",
2742 + printf(" 1 Server %2d Clients\n", num_udp_clients);
2743 + printf("%30s %2d datagrams_per_client %4d bytes_per_datagram\n",":",
2744 num_udp_datagrams_per_client, udp_datagram_size);
2748 +#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */
2750 static PRFileDesc *small_file_fd, *large_file_fd;
2751 static void *small_file_addr, *small_file_header, *large_file_addr;
2752 @@ -1441,7 +1453,7 @@ TransmitFile_Client(void *arg)
2753 --(*cp->exit_counter);
2754 PR_Notify(cp->exit_mon);
2755 PR_ExitMonitor(cp->exit_mon);
2756 - DPRINTF(("TransmitFile_Client [0x%lx] exiting\n", PR_GetCurrentThread()));
2757 + DPRINTF(("TransmitFile_Client [%p] exiting\n", PR_GetCurrentThread()));
2761 @@ -1484,7 +1496,7 @@ Serve_TransmitFile_Client(void *arg)
2762 if (bytes != (SMALL_FILE_SIZE+ SMALL_FILE_HEADER_SIZE)) {
2764 "prsocet_test: PR_TransmitFile failed: (%ld, %ld)\n",
2765 - PR_GetError(), PR_GetOSError());
2766 + (long)PR_GetError(), (long)PR_GetOSError());
2769 bytes = PR_TransmitFile(sockfd, local_large_file_fd, NULL, 0,
2770 @@ -1492,7 +1504,7 @@ Serve_TransmitFile_Client(void *arg)
2771 if (bytes != LARGE_FILE_SIZE) {
2773 "prsocket_test: PR_TransmitFile failed: (%ld, %ld)\n",
2774 - PR_GetError(), PR_GetOSError());
2775 + (long)PR_GetError(), (long)PR_GetOSError());
2779 @@ -1520,7 +1532,7 @@ Serve_TransmitFile_Client(void *arg)
2782 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2783 - PR_GetError(), PR_GetOSError());
2784 + (long)PR_GetError(), (long)PR_GetOSError());
2788 @@ -1544,7 +1556,7 @@ Serve_TransmitFile_Client(void *arg)
2791 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2792 - PR_GetError(), PR_GetOSError());
2793 + (long)PR_GetError(), (long)PR_GetOSError());
2797 @@ -1566,7 +1578,7 @@ Serve_TransmitFile_Client(void *arg)
2800 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2801 - PR_GetError(), PR_GetOSError());
2802 + (long)PR_GetError(), (long)PR_GetOSError());
2806 @@ -1588,7 +1600,7 @@ Serve_TransmitFile_Client(void *arg)
2809 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2810 - PR_GetError(), PR_GetOSError());
2811 + (long)PR_GetError(), (long)PR_GetOSError());
2815 @@ -1610,7 +1622,7 @@ Serve_TransmitFile_Client(void *arg)
2818 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2819 - PR_GetError(), PR_GetOSError());
2820 + (long)PR_GetError(), (long)PR_GetOSError());
2824 @@ -1632,7 +1644,7 @@ Serve_TransmitFile_Client(void *arg)
2827 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2828 - PR_GetError(), PR_GetOSError());
2829 + (long)PR_GetError(), (long)PR_GetOSError());
2833 @@ -1654,7 +1666,7 @@ Serve_TransmitFile_Client(void *arg)
2836 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2837 - PR_GetError(), PR_GetOSError());
2838 + (long)PR_GetError(), (long)PR_GetOSError());
2842 @@ -1678,7 +1690,7 @@ Serve_TransmitFile_Client(void *arg)
2845 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2846 - PR_GetError(), PR_GetOSError());
2847 + (long)PR_GetError(), (long)PR_GetOSError());
2851 @@ -1752,7 +1764,7 @@ TransmitFile_Server(void *arg)
2855 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2856 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2857 netaddr.inet.ip, netaddr.inet.port));
2858 tcp_server_addr.inet.family = netaddr.inet.family;
2859 tcp_server_addr.inet.port = netaddr.inet.port;
2860 @@ -1807,7 +1819,7 @@ TransmitFile_Server(void *arg)
2861 scp->datalen = sp->datalen;
2863 t[i] = PR_CreateThread(PR_USER_THREAD,
2864 - Serve_TransmitFile_Client, (void *)scp,
2865 + Serve_TransmitFile_Client, (void *)scp,
2869 @@ -1818,7 +1830,7 @@ TransmitFile_Server(void *arg)
2873 - DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = 0x%lx\n", t));
2874 + DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = %p\n", t));
2878 @@ -1846,12 +1858,12 @@ exit:
2879 --(*sp->exit_counter);
2880 PR_Notify(sp->exit_mon);
2881 PR_ExitMonitor(sp->exit_mon);
2882 - DPRINTF(("TransmitFile_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2883 + DPRINTF(("TransmitFile_Server [%p] exiting\n", PR_GetCurrentThread()));
2887 - * Socket_Misc_Test - test miscellaneous functions
2889 + * Socket_Misc_Test - test miscellaneous functions
2893 Socket_Misc_Test(void)
2894 @@ -1986,7 +1998,7 @@ Socket_Misc_Test(void)
2896 "prsocket_test failed to write to file %s: (%ld, %ld)\n",
2898 - PR_GetError(), PR_GetOSError());
2899 + (long)PR_GetError(), (long)PR_GetOSError());
2903 @@ -2065,7 +2077,7 @@ Socket_Misc_Test(void)
2904 sparamp->exit_counter = &thread_count;
2905 sparamp->datalen = datalen;
2906 t = PR_CreateThread(PR_USER_THREAD,
2907 - TransmitFile_Server, (void *)sparamp,
2908 + TransmitFile_Server, (void *)sparamp,
2911 PR_UNJOINABLE_THREAD,
2912 @@ -2076,7 +2088,7 @@ Socket_Misc_Test(void)
2916 - DPRINTF(("Created TCP server = 0x%x\n", t));
2917 + DPRINTF(("Created TCP server = %p\n", t));
2921 @@ -2113,7 +2125,7 @@ Socket_Misc_Test(void)
2925 - DPRINTF(("Created TransmitFile client = 0x%lx\n", t));
2926 + DPRINTF(("Created TransmitFile client = %p\n", t));
2929 /* Wait for server and client threads to exit */
2930 @@ -2144,7 +2156,7 @@ done:
2932 if ((PR_RmDir(TEST_DIR)) == PR_FAILURE) {
2933 fprintf(stderr,"prsocket_test failed to rmdir %s: (%ld, %ld)\n",
2934 - TEST_DIR, PR_GetError(), PR_GetOSError());
2935 + TEST_DIR, (long)PR_GetError(), (long)PR_GetOSError());
2939 --- pr/tests/sprintf.c.orig 2015-10-16 13:22:19 UTC
2940 +++ pr/tests/sprintf.c
2941 @@ -127,7 +127,7 @@ static void test_l(char *pattern, char *
2942 (strncmp(s, sbuf, sizeof(sbuf)) != 0)) {
2944 "pattern='%s' l=%ld\nPR_smprintf='%s'\nPR_snprintf='%s'\n sprintf='%s'\n",
2945 - pattern, l, s, buf, sbuf);
2946 + pattern, (long)l, s, buf, sbuf);
2947 PR_smprintf_free(s);
2950 --- pr/tests/stack.c.orig 2015-10-16 13:22:19 UTC
2951 +++ pr/tests/stack.c
2952 @@ -54,7 +54,7 @@ PRFileDesc *errhandle;
2953 int main(int argc, char **argv)
2955 #if !(defined(SYMBIAN) && defined(__WINS__))
2956 - PRInt32 rv, cnt, sum;
2959 PRStack *list1, *list2;
2961 @@ -209,7 +209,7 @@ int main(int argc, char **argv)
2962 static void stackop(void *thread_arg)
2964 PRInt32 val, cnt, index, loops;
2965 - DataRecord *Items, *Item;
2966 + DataRecord *Items;
2967 PRStack *list1, *list2;
2969 stack_data *arg = (stack_data *) thread_arg;
2970 --- pr/tests/suspend.c.orig 2015-10-16 13:22:19 UTC
2971 +++ pr/tests/suspend.c
2972 @@ -30,14 +30,14 @@ void PR_CALLBACK
2973 Level_2_Thread(void *arg)
2975 PR_Sleep(PR_MillisecondsToInterval(4 * 1000));
2976 - printf("Level_2_Thread[0x%lx] exiting\n",PR_GetCurrentThread());
2977 + printf("Level_2_Thread[%p] exiting\n",PR_GetCurrentThread());
2982 Level_1_Thread(void *arg)
2984 - PRUint32 tmp = (PRUint32)arg;
2985 + PRUint32 tmp = (PRUint32)(uintptr_t)arg;
2986 PRThreadScope scope = (PRThreadScope) tmp;
2989 @@ -52,7 +52,7 @@ Level_1_Thread(void *arg)
2991 printf("Could not create thread!\n");
2993 - printf("Level_1_Thread[0x%lx] created %15s thread 0x%lx\n",
2994 + printf("Level_1_Thread[%p] created %15s thread %p\n",
2995 PR_GetCurrentThread(),
2996 (scope == PR_GLOBAL_THREAD) ?
2997 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
2998 @@ -63,7 +63,7 @@ Level_1_Thread(void *arg)
3001 PR_ExitMonitor(mon);
3002 - printf("Thread[0x%lx] exiting\n",PR_GetCurrentThread());
3003 + printf("Thread[%p] exiting\n",PR_GetCurrentThread());
3006 static PRStatus PR_CALLBACK print_thread(PRThread *thread, int i, void *arg)
3007 @@ -72,14 +72,15 @@ static PRStatus PR_CALLBACK print_thread
3011 - "\nprint_thread[0x%lx]: %-20s - i = %ld\n",thread,
3012 + "\nprint_thread[%p]: %-20s - i = %ld\n",thread,
3013 (PR_GLOBAL_THREAD == PR_GetThreadScope(thread)) ?
3014 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", i);
3015 registers = PR_GetGCRegisters(thread, 0, (int *)&words);
3017 - printf("Registers R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
3018 - registers[0],registers[1],registers[2],registers[3]);
3019 - printf("Stack Pointer = 0x%lx\n", PR_GetSP(thread));
3020 + printf("Regsters R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
3021 + (unsigned long)registers[0], (unsigned long)registers[1],
3022 + (unsigned long)registers[2], (unsigned long)registers[3]);
3023 + printf("Stack Pointer = %p\n", PR_GetSP(thread));
3027 @@ -107,7 +108,7 @@ static void Level_0_Thread(PRThreadScope
3028 printf("Could not create thread!\n");
3031 - printf("Level_0_Thread[0x%lx] created %15s thread 0x%lx\n",
3032 + printf("Level_0_Thread[%p] created %15s thread %p\n",
3033 PR_GetCurrentThread(),
3034 (scope1 == PR_GLOBAL_THREAD) ?
3035 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
3036 @@ -119,9 +120,10 @@ static void Level_0_Thread(PRThreadScope
3037 PR_EnumerateThreads(print_thread, NULL);
3038 registers = PR_GetGCRegisters(me, 1, (int *)&words);
3040 - printf("My Registers: R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
3041 - registers[0],registers[1],registers[2],registers[3]);
3042 - printf("My Stack Pointer = 0x%lx\n", PR_GetSP(me));
3043 + printf("My Registers: R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
3044 + (unsigned long)registers[0], (unsigned long)registers[1],
3045 + (unsigned long)registers[2], (unsigned long)registers[3]);
3046 + printf("My Stack Pointer = %p\n", PR_GetSP(me));
3049 /* Wait for all threads to exit */
3050 --- pr/tests/switch.c.orig 2015-10-16 13:22:19 UTC
3051 +++ pr/tests/switch.c
3052 @@ -80,7 +80,7 @@ PRIntn PR_CALLBACK Switch(PRIntn argc, c
3054 PRBool help = PR_FALSE;
3055 PRUintn concurrency = 1;
3056 - Shared *shared, *link;
3057 + Shared *shared = NULL, *link;
3058 PRIntervalTime timein, timeout;
3059 PRThreadScope thread_scope = PR_LOCAL_THREAD;
3060 PRUintn thread_count, inner_count, loop_count, average;
3061 --- pr/tests/testfile.c.orig 2015-10-16 13:22:19 UTC
3062 +++ pr/tests/testfile.c
3063 @@ -36,6 +36,9 @@ static int _debug_on = 0;
3067 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
3068 +# include <unistd.h> /* getopt(3) */
3071 #define DPRINTF(arg) if (_debug_on) printf arg
3073 @@ -93,7 +96,7 @@ static PRInt32 PR_CALLBACK DirTest(void
3074 PRInt32 dirtest_failed = 0;
3076 PRThread* create_new_thread(PRThreadType type,
3077 - void (*start)(void *arg),
3078 + void *(*start)(void *arg),
3080 PRThreadPriority priority,
3081 PRThreadScope scope,
3082 @@ -155,7 +158,7 @@ PRInt32 native_thread = 0;
3083 return((PRThread *) thandle);
3086 - return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3087 + return(PR_CreateThread(type,(void (*)(void*))start,arg,priority,scope,state,stackSize));
3090 return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3091 @@ -316,8 +319,8 @@ char tmpname[1024];
3093 "testfile PR_GetFileInfo returned incorrect status-change time: %s\n",
3095 - printf("ft = %lld, ft1 = %lld\n",file_info.creationTime,
3096 - file_info1.creationTime);
3097 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.creationTime,
3098 + (long long)file_info1.creationTime);
3102 @@ -342,8 +345,8 @@ char tmpname[1024];
3104 "testfile PR_GetFileInfo returned incorrect modify time: %s\n",
3106 - printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime,
3107 - file_info1.modifyTime);
3108 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.modifyTime,
3109 + (long long)file_info1.modifyTime);
3113 @@ -469,7 +472,7 @@ File_Rdwr_Param *fparamp;
3114 memset(fparamp->buf, i, len);
3116 t = create_new_thread(PR_USER_THREAD,
3117 - File_Write, (void *)fparamp,
3118 + (void *(*)(void *))File_Write, (void *)fparamp,
3121 PR_UNJOINABLE_THREAD,
3122 @@ -504,7 +507,7 @@ File_Rdwr_Param *fparamp;
3125 t = create_new_thread(PR_USER_THREAD,
3126 - File_Read, (void *)fparamp,
3127 + (void *(*)(void *))File_Read, (void *)fparamp,
3130 PR_UNJOINABLE_THREAD,
3131 @@ -572,7 +575,7 @@ struct dirtest_arg thrarg;
3134 t = create_new_thread(PR_USER_THREAD,
3136 + (void *(*)(void *))DirTest, &thrarg,
3139 PR_UNJOINABLE_THREAD,
3140 @@ -895,8 +898,6 @@ int main(int argc, char **argv)
3142 #if defined(XP_UNIX) || defined(XP_OS2)
3144 - extern char *optarg;
3145 - extern int optind;
3147 #if defined(XP_UNIX) || defined(XP_OS2)
3148 while ((opt = getopt(argc, argv, "d")) != EOF) {
3149 --- pr/tests/threads.c.orig 2015-10-16 13:22:19 UTC
3150 +++ pr/tests/threads.c
3151 @@ -27,7 +27,7 @@ void
3153 DumbThread(void *arg)
3155 - PRInt32 tmp = (PRInt32)arg;
3156 + PRInt32 tmp = (PRInt32)(intptr_t)arg;
3157 PRThreadScope scope = (PRThreadScope)tmp;
3160 @@ -167,10 +167,10 @@ int main(int argc, char **argv)
3165 -** Tests lots of thread creations. \n\
3166 -** Create %ld native threads %ld times. \n\
3167 -** Create %ld user threads %ld times \n", iterations,count,iterations,count);
3168 + printf("** Tests lots of thread creations.\n"
3169 + "** Create %d native threads %d times.\n"
3170 + "** Create %d user threads %d times.\n", iterations, count,
3171 + iterations, count);
3174 for (index=0; index<iterations; index++) {
3175 --- pr/tests/thrpool_client.c.orig 2015-10-16 13:22:19 UTC
3176 +++ pr/tests/thrpool_client.c
3177 @@ -82,11 +82,11 @@ readn(PRFileDesc *sockfd, char *buf, int
3178 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
3180 for (rem=len; rem; offset += bytes, rem -= bytes) {
3181 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
3182 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
3183 PR_GetCurrentThread(), rem));
3184 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
3186 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
3187 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
3188 PR_GetCurrentThread(), bytes));
3191 @@ -107,11 +107,11 @@ writen(PRFileDesc *sockfd, char *buf, in
3194 for (rem=len; rem; offset += bytes, rem -= bytes) {
3195 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
3196 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
3197 PR_GetCurrentThread(), rem));
3198 bytes = PR_Send(sockfd, buf + offset, rem, 0,
3199 PR_INTERVAL_NO_TIMEOUT);
3200 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
3201 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
3202 PR_GetCurrentThread(), bytes));
3205 @@ -164,7 +164,7 @@ TCP_Client(void *arg)
3207 DPRINTF(("TCP client connecting to server:%d\n", server_port));
3208 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0){
3209 - fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
3210 + fprintf(stderr, "PR_Connect failed: (%d, %d)\n",
3211 PR_GetError(), PR_GetOSError());
3214 @@ -173,7 +173,7 @@ TCP_Client(void *arg)
3216 * fill in random data
3218 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
3219 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
3223 @@ -281,7 +281,7 @@ TCP_Socket_Client_Server_Test(void)
3224 PR_EnterMonitor(mon2);
3226 PR_ExitMonitor(mon2);
3227 - DPRINTF(("Created TCP client = 0x%lx\n", thr));
3228 + DPRINTF(("Created TCP client = %p\n", thr));
3230 /* Wait for client jobs to exit */
3231 PR_EnterMonitor(mon2);
3232 @@ -291,9 +291,9 @@ TCP_Socket_Client_Server_Test(void)
3234 PR_ExitMonitor(mon2);
3235 printf("%30s","TCP_Socket_Client_Server_Test:");
3236 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3237 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3238 num_tcp_clients, num_tcp_connections_per_client);
3239 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3240 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3241 num_tcp_mesgs_per_connection, tcp_mesg_size);
3244 --- pr/tests/thrpool_server.c.orig 2015-10-16 13:22:19 UTC
3245 +++ pr/tests/thrpool_server.c
3246 @@ -329,7 +329,7 @@ TCP_Server(void *arg)
3250 - "TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3251 + "TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3252 netaddr.inet.ip, netaddr.inet.port));
3254 sp = PR_NEW(Server_Param);
3255 @@ -341,7 +341,7 @@ TCP_Server(void *arg)
3256 sp->iod.socket = sockfd;
3257 sp->iod.timeout = PR_SecondsToInterval(60);
3258 sp->datalen = tcp_mesg_size;
3259 - sp->exit_mon = sc_mon;
3260 + sp->exit_mon = NULL;
3261 sp->job_counterp = &job_counter;
3262 sp->conn_counter = 0;
3264 @@ -464,7 +464,7 @@ TCP_Server_Accept(void *arg)
3267 PR_ASSERT(NULL != jobp);
3268 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", jobp));
3269 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", jobp));
3272 * single-threaded update; no lock needed
3273 @@ -481,7 +481,7 @@ TCP_Server_Accept(void *arg)
3274 print_stats, sp, PR_FALSE);
3276 PR_ASSERT(NULL != jobp);
3277 - DPRINTF(("TCP_Server: Created print_stats timer job = 0x%lx\n", jobp));
3278 + DPRINTF(("TCP_Server: Created print_stats timer job = %p\n", jobp));
3281 PR_EnterMonitor(sp->exit_mon);
3282 @@ -498,9 +498,9 @@ exit:
3284 PR_DestroyMonitor(sp->exit_mon);
3285 printf("%30s","TCP_Socket_Client_Server_Test:");
3286 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3287 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3288 num_tcp_clients, num_tcp_connections_per_client);
3289 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3290 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3291 num_tcp_mesgs_per_connection, tcp_mesg_size);
3293 DPRINTF(("%s: calling PR_ShutdownThreadPool\n", program_name));
3294 --- pr/tests/thruput.c.orig 2015-10-16 13:22:19 UTC
3295 +++ pr/tests/thruput.c
3296 @@ -66,7 +66,7 @@ static void PR_CALLBACK Clientel(void *a
3300 - PRInt32 bytes, sampled;
3301 + PRInt32 bytes, sampled = -1;
3302 PRIntervalTime now, interval;
3303 PRBool do_display = PR_FALSE;
3304 Shared *shared = (Shared*)arg;
3305 @@ -175,7 +175,7 @@ static void Client(const char *server_na
3307 static void PR_CALLBACK Servette(void *arg)
3309 - PRInt32 bytes, sampled;
3310 + PRInt32 bytes, sampled = -1;
3311 PRIntervalTime now, interval;
3312 PRBool do_display = PR_FALSE;
3313 PRFileDesc *client = (PRFileDesc*)arg;
3314 @@ -373,6 +373,7 @@ int main(int argc, char **argv)
3315 else Client(server_name);
3322 --- pr/tests/timemac.c.orig 2015-10-16 13:22:19 UTC
3323 +++ pr/tests/timemac.c
3324 @@ -24,7 +24,7 @@ static void printExplodedTime(const PREx
3327 /* Print day of the week, month, day, hour, minute, and second */
3328 - printf( "%s %s %ld %02ld:%02ld:%02ld ",
3329 + printf( "%s %s %d %02d:%02d:%02d ",
3330 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3331 et->tm_hour, et->tm_min, et->tm_sec);
3333 @@ -40,7 +40,7 @@ static void printExplodedTime(const PREx
3335 hourOffset = totalOffset / 3600;
3336 minOffset = (totalOffset % 3600) / 60;
3337 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3338 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3342 @@ -97,7 +97,7 @@ int main(int argc, char** argv)
3343 printf("Current local time is ");
3344 printExplodedTime(&et);
3346 - printf("GMT offset is %ld, DST offset is %ld\n",
3347 + printf("GMT offset is %d, DST offset is %d\n",
3348 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3349 t2 = PR_ImplodeTime(&et);
3350 if (LL_NE(t1, t2)) {
3351 --- pr/tests/timetest.c.orig 2015-10-16 13:22:19 UTC
3352 +++ pr/tests/timetest.c
3353 @@ -36,7 +36,7 @@ static void PrintExplodedTime(const PREx
3356 /* Print day of the week, month, day, hour, minute, and second */
3357 - if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
3358 + if (debug_mode) printf("%s %s %d %02d:%02d:%02d ",
3359 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3360 et->tm_hour, et->tm_min, et->tm_sec);
3362 @@ -53,7 +53,7 @@ static void PrintExplodedTime(const PREx
3363 hourOffset = totalOffset / 3600;
3364 minOffset = (totalOffset % 3600) / 60;
3366 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3367 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3371 @@ -232,7 +232,7 @@ int main(int argc, char** argv)
3372 if (debug_mode) printf("Current local time is ");
3373 PrintExplodedTime(&et);
3374 if (debug_mode) printf("\n");
3375 - if (debug_mode) printf("GMT offset is %ld, DST offset is %ld\n",
3376 + if (debug_mode) printf("GMT offset is %d, DST offset is %d\n",
3377 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3378 t2 = PR_ImplodeTime(&et);
3379 if (LL_NE(t1, t2)) {
3380 --- pr/tests/y2k.c.orig 2015-10-16 13:22:19 UTC
3382 @@ -43,7 +43,7 @@ static void PrintExplodedTime(const PREx
3385 /* Print day of the week, month, day, hour, minute, and second */
3386 - printf("%s %s %2ld %02ld:%02ld:%02ld ",
3387 + printf("%s %s %2d %02d:%02d:%02d ",
3388 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3389 et->tm_hour, et->tm_min, et->tm_sec);
3391 @@ -62,7 +62,7 @@ static void PrintExplodedTime(const PREx
3393 hourOffset = totalOffset / 3600;
3394 minOffset = (totalOffset % 3600) / 60;
3395 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3396 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3398 #ifdef PRINT_DETAILS
3399 printf("{%d, %d, %d, %d, %d, %d, %d, %d, %d, { %d, %d}}\n",et->tm_usec,
3400 --- pr/tests/y2ktmo.c.orig 2015-10-16 13:22:19 UTC
3401 +++ pr/tests/y2ktmo.c
3402 @@ -70,7 +70,7 @@ static struct _timeb start_time_tb;
3404 static void SleepThread(void *arg)
3406 - PRIntervalTime timeout = (PRIntervalTime) arg;
3407 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3408 PRIntervalTime elapsed;
3409 #if defined(XP_UNIX) || defined(WIN32)
3410 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3411 @@ -121,7 +121,7 @@ static void SleepThread(void *arg)
3413 static void AcceptThread(void *arg)
3415 - PRIntervalTime timeout = (PRIntervalTime) arg;
3416 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3417 PRIntervalTime elapsed;
3418 #if defined(XP_UNIX) || defined(WIN32)
3419 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3420 @@ -197,7 +197,7 @@ static void AcceptThread(void *arg)
3422 static void PollThread(void *arg)
3424 - PRIntervalTime timeout = (PRIntervalTime) arg;
3425 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3426 PRIntervalTime elapsed;
3427 #if defined(XP_UNIX) || defined(WIN32)
3428 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3429 @@ -276,7 +276,7 @@ static void PollThread(void *arg)
3431 static void WaitCondVarThread(void *arg)
3433 - PRIntervalTime timeout = (PRIntervalTime) arg;
3434 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3435 PRIntervalTime elapsed;
3436 #if defined(XP_UNIX) || defined(WIN32)
3437 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3438 @@ -340,7 +340,7 @@ static void WaitCondVarThread(void *arg)
3440 static void WaitMonitorThread(void *arg)
3442 - PRIntervalTime timeout = (PRIntervalTime) arg;
3443 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3444 PRIntervalTime elapsed;
3445 #if defined(XP_UNIX) || defined(WIN32)
3446 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3447 @@ -397,7 +397,7 @@ static void WaitMonitorThread(void *arg)
3449 static void WaitCMonitorThread(void *arg)
3451 - PRIntervalTime timeout = (PRIntervalTime) arg;
3452 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3453 PRIntervalTime elapsed;
3454 #if defined(XP_UNIX) || defined(WIN32)
3455 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3456 @@ -528,7 +528,7 @@ int main(int argc, char **argv)
3457 for (i = 0; i < num_thread_scopes; i++) {
3458 for (j = 0; j < num_thread_funcs; j++) {
3459 threads[idx] = PR_CreateThread(PR_USER_THREAD, threadFuncs[j],
3460 - (void*)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3461 + (void*)(intptr_t)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3462 threadScopes[i], PR_JOINABLE_THREAD, 0);
3463 if (threads[idx] == NULL) {
3464 fprintf(stderr, "PR_CreateThread failed\n");
3465 --- pr/tests/zerolen.c.orig 2015-10-16 13:22:19 UTC
3466 +++ pr/tests/zerolen.c
3467 @@ -45,7 +45,7 @@ static void ClientThread(void *arg)
3471 - PRUint16 port = (PRUint16) arg;
3472 + PRUint16 port = (PRUint16)(uintptr_t)arg;
3476 @@ -127,7 +127,7 @@ int main()
3477 * First test PR_Writev.
3479 clientThread = PR_CreateThread(PR_USER_THREAD,
3480 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3481 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3482 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3483 if (NULL == clientThread) {
3484 fprintf(stderr, "PR_CreateThread failed\n");
3485 @@ -171,7 +171,7 @@ int main()
3486 * Then test PR_Write.
3488 clientThread = PR_CreateThread(PR_USER_THREAD,
3489 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3490 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3491 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3492 if (NULL == clientThread) {
3493 fprintf(stderr, "PR_CreateThread failed\n");
3494 @@ -216,7 +216,7 @@ int main()
3495 * Finally test PR_Send.
3497 clientThread = PR_CreateThread(PR_USER_THREAD,
3498 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3499 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3500 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3501 if (NULL == clientThread) {
3502 fprintf(stderr, "PR_CreateThread failed\n");
3505 [FILE:2133:patches/patch-warnings]
3506 --- pr/include/prcountr.h.orig 2015-10-16 13:22:19 UTC
3507 +++ pr/include/prcountr.h
3508 @@ -394,7 +394,7 @@ NSPR_API(void)
3509 #define PR_GET_COUNTER(counter,handle)\
3510 (counter) = PR_GetCounter((handle))
3512 -#define PR_GET_COUNTER(counter,handle) 0
3513 +#define PR_GET_COUNTER(counter,handle)
3517 @@ -468,7 +468,7 @@ NSPR_API(void)
3518 #define PR_FIND_NEXT_COUNTER_QNAME(next,handle)\
3519 (next) = PR_FindNextCounterQname((handle))
3521 -#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
3522 +#define PR_FIND_NEXT_COUNTER_QNAME(next,handle)
3525 NSPR_API(PRCounterHandle)
3526 --- pr/src/misc/pralarm.c.orig 2015-10-16 13:22:19 UTC
3527 +++ pr/src/misc/pralarm.c
3528 @@ -101,7 +101,7 @@ static void PR_CALLBACK pr_alarmNotifier
3530 while (why != abort)
3532 - PRIntervalTime pause;
3533 + PRIntervalTime pause = 0;
3535 PR_Lock(alarm->lock);
3537 --- pr/src/misc/prdtoa.c.orig 2015-10-16 13:22:19 UTC
3538 +++ pr/src/misc/prdtoa.c
3539 @@ -2751,7 +2751,7 @@ dtoa
3540 to hold the suppressed trailing zeros.
3543 - int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
3544 + int bbits, b2, b5, be, dig, i, ieps, ilim = -1, ilim0, ilim1 = -1,
3545 j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3546 spec_case, try_quick;
3548 --- pr/src/pthreads/ptio.c.orig 2015-10-16 13:22:19 UTC
3549 +++ pr/src/pthreads/ptio.c
3550 @@ -4934,6 +4934,7 @@ PR_IMPLEMENT(PRInt32) PR_Select(
3552 if (timeout == PR_INTERVAL_NO_TIMEOUT) {
3554 + start = 0; /* Not needed, but shuts down a warning */
3556 tv.tv_sec = (PRInt32)PR_IntervalToSeconds(timeout);
3557 tv.tv_usec = (PRInt32)PR_IntervalToMicroseconds(
3558 --- pr/src/pthreads/ptsynch.c.orig 2015-10-16 13:22:19 UTC
3559 +++ pr/src/pthreads/ptsynch.c
3560 @@ -30,7 +30,7 @@ static pthread_t pt_zero_tid; /* a null
3561 #endif /* defined(_PR_DCETHREADS) */
3562 #endif /* defined(DEBUG) */
3564 -#if defined(FREEBSD)
3565 +#if defined(FREEBSD) && (defined(DEBUG) || defined(FORCE_PR_ASSERT))
3567 * On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
3568 * Newer versions return EBUSY. We still need to support both.
3571 [FILE:1620:dragonfly/patch-nsprpub_configure]
3572 --- configure.intermediate 2015-11-29 10:31:49 UTC
3574 @@ -6661,6 +6661,27 @@ tools are selected during the Xcode/Deve
3579 + if test -z "$USE_NSPR_THREADS"; then
3582 + $as_echo "#define XP_UNIX 1" >>confdefs.h
3584 + $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
3586 + $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
3588 + CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
3592 + MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
3594 + DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
3595 + MDCPUCFG_H=_dragonfly.cfg
3596 + PR_MD_CSRCS=freebsd.c
3600 if test -z "$USE_NSPR_THREADS"; then
3602 @@ -8284,7 +8305,7 @@ $as_echo_n "checking whether ${CC-cc} ac
3603 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3604 ac_cv_have_dash_pthread=yes
3605 case "$target_os" in
3607 + freebsd*|dragonfly*)
3608 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3611 @@ -8322,7 +8343,7 @@ $as_echo "$ac_cv_have_dash_pthreads" >&6
3616 + *-freebsd*|*-dragonfly*)
3617 $as_echo "#define _REENTRANT 1" >>confdefs.h
3619 $as_echo "#define _THREAD_SAFE 1" >>confdefs.h
3620 @@ -8410,7 +8431,7 @@ case "$target" in
3625 +*-freebsd*|*dragonfly*)
3626 if test -n "$USE_NSPR_THREADS"; then
3627 $as_echo "#define _PR_LOCAL_THREADS_ONLY 1" >>confdefs.h
3631 [FILE:6239:dragonfly/patch-nsprpub_pr_include_md___dragonfly.cfg]
3632 --- pr/include/md/_dragonfly.cfg.orig 2013-06-06 16:24:16.620788000 +0000
3633 +++ pr/include/md/_dragonfly.cfg
3635 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3636 +/* This Source Code Form is subject to the terms of the Mozilla Public
3637 + * License, v. 2.0. If a copy of the MPL was not distributed with this
3638 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
3640 +#ifndef nspr_cpucfg___
3641 +#define nspr_cpucfg___
3647 +#define PR_AF_INET6 28 /* same as AF_INET6 */
3649 +#ifndef HAVE_LONG_LONG
3650 +#define HAVE_LONG_LONG
3653 +#if defined(__i386__)
3655 +#define IS_LITTLE_ENDIAN 1
3656 +#undef IS_BIG_ENDIAN
3657 +#undef HAVE_ALIGNED_DOUBLES
3658 +#undef HAVE_ALIGNED_LONGLONGS
3660 +#define PR_BYTES_PER_BYTE 1
3661 +#define PR_BYTES_PER_SHORT 2
3662 +#define PR_BYTES_PER_INT 4
3663 +#define PR_BYTES_PER_INT64 8
3664 +#define PR_BYTES_PER_LONG 4
3665 +#define PR_BYTES_PER_FLOAT 4
3666 +#define PR_BYTES_PER_DOUBLE 8
3667 +#define PR_BYTES_PER_WORD 4
3668 +#define PR_BYTES_PER_DWORD 8
3669 +#define PR_BYTES_PER_WORD_LOG2 2
3670 +#define PR_BYTES_PER_DWORD_LOG2 3
3672 +#define PR_BITS_PER_BYTE 8
3673 +#define PR_BITS_PER_SHORT 16
3674 +#define PR_BITS_PER_INT 32
3675 +#define PR_BITS_PER_INT64 64
3676 +#define PR_BITS_PER_LONG 32
3677 +#define PR_BITS_PER_FLOAT 32
3678 +#define PR_BITS_PER_DOUBLE 64
3679 +#define PR_BITS_PER_WORD 32
3681 +#define PR_BITS_PER_BYTE_LOG2 3
3682 +#define PR_BITS_PER_SHORT_LOG2 4
3683 +#define PR_BITS_PER_INT_LOG2 5
3684 +#define PR_BITS_PER_INT64_LOG2 6
3685 +#define PR_BITS_PER_LONG_LOG2 5
3686 +#define PR_BITS_PER_FLOAT_LOG2 5
3687 +#define PR_BITS_PER_DOUBLE_LOG2 6
3688 +#define PR_BITS_PER_WORD_LOG2 5
3690 +#define PR_ALIGN_OF_SHORT 2
3691 +#define PR_ALIGN_OF_INT 4
3692 +#define PR_ALIGN_OF_LONG 4
3693 +#define PR_ALIGN_OF_INT64 4
3694 +#define PR_ALIGN_OF_FLOAT 4
3695 +#define PR_ALIGN_OF_DOUBLE 4
3696 +#define PR_ALIGN_OF_POINTER 4
3698 +#elif defined(__alpha__)
3700 +#define IS_LITTLE_ENDIAN 1
3701 +#undef IS_BIG_ENDIAN
3702 +#define HAVE_ALIGNED_DOUBLES
3703 +#define HAVE_ALIGNED_LONGLONGS
3706 +#define PR_BYTES_PER_BYTE 1
3707 +#define PR_BYTES_PER_SHORT 2
3708 +#define PR_BYTES_PER_INT 4
3709 +#define PR_BYTES_PER_INT64 8
3710 +#define PR_BYTES_PER_LONG 8
3711 +#define PR_BYTES_PER_FLOAT 4
3712 +#define PR_BYTES_PER_DOUBLE 8
3713 +#define PR_BYTES_PER_WORD 8
3714 +#define PR_BYTES_PER_DWORD 8
3715 +#define PR_BYTES_PER_WORD_LOG2 3
3716 +#define PR_BYTES_PER_DWORD_LOG2 3
3718 +#define PR_BITS_PER_BYTE 8
3719 +#define PR_BITS_PER_SHORT 16
3720 +#define PR_BITS_PER_INT 32
3721 +#define PR_BITS_PER_INT64 64
3722 +#define PR_BITS_PER_LONG 64
3723 +#define PR_BITS_PER_FLOAT 32
3724 +#define PR_BITS_PER_DOUBLE 64
3725 +#define PR_BITS_PER_WORD 64
3727 +#define PR_BITS_PER_BYTE_LOG2 3
3728 +#define PR_BITS_PER_SHORT_LOG2 4
3729 +#define PR_BITS_PER_INT_LOG2 5
3730 +#define PR_BITS_PER_INT64_LOG2 6
3731 +#define PR_BITS_PER_LONG_LOG2 6
3732 +#define PR_BITS_PER_FLOAT_LOG2 5
3733 +#define PR_BITS_PER_DOUBLE_LOG2 6
3734 +#define PR_BITS_PER_WORD_LOG2 6
3736 +#define PR_ALIGN_OF_SHORT 2
3737 +#define PR_ALIGN_OF_INT 4
3738 +#define PR_ALIGN_OF_LONG 8
3739 +#define PR_ALIGN_OF_INT64 8
3740 +#define PR_ALIGN_OF_FLOAT 4
3741 +#define PR_ALIGN_OF_DOUBLE 8
3742 +#define PR_ALIGN_OF_POINTER 8
3744 +#elif defined(__amd64__)
3746 +#define IS_LITTLE_ENDIAN 1
3747 +#undef IS_BIG_ENDIAN
3748 +#define HAVE_ALIGNED_DOUBLES
3749 +#define HAVE_ALIGNED_LONGLONGS
3752 +#define PR_BYTES_PER_BYTE 1
3753 +#define PR_BYTES_PER_SHORT 2
3754 +#define PR_BYTES_PER_INT 4
3755 +#define PR_BYTES_PER_INT64 8
3756 +#define PR_BYTES_PER_LONG 8
3757 +#define PR_BYTES_PER_FLOAT 4
3758 +#define PR_BYTES_PER_DOUBLE 8
3759 +#define PR_BYTES_PER_WORD 8
3760 +#define PR_BYTES_PER_DWORD 8
3761 +#define PR_BYTES_PER_WORD_LOG2 3
3762 +#define PR_BYTES_PER_DWORD_LOG2 3
3764 +#define PR_BITS_PER_BYTE 8
3765 +#define PR_BITS_PER_SHORT 16
3766 +#define PR_BITS_PER_INT 32
3767 +#define PR_BITS_PER_INT64 64
3768 +#define PR_BITS_PER_LONG 64
3769 +#define PR_BITS_PER_FLOAT 32
3770 +#define PR_BITS_PER_DOUBLE 64
3771 +#define PR_BITS_PER_WORD 64
3773 +#define PR_BITS_PER_BYTE_LOG2 3
3774 +#define PR_BITS_PER_SHORT_LOG2 4
3775 +#define PR_BITS_PER_INT_LOG2 5
3776 +#define PR_BITS_PER_INT64_LOG2 6
3777 +#define PR_BITS_PER_LONG_LOG2 6
3778 +#define PR_BITS_PER_FLOAT_LOG2 5
3779 +#define PR_BITS_PER_DOUBLE_LOG2 6
3780 +#define PR_BITS_PER_WORD_LOG2 6
3782 +#define PR_ALIGN_OF_SHORT 2
3783 +#define PR_ALIGN_OF_INT 4
3784 +#define PR_ALIGN_OF_LONG 8
3785 +#define PR_ALIGN_OF_INT64 8
3786 +#define PR_ALIGN_OF_FLOAT 4
3787 +#define PR_ALIGN_OF_DOUBLE 8
3788 +#define PR_ALIGN_OF_POINTER 8
3789 +#define PR_ALIGN_OF_WORD 8
3793 +#error "Unknown CPU architecture"
3797 +#ifndef NO_NSPR_10_SUPPORT
3799 +#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
3800 +#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
3801 +#define BYTES_PER_INT PR_BYTES_PER_INT
3802 +#define BYTES_PER_INT64 PR_BYTES_PER_INT64
3803 +#define BYTES_PER_LONG PR_BYTES_PER_LONG
3804 +#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
3805 +#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
3806 +#define BYTES_PER_WORD PR_BYTES_PER_WORD
3807 +#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
3809 +#define BITS_PER_BYTE PR_BITS_PER_BYTE
3810 +#define BITS_PER_SHORT PR_BITS_PER_SHORT
3811 +#define BITS_PER_INT PR_BITS_PER_INT
3812 +#define BITS_PER_INT64 PR_BITS_PER_INT64
3813 +#define BITS_PER_LONG PR_BITS_PER_LONG
3814 +#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
3815 +#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
3816 +#define BITS_PER_WORD PR_BITS_PER_WORD
3818 +#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
3819 +#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
3820 +#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
3821 +#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
3822 +#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
3823 +#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
3824 +#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
3825 +#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
3827 +#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
3828 +#define ALIGN_OF_INT PR_ALIGN_OF_INT
3829 +#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
3830 +#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
3831 +#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
3832 +#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
3833 +#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
3834 +#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
3836 +#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
3837 +#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
3838 +#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
3840 +#endif /* NO_NSPR_10_SUPPORT */
3842 +#endif /* nspr_cpucfg___ */
3845 [FILE:6235:dragonfly/patch-nsprpub_pr_include_md___dragonfly.h]
3846 --- pr/include/md/_dragonfly.h.orig 2013-06-06 18:49:02.829118000 +0000
3847 +++ pr/include/md/_dragonfly.h
3849 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3850 +/* This Source Code Form is subject to the terms of the Mozilla Public
3851 + * License, v. 2.0. If a copy of the MPL was not distributed with this
3852 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
3854 +#ifndef nspr_dragonfly_defs_h___
3855 +#define nspr_dragonfly_defs_h___
3857 +#include "prthread.h"
3860 +#if __FreeBSD__ >= 2
3861 +#include <osreldate.h> /* for __FreeBSD_version */
3863 +#include <sys/syscall.h>
3866 +#define PR_LINKER_ARCH "dragonfly"
3867 +#define _PR_SI_SYSNAME "DRAGONFLY"
3868 +#if defined(__i386__)
3869 +#define _PR_SI_ARCHITECTURE "x86"
3870 +#elif defined(__amd64__)
3871 +#define _PR_SI_ARCHITECTURE "amd64"
3873 +#error "Unknown CPU architecture"
3876 +#define PR_DLL_SUFFIX ".so"
3878 +#define _PR_VMBASE 0x30000000
3879 +#define _PR_STACK_VMBASE 0x50000000
3880 +#define _MD_DEFAULT_STACK_SIZE 65536L
3881 +#define _MD_MMAP_FLAGS MAP_PRIVATE
3883 +#undef HAVE_STACK_GROWING_UP
3886 +#define _PR_HAVE_SOCKADDR_LEN
3887 +#define _PR_STAT_HAS_ST_ATIMESPEC
3888 +#define _PR_HAVE_LARGE_OFF_T
3890 +#define _PR_HAVE_GETPROTO_R
3891 +#define _PR_HAVE_5_ARG_GETPROTO_R
3892 +#define _PR_HAVE_GETHOST_R
3893 +#define _PR_HAVE_GETHOST_R_INT
3895 +#define _PR_POLL_AVAILABLE
3897 +#define _PR_HAVE_SYSV_SEMAPHORES
3898 +#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
3901 +#define _PR_HAVE_INET_NTOP
3902 +#define _PR_HAVE_GETHOSTBYNAME2
3903 +#define _PR_HAVE_GETADDRINFO
3904 +#define _PR_INET6_PROBE
3905 +#define _PR_IPV6_V6ONLY_PROBE
3909 +#ifndef _PR_PTHREADS
3910 +#include <setjmp.h>
3912 +#define PR_CONTEXT_TYPE sigjmp_buf
3914 +#define CONTEXT(_th) ((_th)->md.context)
3916 +#define _MD_GET_SP(_th) (_th)->md.context[0]._sjb[2]
3917 +#define PR_NUM_GCREGS _JBLEN
3920 +** Initialize a thread context to run "_main()" when started
3922 +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
3924 + *status = PR_TRUE; \
3925 + if (sigsetjmp(CONTEXT(_thread), 1)) { \
3928 + _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
3931 +#define _MD_SWITCH_CONTEXT(_thread) \
3932 + if (!sigsetjmp(CONTEXT(_thread), 1)) { \
3933 + (_thread)->md.errcode = errno; \
3938 +** Restore a thread context, saved by _MD_SWITCH_CONTEXT
3940 +#define _MD_RESTORE_CONTEXT(_thread) \
3942 + errno = (_thread)->md.errcode; \
3943 + _MD_SET_CURRENT_THREAD(_thread); \
3944 + siglongjmp(CONTEXT(_thread), 1); \
3947 +/* Machine-dependent (MD) data structures */
3950 + PR_CONTEXT_TYPE context;
3955 +struct _MDThreadStack {
3963 +struct _MDSemaphore {
3971 +struct _MDSegment {
3976 + * md-specific cpu structure field
3978 +#define _PR_MD_MAX_OSFD FD_SETSIZE
3980 +struct _MDCPU_Unix {
3982 + PRUint32 ioq_timeout;
3983 + PRInt32 ioq_max_osfd;
3984 + PRInt32 ioq_osfd_cnt;
3985 +#ifndef _PR_USE_POLL
3986 + fd_set fd_read_set, fd_write_set, fd_exception_set;
3987 + PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
3988 + fd_exception_cnt[_PR_MD_MAX_OSFD];
3990 + struct pollfd *ioq_pollfds;
3991 + int ioq_pollfds_size;
3992 +#endif /* _PR_USE_POLL */
3995 +#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
3996 +#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
3997 +#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
3998 +#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
3999 +#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
4000 +#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
4001 +#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
4002 +#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
4003 +#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
4004 +#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
4005 +#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
4006 +#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
4007 +#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
4009 +#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
4012 + struct _MDCPU_Unix md_unix;
4015 +#define _MD_INIT_LOCKS()
4016 +#define _MD_NEW_LOCK(lock) PR_SUCCESS
4017 +#define _MD_FREE_LOCK(lock)
4018 +#define _MD_LOCK(lock)
4019 +#define _MD_UNLOCK(lock)
4020 +#define _MD_INIT_IO()
4021 +#define _MD_IOQ_LOCK()
4022 +#define _MD_IOQ_UNLOCK()
4024 +extern PRStatus _MD_InitializeThread(PRThread *thread);
4026 +#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
4027 +#define _MD_INIT_THREAD _MD_InitializeThread
4028 +#define _MD_EXIT_THREAD(thread)
4029 +#define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread
4030 +#define _MD_RESUME_THREAD(thread) _MD_resume_thread
4031 +#define _MD_CLEAN_THREAD(_thread)
4033 +extern PRStatus _MD_CREATE_THREAD(
4035 + void (*start) (void *),
4036 + PRThreadPriority priority,
4037 + PRThreadScope scope,
4038 + PRThreadState state,
4039 + PRUint32 stackSize);
4040 +extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
4041 +extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
4042 +extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
4043 +extern void _MD_YIELD(void);
4045 +#endif /* ! _PR_PTHREADS */
4047 +extern void _MD_EarlyInit(void);
4049 +#define _MD_EARLY_INIT _MD_EarlyInit
4050 +#define _MD_FINAL_INIT _PR_UnixInit
4051 +#define _MD_INTERVAL_USE_GTOD
4054 + * We wrapped the select() call. _MD_SELECT refers to the built-in,
4055 + * unwrapped version.
4057 +#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
4059 +#if defined(_PR_POLL_AVAILABLE)
4061 +#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
4064 +/* freebsd has INADDR_LOOPBACK defined, but in /usr/include/rpc/types.h, and I didn't
4065 + want to be including that.. */
4066 +#ifndef INADDR_LOOPBACK
4067 +#define INADDR_LOOPBACK (u_long)0x7F000001
4071 +#include <sys/uio.h>
4073 +#endif /* nspr_freebsd_defs_h___ */
4076 [FILE:895:dragonfly/patch-nsprpub_pr_include_md__freebsd.h]
4077 --- pr/include/md/_freebsd.h.intermediate 2014-06-20 12:34:59.566379000 +0000
4078 +++ pr/include/md/_freebsd.h
4080 #define _PR_HAVE_GETHOST_R
4081 #define _PR_HAVE_GETHOST_R_INT
4083 -#if __FreeBSD_version >= 400008
4084 +#if defined(__DragonFly__) || __FreeBSD_version >= 400008
4086 * libc_r before this version of FreeBSD doesn't have poll().
4087 * Although libc has poll(), it is not thread-safe so we can't
4089 #define _PR_POLL_AVAILABLE
4092 -#if __FreeBSD_version >= 300000
4093 +#if defined(__DragonFly__) || __FreeBSD_version >= 300000
4094 #define _PR_POLL_AVAILABLE
4095 #define _PR_USE_POLL
4098 #define _PR_HAVE_SYSV_SEMAPHORES
4099 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
4101 -#if __FreeBSD_version >= 400014
4102 +#if defined(__DragonFly__) || __FreeBSD_version >= 400014
4104 #define _PR_HAVE_INET_NTOP
4105 #define _PR_HAVE_GETHOSTBYNAME2
4108 [FILE:1399:dragonfly/patch-nsprpub_pr_include_md__pth.h]
4109 --- pr/include/md/_pth.h.orig 2014-06-05 21:42:08.000000000 +0000
4110 +++ pr/include/md/_pth.h
4112 #define _PT_PTHREAD_COPY_THR_HANDLE(st, dt) (dt) = (st)
4113 #elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \
4114 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4115 - || defined(HPUX) || defined(FREEBSD) \
4116 + || defined(HPUX) || defined(FREEBSD) || defined(__DragonFly__) \
4117 || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
4118 || defined(NTO) || defined(DARWIN) \
4119 || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN)
4121 #endif /* defined(_PR_DCETHREADS) */
4123 #elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4124 - || defined(FREEBSD) || defined(SYMBIAN)
4125 + || defined(FREEBSD) || defined(SYMBIAN) || defined(__DragonFly__)
4126 #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
4127 #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
4129 @@ -260,6 +260,7 @@ extern int (*_PT_aix_yield_fcn)();
4130 #elif defined(HPUX) || defined(SOLARIS) \
4131 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4132 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
4133 + || defined(__DragonFly__) \
4134 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
4135 || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN)
4136 #define _PT_PTHREAD_YIELD() sched_yield()
4139 [FILE:291:dragonfly/patch-nsprpub_pr_include_md_prosdep.h]
4140 --- pr/include/md/prosdep.h.orig 2014-06-05 21:42:08.000000000 +0000
4141 +++ pr/include/md/prosdep.h
4142 @@ -43,6 +43,9 @@ PR_BEGIN_EXTERN_C
4143 #elif defined(OPENBSD)
4144 #include "md/_openbsd.h"
4146 +#elif defined(__DragonFly__)
4147 +#include "md/_dragonfly.h"
4150 #include "md/_bsdi.h"
4154 [FILE:494:dragonfly/patch-nsprpub_pr_src_md_unix_uxrng.c]
4155 --- pr/src/md/unix/uxrng.c.orig 2014-06-05 21:42:08.000000000 +0000
4156 +++ pr/src/md/unix/uxrng.c
4157 @@ -86,7 +86,7 @@ GetHighResClock(void *buf, size_t maxbyt
4159 #elif (defined(LINUX) || defined(FREEBSD) || defined(__FreeBSD_kernel__) \
4160 || defined(NETBSD) || defined(__NetBSD_kernel__) || defined(OPENBSD) \
4161 - || defined(SYMBIAN) || defined(__GNU__))
4162 + || defined(SYMBIAN) || defined(__GNU__)) || defined(__DragonFly__)
4163 #include <sys/types.h>
4164 #include <sys/stat.h>
4168 [FILE:723:dragonfly/patch-nsprpub_pr_src_misc_prnetdb.c]
4169 --- pr/src/misc/prnetdb.c.orig 2014-06-20 12:34:59.566379000 +0000
4170 +++ pr/src/misc/prnetdb.c
4171 @@ -78,6 +78,11 @@ PRLock *_pr_dnsLock = NULL;
4172 #define _PR_HAVE_GETPROTO_R_INT
4175 +#if defined(DRAGONFLY)
4176 +#define _PR_HAVE_GETPROTO_R
4177 +#define _PR_HAVE_5_ARG_GETPROTO_R
4180 /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
4181 #if (defined(__GLIBC__) && __GLIBC__ >= 2 && !defined(XP_BEOS))
4182 #define _PR_HAVE_GETPROTO_R
4183 @@ -295,7 +300,7 @@ _pr_QueryNetIfs(void)
4186 #elif (defined(DARWIN) && defined(HAVE_GETIFADDRS)) || defined(FREEBSD) \
4187 - || defined(NETBSD) || defined(OPENBSD)
4188 + || defined(NETBSD) || defined(OPENBSD) || defined(DRAGONFLY)
4191 * Use the BSD getifaddrs function.
4194 [FILE:1005:dragonfly/patch-nsprpub_pr_src_pthreads_ptio.c]
4195 --- pr/src/pthreads/ptio.c.orig 2014-06-20 12:34:59.616376000 +0000
4196 +++ pr/src/pthreads/ptio.c
4197 @@ -180,7 +180,8 @@ static PRBool _pr_ipv6_v6only_on_by_defa
4198 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4199 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
4200 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
4201 - || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN)
4202 + || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN) \
4203 + || defined(__DragonFly__)
4204 #define _PRSelectFdSetArg_t fd_set *
4206 #error "Cannot determine architecture"
4207 @@ -3256,7 +3257,7 @@ static PRIOMethods _pr_socketpollfd_meth
4208 || defined(AIX) || defined(FREEBSD) || defined(NETBSD) \
4209 || defined(OPENBSD) || defined(BSDI) || defined(NTO) \
4210 || defined(DARWIN) || defined(UNIXWARE) || defined(RISCOS) \
4211 - || defined(SYMBIAN)
4212 + || defined(SYMBIAN) || defined(__DragonFly__)
4213 #define _PR_FCNTL_FLAGS O_NONBLOCK
4215 #error "Can't determine architecture"
4218 [FILE:533:dragonfly/patch-nsprpub_pr_src_pthreads_ptsynch.c]
4219 --- pr/src/pthreads/ptsynch.c.orig 2014-06-20 12:34:59.616376000 +0000
4220 +++ pr/src/pthreads/ptsynch.c
4221 @@ -919,7 +919,7 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphor
4223 #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
4224 || defined(FREEBSD) || defined(OPENBSD) || defined(BSDI) \
4225 - || defined(DARWIN) || defined(SYMBIAN)
4226 + || defined(DARWIN) || defined(SYMBIAN) || defined(__DragonFly__)
4227 /* union semun is defined by including <sys/sem.h> */
4229 /* according to X/OPEN we have to define it ourselves */
4232 [FILE:700:dragonfly/patch-pr_tests_Makefile.in]
4233 --- pr/tests/Makefile.in.intermediate 2016-01-08 16:56:54.000000000 +0200
4234 +++ pr/tests/Makefile.in
4235 @@ -342,6 +342,12 @@ ifeq ($(OS_ARCH), UNIXWARE)
4236 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
4239 +ifeq ($(OS_ARCH),DragonFly)
4240 +ifeq ($(USE_PTHREADS),1)
4245 ifeq ($(OS_ARCH),FreeBSD)
4246 ifeq ($(USE_PTHREADS),1)
4248 @@ -370,7 +376,7 @@ LIBPTHREAD = -lpthread
4249 ifeq ($(OS_ARCH),AIX)
4250 LIBPTHREAD = -lpthreads
4252 -ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS QNX Darwin OpenUNIX,$(OS_ARCH)))
4253 +ifeq (,$(filter-out DragonFly FreeBSD OpenBSD BSD_OS QNX Darwin OpenUNIX,$(OS_ARCH)))
4256 ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)