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.17/src
13 DISTFILE[1]= nspr-4.17.tar.gz:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
21 C_USES[sunos]= cclibs:single
23 DISTNAME= nspr-4.17/nspr
25 CPE_PRODUCT= netscape_portable_runtime
27 FPC_EQUIVALENT= devel/nspr
30 CONFIGURE_ARGS= --enable-64bit
33 # Do not install tools to build itself
34 @${REINPLACE_CMD} -e '/RELEASE_BINS/d' \
35 ${WRKSRC}/pr/src/misc/Makefile.in
38 @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.so
40 [FILE:207:descriptions/desc.single]
41 Netscape Portable Runtime (NSPR) provides a platform-neutral API for
42 system level and libc like functions. The API is used in the Mozilla
43 client, many of Netscape/AOL/iPlanet's and other software offerings.
47 590a0aea29412ae22d7728038c21ef2ab42646e48172a47d2e4bb782846d1095 1141300 nspr-4.17.tar.gz
50 [FILE:1258:manifests/plist.single]
59 %%ONLY-DRAGONFLY%%include/nspr/md/_dragonfly.cfg
82 include/nspr/obsolete/
111 include/nspr/private/
140 @(,,444) lib/libnspr4.a
141 @(,,444) lib/libnspr4.so
142 @(,,444) lib/libplc4.a
143 @(,,444) lib/libplc4.so
144 @(,,444) lib/libplds4.a
145 @(,,444) lib/libplds4.so
146 lib/pkgconfig/nspr.pc
147 share/aclocal/nspr.m4
150 [FILE:1298:patches/patch-bug301986]
151 pthread_t can well be a 64-bit value -- on FreeBSD/amd64, for example.
152 Better to just keep calling it pthread_t isntead of casting to anything.
156 --- pr/include/private/pprthred.h.orig 2015-10-16 13:22:19 UTC
157 +++ pr/include/private/pprthred.h
162 +#include <pthread.h>
166 @@ -59,7 +60,7 @@ NSPR_API(void) PR_DetachThread(void);
167 ** Get the id of the named thread. Each thread is assigned a unique id
168 ** when it is created or attached.
170 -NSPR_API(PRUint32) PR_GetThreadID(PRThread *thread);
171 +NSPR_API(pthread_t) PR_GetThreadID(PRThread *thread);
174 ** Set the procedure that is called when a thread is dumped. The procedure
175 --- pr/src/pthreads/ptthread.c.orig 2015-10-16 13:22:19 UTC
176 +++ pr/src/pthreads/ptthread.c
177 @@ -1155,12 +1155,12 @@ PR_IMPLEMENT(void) PR_ProcessExit(PRIntn
181 -PR_IMPLEMENT(PRUint32) PR_GetThreadID(PRThread *thred)
182 +PR_IMPLEMENT(pthread_t) PR_GetThreadID(PRThread *thred)
184 #if defined(_PR_DCETHREADS)
185 return (PRUint32)&thred->id; /* this is really a sham! */
187 - return (PRUint32)thred->id; /* and I don't know what they will do with it */
188 + return thred->id; /* and I don't know what they will do with it */
194 [FILE:916:patches/patch-bug782109]
195 --- pr/include/md/_freebsd.h.orig 2015-10-16 13:22:19 UTC
196 +++ pr/include/md/_freebsd.h
198 #define _PR_HAVE_LARGE_OFF_T
200 #if defined(_PR_PTHREADS)
201 +#if __FreeBSD_version >= 602000
202 +#define _PR_HAVE_GETPROTO_R
203 +#define _PR_HAVE_5_ARG_GETPROTO_R
205 +#if __FreeBSD_version >= 700016
206 +#define _PR_HAVE_GETHOST_R
207 +#define _PR_HAVE_GETHOST_R_INT
209 #if __FreeBSD_version >= 400008
211 * libc_r before this version of FreeBSD doesn't have poll().
212 --- pr/src/misc/prnetdb.c.orig 2015-10-16 13:22:19 UTC
213 +++ pr/src/misc/prnetdb.c
214 @@ -78,11 +78,6 @@ PRLock *_pr_dnsLock = NULL;
215 #define _PR_HAVE_GETPROTO_R_INT
218 -#if __FreeBSD_version >= 602000
219 -#define _PR_HAVE_GETPROTO_R
220 -#define _PR_HAVE_5_ARG_GETPROTO_R
223 /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
224 #if (defined(__GLIBC__) && __GLIBC__ >= 2 && !defined(XP_BEOS))
225 #define _PR_HAVE_GETPROTO_R
228 [FILE:489:patches/patch-config_nspr.pc.in]
229 --- config/nspr.pc.in.orig 2015-10-16 13:22:19 UTC
230 +++ config/nspr.pc.in
231 @@ -6,5 +6,5 @@ includedir=@includedir@
233 Description: The Netscape Portable Runtime
234 Version: @MOD_MAJOR_VERSION@.@MOD_MINOR_VERSION@.@MOD_PATCH_VERSION@
235 -Libs: -L@libdir@ -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@
236 -Cflags: -I@includedir@
237 +Libs: -L${libdir} -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@ @OS_LIBS@
238 +Cflags: -I${includedir}
241 [FILE:1032:patches/patch-configure]
242 --- configure.orig 2017-09-19 16:32:26.000000000 +0000
243 +++ configure 2017-12-08 18:43:17.349325345 +0000
244 @@ -7525,7 +7525,6 @@
246 MDCPUCFG_H=_solaris.cfg
247 PR_MD_CSRCS=solaris.c
249 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
250 RESOLVE_LINK_SYMBOLS=1
251 case "${OS_RELEASE}" in
252 @@ -7533,7 +7532,6 @@
255 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
259 if test -n "$GNU_CC"; then
260 @@ -8544,17 +8542,7 @@
262 $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
264 - if test "$OS_TEST" = "i86pc"; then
265 - if test -n "$USE_64"; then
266 - PR_MD_ASFILES=os_SunOS_x86_64.s
268 - PR_MD_ASFILES=os_SunOS_x86.s
271 - if test -n "$USE_64"; then
272 - PR_MD_ASFILES=os_SunOS_sparcv9.s
275 + PR_MD_ASFILES=os_SunOS_x86_64.s
281 [FILE:29847:patches/patch-libtests]
282 --- lib/tests/arena.c.orig 2015-10-16 13:22:19 UTC
283 +++ lib/tests/arena.c
284 @@ -36,6 +36,7 @@ void DumpAll( void )
290 ** Test Arena allocation.
292 @@ -96,6 +97,7 @@ static void ArenaGrow( void )
295 } /* end ArenaGrow() */
300 --- lib/tests/base64t.c.orig 2015-10-16 13:22:19 UTC
301 +++ lib/tests/base64t.c
302 @@ -1987,7 +1987,6 @@ PRBool test_008(void)
303 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
305 PRUint32 plen = PL_strlen(array[i].plaintext);
306 - PRUint32 clen = ((plen + 2)/3)*4;
308 char *rv = PL_Base64Encode(array[i].plaintext, plen, (char *)0);
310 @@ -2747,9 +2746,6 @@ PRBool test_024(void)
312 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
314 - PRUint32 plen = PL_strlen(array[i].plaintext);
315 - PRUint32 clen = ((plen + 2)/3)*4;
317 char *rv = PL_Base64Encode(array[i].plaintext, 0, (char *)0);
319 if( (char *)0 == rv )
320 @@ -2883,8 +2879,6 @@ PRBool test_027(void)
322 for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
324 - PRUint32 clen = PL_strlen(array[i].cyphertext);
326 char *rv = PL_Base64Decode(array[i].cyphertext, 0, (char *)0);
328 if( (char *)0 == rv )
329 --- lib/tests/string.c.orig 2015-10-16 13:22:19 UTC
330 +++ lib/tests/string.c
331 @@ -127,7 +127,7 @@ PRBool test_003(void)
332 rv = PL_strcpy(array[i].dest, array[i].str);
333 if( array[i].rv != rv )
335 - printf("FAIL %d: (0x%x, %s)->0x%x\n", i, array[i].dest,
336 + printf("FAIL %d: (%p, %s)->%p\n", i, array[i].dest,
337 array[i].str ? array[i].str : "(null)", rv);
340 @@ -237,8 +237,8 @@ PRBool test_004(void)
341 rv = PL_strncpy(array[i].dest, array[i].str, array[i].len);
342 if( array[i].rv != rv )
344 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
345 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
346 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
347 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
351 @@ -363,8 +363,8 @@ PRBool test_005(void)
352 rv = PL_strncpyz(array[i].dest, array[i].str, array[i].len);
353 if( array[i].rv != rv )
355 - printf("FAIL %d: (0x%x, %s, %lu)->0x%x\n", i, array[i].dest,
356 - array[i].str ? array[i].str : "(null)", array[i].len, rv);
357 + printf("FAIL %d: (%p, %s, %u)->%p\n", i, array[i].dest,
358 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len, rv);
362 @@ -415,7 +415,7 @@ PRBool test_006(void)
364 if( (char *)0 == rv )
366 - printf("FAIL %d: 0x%x -> 0\n", i, array[i]);
367 + printf("FAIL %d: %p -> 0\n", i, array[i]);
371 @@ -499,8 +499,8 @@ PRBool test_007(void)
373 if( (char *)0 == rv )
375 - printf("FAIL %d: %s,%lu -> 0\n", i,
376 - array[i].str ? array[i].str : "(null)", array[i].len);
377 + printf("FAIL %d: %s,%u -> 0\n", i,
378 + array[i].str ? array[i].str : "(null)", (unsigned)array[i].len);
382 @@ -684,10 +684,10 @@ PRBool test_009(void)
384 if( (char *)0 != rv )
386 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
387 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
388 array[i].first ? array[i].first : "(null)",
389 array[i].second ? array[i].second : "(null)",
390 - array[i].length, rv);
391 + (unsigned)array[i].length, rv);
395 @@ -695,10 +695,10 @@ PRBool test_009(void)
397 if( (char *)0 == rv )
399 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
400 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
401 array[i].first ? array[i].first : "(null)",
402 array[i].second ? array[i].second : "(null)",
403 - array[i].length, array[i].result);
404 + (unsigned)array[i].length, array[i].result);
408 @@ -710,10 +710,10 @@ PRBool test_009(void)
412 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
413 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
414 array[i].first ? array[i].first : "(null)",
415 array[i].second ? array[i].second : "(null)",
416 - array[i].length, rv, array[i].result);
417 + (unsigned)array[i].length, rv, array[i].result);
421 @@ -725,10 +725,10 @@ PRBool test_009(void)
425 - printf("FAIL %d: %s+%s/%lu -> not nulled\n", i,
426 + printf("FAIL %d: %s+%s/%u -> not nulled\n", i,
427 array[i].first ? array[i].first : "(null)",
428 array[i].second ? array[i].second : "(null)",
430 + (unsigned)array[i].length);
434 @@ -736,10 +736,10 @@ PRBool test_009(void)
438 - printf("FAIL %d: %s+%s/%lu -> overrun\n", i,
439 + printf("FAIL %d: %s+%s/%u -> overrun\n", i,
440 array[i].first ? array[i].first : "(null)",
441 array[i].second ? array[i].second : "(null)",
443 + (unsigned)array[i].length);
447 @@ -814,10 +814,10 @@ PRBool test_010(void)
449 if( (char *)0 != rv )
451 - printf("FAIL %d: %s+%s/%lu -> %.32s, not zero\n", i,
452 + printf("FAIL %d: %s+%s/%u -> %.32s, not zero\n", i,
453 array[i].first ? array[i].first : "(null)",
454 array[i].second ? array[i].second : "(null)",
455 - array[i].length, rv);
456 + (unsigned)array[i].length, rv);
460 @@ -825,10 +825,10 @@ PRBool test_010(void)
462 if( (char *)0 == rv )
464 - printf("FAIL %d: %s+%s/%lu -> null, not %s\n", i,
465 + printf("FAIL %d: %s+%s/%u -> null, not %s\n", i,
466 array[i].first ? array[i].first : "(null)",
467 array[i].second ? array[i].second : "(null)",
468 - array[i].length, array[i].result);
469 + (unsigned)array[i].length, array[i].result);
473 @@ -840,10 +840,10 @@ PRBool test_010(void)
477 - printf("FAIL %d: %s+%s/%lu -> %.32s, not %s\n", i,
478 + printf("FAIL %d: %s+%s/%u -> %.32s, not %s\n", i,
479 array[i].first ? array[i].first : "(null)",
480 array[i].second ? array[i].second : "(null)",
481 - array[i].length, rv, array[i].result);
482 + (unsigned)array[i].length, rv, array[i].result);
486 @@ -1072,10 +1072,10 @@ PRBool test_012(void)
490 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
491 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
492 array[i].one ? array[i].one : "(null)",
493 array[i].two ? array[i].two : "(null)",
494 - array[i].max, rv, array[i].sign);
495 + (int)array[i].max, rv, array[i].sign);
499 @@ -1294,10 +1294,10 @@ PRBool test_014(void)
503 - printf("FAIL %d: %s-%s/%ld -> %d, not %d\n", i,
504 + printf("FAIL %d: %s-%s/%d -> %d, not %d\n", i,
505 array[i].one ? array[i].one : "(null)",
506 array[i].two ? array[i].two : "(null)",
507 - array[i].max, rv, array[i].sign);
508 + (int)array[i].max, rv, array[i].sign);
512 @@ -1367,15 +1367,15 @@ PRBool test_015(void)
514 if( (char *)0 == rv )
516 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
517 - array[i].chr, array[i].off);
518 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
519 + array[i].chr, (unsigned)array[i].off);
523 if( &array[i].str[ array[i].off ] != rv )
525 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
526 - array[i].chr, rv, array[i].str, array[i].off);
527 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
528 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
532 @@ -1447,15 +1447,15 @@ PRBool test_016(void)
534 if( (char *)0 == rv )
536 - printf("FAIL %d: %s,%c -> null, not +%lu\n", i, array[i].str,
537 - array[i].chr, array[i].off);
538 + printf("FAIL %d: %s,%c -> null, not +%u\n", i, array[i].str,
539 + array[i].chr, (unsigned)array[i].off);
543 if( &array[i].str[ array[i].off ] != rv )
545 - printf("FAIL %d: %s,%c -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
546 - array[i].chr, rv, array[i].str, array[i].off);
547 + printf("FAIL %d: %s,%c -> %p, not %p+%u\n", i, array[i].str,
548 + array[i].chr, rv, array[i].str, (unsigned)array[i].off);
552 @@ -1522,8 +1522,8 @@ PRBool test_017(void)
554 if( (char *)0 != rv )
556 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
557 - array[i].chr, array[i].max, rv);
558 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
559 + array[i].chr, (unsigned)array[i].max, rv);
563 @@ -1531,15 +1531,15 @@ PRBool test_017(void)
565 if( (char *)0 == rv )
567 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
568 - array[i].chr, array[i].max, array[i].off);
569 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
570 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
574 if( &array[i].str[ array[i].off ] != rv )
576 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
577 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
578 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
579 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
583 @@ -1606,8 +1606,8 @@ PRBool test_018(void)
585 if( (char *)0 != rv )
587 - printf("FAIL %d: %s,%c/%lu -> %.32s, not zero\n", i, array[i].str,
588 - array[i].chr, array[i].max, rv);
589 + printf("FAIL %d: %s,%c/%u -> %.32s, not zero\n", i, array[i].str,
590 + array[i].chr, (unsigned)array[i].max, rv);
594 @@ -1615,15 +1615,15 @@ PRBool test_018(void)
596 if( (char *)0 == rv )
598 - printf("FAIL %d: %s,%c/%lu -> null, not +%lu\n", i, array[i].str,
599 - array[i].chr, array[i].max, array[i].off);
600 + printf("FAIL %d: %s,%c/%u -> null, not +%u\n", i, array[i].str,
601 + array[i].chr, (unsigned)array[i].max, (unsigned)array[i].off);
605 - if( &array[i].str[ array[i].off ] != rv )
606 + if( &array[i].str[ array[i].off ] != rv)
608 - printf("FAIL %d: %s,%c/%lu -> 0x%x, not 0x%x+%lu\n", i, array[i].str,
609 - array[i].chr, array[i].max, rv, array[i].str, array[i].off);
610 + printf("FAIL %d: %s,%c/%u -> %p, not %p+%u\n", i, array[i].str,
611 + array[i].chr, (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
615 @@ -1702,19 +1702,19 @@ PRBool test_019(void)
617 if( (char *)0 == rv )
619 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
620 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
621 array[i].str ? array[i].str : "(null)",
622 array[i].chrs ? array[i].chrs : "(null)",
624 + (unsigned)array[i].off);
628 if( &array[i].str[ array[i].off ] != rv )
630 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
631 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
632 array[i].str ? array[i].str : "(null)",
633 array[i].chrs ? array[i].chrs : "(null)",
634 - rv, array[i].str, array[i].off);
635 + rv, array[i].str, (unsigned)array[i].off);
639 @@ -1793,19 +1793,19 @@ PRBool test_020(void)
641 if( (char *)0 == rv )
643 - printf("FAIL %d: %s,%s -> null, not +%lu\n", i,
644 + printf("FAIL %d: %s,%s -> null, not +%u\n", i,
645 array[i].str ? array[i].str : "(null)",
646 array[i].chrs ? array[i].chrs : "(null)",
648 + (unsigned)array[i].off);
652 if( &array[i].str[ array[i].off ] != rv )
654 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
655 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
656 array[i].str ? array[i].str : "(null)",
657 array[i].chrs ? array[i].chrs : "(null)",
658 - rv, array[i].str, array[i].off);
659 + rv, array[i].str, (unsigned)array[i].off);
663 @@ -1879,10 +1879,10 @@ PRBool test_021(void)
665 if( (char *)0 != rv )
667 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
668 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
669 array[i].str ? array[i].str : "(null)",
670 array[i].chrs ? array[i].chrs : "(null)",
672 + (unsigned)array[i].max, rv);
676 @@ -1890,19 +1890,19 @@ PRBool test_021(void)
678 if( (char *)0 == rv )
680 - printf("FAIL %d: %s,%s/%lu -> null, not +%lu\n", i,
681 + printf("FAIL %d: %s,%s/%u -> null, not +%u\n", i,
682 array[i].str ? array[i].str : "(null)",
683 array[i].chrs ? array[i].chrs : "(null)",
684 - array[i].max, array[i].off);
685 + (unsigned)array[i].max, array[i].off);
689 if( &array[i].str[ array[i].off ] != rv )
691 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
692 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
693 array[i].str ? array[i].str : "(null)",
694 array[i].chrs ? array[i].chrs : "(null)",
695 - array[i].max, rv, array[i].str, array[i].off);
696 + (unsigned)array[i].max, rv, array[i].str, array[i].off);
700 @@ -1985,10 +1985,10 @@ PRBool test_022(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 @@ -1996,19 +1996,19 @@ PRBool test_022(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 @@ -2104,19 +2104,19 @@ PRBool test_023(void)
739 if( (char *)0 == rv )
741 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
742 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
743 array[i].str ? array[i].str : "(null)",
744 array[i].sub ? array[i].sub : "(null)",
745 - array[i].str, array[i].off);
746 + array[i].str, (unsigned)array[i].off);
750 if( &array[i].str[ array[i].off ] != rv )
752 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
753 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
754 array[i].str ? array[i].str : "(null)",
755 array[i].sub ? array[i].sub : "(null)",
756 - rv, array[i].str, array[i].off);
757 + rv, array[i].str, (unsigned)array[i].off);
761 @@ -2212,19 +2212,19 @@ PRBool test_024(void)
763 if( (char *)0 == rv )
765 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
766 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
767 array[i].str ? array[i].str : "(null)",
768 array[i].sub ? array[i].sub : "(null)",
769 - array[i].str, array[i].off);
770 + array[i].str, (unsigned)array[i].off);
774 if( &array[i].str[ array[i].off ] != rv )
776 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
777 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
778 array[i].str ? array[i].str : "(null)",
779 array[i].sub ? array[i].sub : "(null)",
780 - rv, array[i].str, array[i].off);
781 + rv, array[i].str, (unsigned)array[i].off);
785 @@ -2331,10 +2331,10 @@ PRBool test_025(void)
787 if( (char *)0 != rv )
789 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
790 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
791 array[i].str ? array[i].str : "(null)",
792 array[i].sub ? array[i].sub : "(null)",
794 + (unsigned)array[i].max, rv);
798 @@ -2342,19 +2342,19 @@ PRBool test_025(void)
800 if( (char *)0 == rv )
802 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
803 + printf("FAIL %d: %s,%s/%u -> 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].max, array[i].str, array[i].off);
807 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
811 if( &array[i].str[ array[i].off ] != rv )
813 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
814 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
815 array[i].str ? array[i].str : "(null)",
816 array[i].sub ? array[i].sub : "(null)",
817 - array[i].max, rv, array[i].str, array[i].off);
818 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
822 @@ -2463,10 +2463,10 @@ PRBool test_026(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 @@ -2474,19 +2474,19 @@ PRBool test_026(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 @@ -2582,19 +2582,19 @@ PRBool test_027(void)
861 if( (char *)0 == rv )
863 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
864 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
865 array[i].str ? array[i].str : "(null)",
866 array[i].sub ? array[i].sub : "(null)",
867 - array[i].str, array[i].off);
868 + array[i].str, (unsigned)array[i].off);
872 if( &array[i].str[ array[i].off ] != rv )
874 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
875 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
876 array[i].str ? array[i].str : "(null)",
877 array[i].sub ? array[i].sub : "(null)",
878 - rv, array[i].str, array[i].off);
879 + rv, array[i].str, (unsigned)array[i].off);
883 @@ -2690,19 +2690,19 @@ PRBool test_028(void)
885 if( (char *)0 == rv )
887 - printf("FAIL %d: %s,%s -> null, not 0x%x+%lu\n", i,
888 + printf("FAIL %d: %s,%s -> null, not %p+%u\n", i,
889 array[i].str ? array[i].str : "(null)",
890 array[i].sub ? array[i].sub : "(null)",
891 - array[i].str, array[i].off);
892 + array[i].str, (unsigned)array[i].off);
896 if( &array[i].str[ array[i].off ] != rv )
898 - printf("FAIL %d: %s,%s -> 0x%x, not 0x%x+%lu\n", i,
899 + printf("FAIL %d: %s,%s -> %p, not %p+%u\n", i,
900 array[i].str ? array[i].str : "(null)",
901 array[i].sub ? array[i].sub : "(null)",
902 - rv, array[i].str, array[i].off);
903 + rv, array[i].str, (unsigned)array[i].off);
907 @@ -2809,10 +2809,10 @@ PRBool test_029(void)
909 if( (char *)0 != rv )
911 - printf("FAIL %d: %s,%s/%lu -> %.32s, not null\n", i,
912 + printf("FAIL %d: %s,%s/%u -> %.32s, not null\n", i,
913 array[i].str ? array[i].str : "(null)",
914 array[i].sub ? array[i].sub : "(null)",
916 + (unsigned)array[i].max, rv);
920 @@ -2820,19 +2820,19 @@ PRBool test_029(void)
922 if( (char *)0 == rv )
924 - printf("FAIL %d: %s,%s/%lu -> null, not 0x%x+%lu\n", i,
925 + printf("FAIL %d: %s,%s/%u -> 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].max, array[i].str, array[i].off);
929 + (unsigned)array[i].max, array[i].str, (unsigned)array[i].off);
933 if( &array[i].str[ array[i].off ] != rv )
935 - printf("FAIL %d: %s,%s/%lu -> 0x%x, not 0x%x+%lu\n", i,
936 + printf("FAIL %d: %s,%s/%u -> %p, not %p+%u\n", i,
937 array[i].str ? array[i].str : "(null)",
938 array[i].sub ? array[i].sub : "(null)",
939 - array[i].max, rv, array[i].str, array[i].off);
940 + (unsigned)array[i].max, rv, array[i].str, (unsigned)array[i].off);
944 @@ -2941,10 +2941,10 @@ PRBool test_030(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 @@ -2952,19 +2952,19 @@ PRBool test_030(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);
983 [FILE:85333:patches/patch-tests]
984 --- lib/tests/Makefile.in.orig 2015-10-16 13:22:19 UTC
985 +++ lib/tests/Makefile.in
986 @@ -167,7 +167,7 @@ else
987 ifeq ($(OS_ARCH),OS2)
988 $(LINK) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS)
990 - $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(EXTRA_LIBS) -o $@
991 + $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBPLDS) $(LIBPR) $(OS_LIBS) $(EXTRA_LIBS) -o $@
995 --- pr/tests/Makefile.in.orig 2015-10-16 13:22:19 UTC
996 +++ pr/tests/Makefile.in
997 @@ -489,17 +489,18 @@ endif
1000 runtests:: $(PROGS) ALWAYS
1001 - @$(ECHO) "\nNSPR Test Results - $(OBJDIR)\n"
1002 - @$(ECHO) "BEGIN\t\t\t`date`"
1003 - @$(ECHO) "NSPR_TEST_LOGFILE\t$(LOGFILE)\n"
1004 - @$(ECHO) "Test\t\t\tResult\n"
1005 + @$(ECHO) "NSPR Test Results - $(OBJDIR)"
1006 + @$(ECHO) "BEGIN `date`"
1007 + @$(ECHO) "Test Result"
1008 @cd $(OBJDIR); for i in $(PROGRAMS); do \
1009 - $(ECHO) "$$i\c"; \
1010 - ./$$i >> $(LOGFILE) 2>&1 ; \
1012 + ./$$i > $$i.output 2>&1; \
1013 if [ 0 = $$? ] ; then \
1014 - $(ECHO) "\t\t\tPassed"; \
1016 - $(ECHO) "\t\t\tFAILED"; \
1018 + $(ECHO) " Passed"; \
1021 + $(ECHO) " FAILED"; \
1025 - @$(ECHO) "\nEND\t\t`date`\n"
1026 + @$(ECHO) "END `date`"
1027 --- pr/tests/cleanup.c.orig 2015-10-16 13:22:19 UTC
1028 +++ pr/tests/cleanup.c
1031 static void PR_CALLBACK Thread(void *sleep)
1033 - PR_Sleep(PR_SecondsToInterval((PRUint32)sleep));
1034 + PR_Sleep(PR_SecondsToInterval((intptr_t)sleep));
1035 printf("Thread exiting\n");
1038 @@ -39,7 +39,8 @@ int main(int argc, char **argv)
1039 PRThreadScope type = PR_LOCAL_THREAD;
1040 PRFileDesc *err = PR_GetSpecialFD(PR_StandardError);
1041 PLOptState *opt = PL_CreateOptState(argc, argv, "Ghs:S:t:cC:");
1042 - PRIntn concurrency = 1, child_sleep = 10, main_sleep = 5, threads = 1;
1043 + PRIntn concurrency = 1, main_sleep = 5, threads = 1;
1044 + intptr_t child_sleep = 10;
1047 while (PL_OPT_EOL != (os = PL_GetNextOpt(opt)))
1048 @@ -80,7 +81,7 @@ int main(int argc, char **argv)
1049 (PR_LOCAL_THREAD == type) ? "LOCAL" : "GLOBAL");
1050 PR_fprintf(err, "\tConcurrency: %d\n", concurrency);
1051 PR_fprintf(err, "\tNumber of threads: %d\n", threads);
1052 - PR_fprintf(err, "\tThread sleep: %d\n", child_sleep);
1053 + PR_fprintf(err, "\tThread sleep: %d\n", (int)child_sleep);
1054 PR_fprintf(err, "\tMain sleep: %d\n", main_sleep);
1055 PR_fprintf(err, "\tCleanup will %sbe called\n\n", (cleanup) ? "" : "NOT ");
1057 --- pr/tests/cltsrv.c.orig 2015-10-16 13:22:19 UTC
1058 +++ pr/tests/cltsrv.c
1059 @@ -887,7 +887,7 @@ int main(int argc, char** argv)
1063 - CSClient_t *client;
1064 + CSClient_t *client = NULL;
1065 PRStatus rv, joinStatus;
1066 CSServer_t *server = NULL;
1068 --- pr/tests/cvar.c.orig 2015-10-16 13:22:19 UTC
1070 @@ -135,14 +135,14 @@ static int alive;
1071 static void PR_CALLBACK CXReader(void *arg)
1073 CircBuf *cbp = (CircBuf *)arg;
1079 for (i = 0; i < n; i++) {
1080 data = GetCBData(cbp);
1081 - if ((int)data != i)
1082 - if (debug_mode) printf("data mismatch at for i = %d usec\n", i);
1083 + if ((intptr_t)data != i)
1084 + if (debug_mode) printf("data mismatch at for i = %ld usec\n", (long)i);
1087 PR_EnterMonitor(mon);
1088 @@ -154,7 +154,7 @@ static void PR_CALLBACK CXReader(void *a
1089 static void PR_CALLBACK CXWriter(void *arg)
1091 CircBuf *cbp = (CircBuf *)arg;
1096 for (i = 0; i < n; i++)
1097 --- pr/tests/cvar2.c.orig 2015-10-16 13:22:19 UTC
1098 +++ pr/tests/cvar2.c
1099 @@ -95,7 +95,7 @@ PrivateCondVarThread(void *_info)
1100 for (index=0; index<info->loops; index++) {
1101 PR_Lock(info->lock);
1102 if (*info->tcount == 0) {
1103 - DPRINTF(("PrivateCondVarThread: thread 0x%lx waiting on cvar = 0x%lx\n",
1104 + DPRINTF(("PrivateCondVarThread: thread %p waiting on cvar = %p\n",
1105 PR_GetCurrentThread(), info->cvar));
1106 PR_WaitCondVar(info->cvar, info->timeout);
1108 @@ -108,8 +108,8 @@ PrivateCondVarThread(void *_info)
1109 PR_Lock(info->exitlock);
1110 (*info->exitcount)++;
1111 PR_NotifyCondVar(info->exitcvar);
1112 -DPRINTF(("PrivateCondVarThread: thread 0x%lx notified exitcvar = 0x%lx cnt = %ld\n",
1113 - PR_GetCurrentThread(), info->exitcvar,(*info->exitcount)));
1114 +DPRINTF(("PrivateCondVarThread: thread %p notified exitcvar = %p cnt = %d\n",
1115 + PR_GetCurrentThread(), info->exitcvar,(int)(*info->exitcount)));
1116 PR_Unlock(info->exitlock);
1119 @@ -157,7 +157,7 @@ CreateTestThread(threadinfo *info,
1121 CondVarTestSUU(void *_arg)
1123 - PRInt32 arg = (PRInt32)_arg;
1124 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1125 PRInt32 index, loops;
1128 @@ -189,7 +189,7 @@ CondVarTestSUU(void *_arg)
1132 - DPRINTF(("CondVarTestSUU: created thread 0x%lx\n",list[index].thread));
1133 + DPRINTF(("CondVarTestSUU: created thread %p\n",list[index].thread));
1136 for (loops = 0; loops < count; loops++) {
1137 @@ -199,7 +199,7 @@ CondVarTestSUU(void *_arg)
1138 (*list[index].tcount)++;
1139 PR_NotifyCondVar(list[index].cvar);
1140 PR_Unlock(list[index].lock);
1141 - DPRINTF(("PrivateCondVarThread: thread 0x%lx notified cvar = 0x%lx\n",
1142 + DPRINTF(("PrivateCondVarThread: thread %p notified cvar = %p\n",
1143 PR_GetCurrentThread(), list[index].cvar));
1146 @@ -227,7 +227,7 @@ CondVarTestSUU(void *_arg)
1148 CondVarTestSUK(void *_arg)
1150 - PRInt32 arg = (PRInt32)_arg;
1151 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1152 PRInt32 index, loops;
1155 @@ -301,7 +301,7 @@ CondVarTestSUK(void *_arg)
1157 CondVarTestPUU(void *_arg)
1159 - PRInt32 arg = (PRInt32)_arg;
1160 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1161 PRInt32 index, loops;
1164 @@ -336,7 +336,7 @@ CondVarTestPUU(void *_arg)
1168 - DPRINTF(("CondVarTestPUU: created thread 0x%lx\n",list[index].thread));
1169 + DPRINTF(("CondVarTestPUU: created thread %p\n",list[index].thread));
1173 @@ -354,8 +354,8 @@ CondVarTestPUU(void *_arg)
1175 /* Wait for threads to finish */
1176 while(exitcount < arg) {
1177 -DPRINTF(("CondVarTestPUU: thread 0x%lx waiting on exitcvar = 0x%lx cnt = %ld\n",
1178 - PR_GetCurrentThread(), exitcvar, exitcount));
1179 +DPRINTF(("CondVarTestPUU: thread %p waiting on exitcvar = %p cnt = %d\n",
1180 + PR_GetCurrentThread(), exitcvar, (int)exitcount));
1181 PR_WaitCondVar(exitcvar, PR_SecondsToInterval(60));
1183 PR_ASSERT(exitcount >= arg);
1184 @@ -365,7 +365,7 @@ DPRINTF(("CondVarTestPUU: thread 0x%lx w
1186 /* Join all the threads */
1187 for(index=0; index<(arg); index++) {
1188 - DPRINTF(("CondVarTestPUU: joining thread 0x%lx\n",list[index].thread));
1189 + DPRINTF(("CondVarTestPUU: joining thread %p\n",list[index].thread));
1190 PR_JoinThread(list[index].thread);
1191 if (list[index].internal) {
1192 PR_Lock(list[index].lock);
1193 @@ -387,7 +387,7 @@ DPRINTF(("CondVarTestPUU: thread 0x%lx w
1195 CondVarTestPUK(void *_arg)
1197 - PRInt32 arg = (PRInt32)_arg;
1198 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1199 PRInt32 index, loops;
1202 @@ -468,7 +468,7 @@ CondVarTestPUK(void *_arg)
1204 CondVarTest(void *_arg)
1206 - PRInt32 arg = (PRInt32)_arg;
1207 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1208 PRInt32 index, loops;
1211 @@ -601,7 +601,7 @@ CondVarTest(void *_arg)
1213 CondVarTimeoutTest(void *_arg)
1215 - PRInt32 arg = (PRInt32)_arg;
1216 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1217 PRInt32 index, loops;
1220 @@ -712,7 +712,7 @@ CondVarTimeoutTest(void *_arg)
1222 CondVarMixedTest(void *_arg)
1224 - PRInt32 arg = (PRInt32)_arg;
1225 + PRInt32 arg = (PRInt32)(intptr_t)_arg;
1226 PRInt32 index, loops;
1229 @@ -802,7 +802,7 @@ CondVarMixedTest(void *_arg)
1230 for(index=0; index<(arg*4); index+=3) {
1232 PR_Lock(list[index].lock);
1233 - *list[index].tcount++;
1234 + list[index].tcount++;
1235 PR_NotifyCondVar(list[index].cvar);
1236 PR_Unlock(list[index].lock);
1238 @@ -873,7 +873,7 @@ static void Measure(void (*func)(void *)
1241 start = PR_IntervalNow();
1242 - (*func)((void *)arg);
1243 + (*func)((void *)(intptr_t)arg);
1244 stop = PR_IntervalNow();
1246 d = (double)PR_IntervalToMicroseconds(stop - start);
1247 @@ -932,7 +932,7 @@ default_threads, default_threads*2, defa
1248 PR_SetConcurrency(2);
1250 for (threads = default_threads; threads < default_threads*5; threads+=default_threads) {
1251 - printf("\n%ld Thread tests\n", threads);
1252 + printf("\n%d Thread tests\n", (int)threads);
1253 Measure(CondVarTestSUU, threads, "Condvar simple test shared UU");
1254 Measure(CondVarTestSUK, threads, "Condvar simple test shared UK");
1255 Measure(CondVarTestPUU, threads, "Condvar simple test priv UU");
1256 --- pr/tests/foreign.c.orig 2015-10-16 13:22:19 UTC
1257 +++ pr/tests/foreign.c
1258 @@ -202,7 +202,7 @@ static void OneShot(void *arg)
1261 PRFileDesc *pair[2];
1262 - PRIntn test = (PRIntn)arg;
1263 + intptr_t test = (intptr_t)arg;
1265 for (test = 0; test < 12; ++test) {
1267 @@ -302,7 +302,7 @@ static void OneShot(void *arg)
1268 int main(int argc, char **argv)
1271 - PRInt32 thread_cnt = DEFAULT_THREAD_COUNT;
1272 + intptr_t thread_cnt = DEFAULT_THREAD_COUNT;
1274 PLOptState *opt = PL_CreateOptState(argc, argv, "dt:");
1276 --- pr/tests/forktest.c.orig 2015-10-16 13:22:19 UTC
1277 +++ pr/tests/forktest.c
1278 @@ -47,7 +47,7 @@ ClientThreadFunc(void *arg)
1281 PRFileDesc *sock = NULL;
1282 - PRInt32 tmp = (PRInt32)arg;
1283 + intptr_t tmp = (intptr_t)arg;
1286 * Make sure the PR_Accept call will block
1287 @@ -143,7 +143,7 @@ DoIO(void)
1290 clientThread = PR_CreateThread( PR_USER_THREAD, ClientThreadFunc,
1291 - (void *) PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1292 + (void *)(intptr_t)PR_ntohs(addr.inet.port), PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1293 PR_JOINABLE_THREAD, 0);
1294 if (clientThread == NULL) {
1295 fprintf(stderr, "Cannot create client thread: (%d, %d)\n",
1296 @@ -151,6 +151,9 @@ DoIO(void)
1300 + printf("Wait one second before accept\n");
1302 + PR_Sleep(PR_SecondsToInterval(1));
1303 printf("Accepting connection at port %hu\n", PR_ntohs(addr.inet.port));
1305 sock = PR_Accept(listenSock, &addr, PR_SecondsToInterval(5));
1306 --- pr/tests/getai.c.orig 2015-10-16 13:22:19 UTC
1307 +++ pr/tests/getai.c
1308 @@ -13,8 +13,13 @@ int main(int argc, char **argv)
1314 - ai = PR_GetAddrInfoByName(argv[1], PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1318 + host = "www.FreeBSD.org";
1319 + ai = PR_GetAddrInfoByName(host, PR_AF_UNSPEC, PR_AI_ADDRCONFIG);
1321 fprintf(stderr, "PR_GetAddrInfoByName failed: (%d, %d)\n",
1322 PR_GetError(), PR_GetOSError());
1323 --- pr/tests/instrumt.c.orig 2015-10-16 13:22:19 UTC
1324 +++ pr/tests/instrumt.c
1331 #include <prclist.h>
1334 #define COUNT_LIMIT (10 * ( 1024))
1336 #define SMALL_TRACE_BUFSIZE ( 60 * 1024 )
1341 @@ -78,10 +78,10 @@ static void Help(void)
1343 static void ListCounters(void)
1345 +#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
1346 PR_DEFINE_COUNTER( qh );
1347 PR_DEFINE_COUNTER( rh );
1348 const char *qn, *rn, *dn;
1349 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1352 PR_INIT_COUNTER_HANDLE( qh, NULL );
1353 @@ -92,7 +92,7 @@ static void ListCounters(void)
1354 PR_FIND_NEXT_COUNTER_RNAME(rh, rh, qh );
1355 while ( rh != NULL )
1357 - PR_GET_COUNTER_NAME_FROM_HANDLE( rh, qname, rname, desc );
1358 + PR_GET_COUNTER_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1359 PR_GET_COUNTER(tCtr, rh);
1360 PR_LOG( lm, msgLevel,
1361 ( "QName: %s RName: %s Desc: %s Value: %ld\n",
1362 @@ -101,15 +101,15 @@ static void ListCounters(void)
1364 PR_FIND_NEXT_COUNTER_QNAME(qh, qh);
1368 } /* end ListCounters() */
1370 static void ListTraces(void)
1372 +#if defined(DEBUG) || defined(FORCE_NSPR_TRACE)
1373 PR_DEFINE_TRACE( qh );
1374 PR_DEFINE_TRACE( rh );
1375 const char *qn, *rn, *dn;
1376 - const char **qname = &qn, **rname = &rn, **desc = &dn;
1378 PR_INIT_TRACE_HANDLE( qh, NULL );
1379 PR_FIND_NEXT_TRACE_QNAME(qh, qh );
1380 @@ -119,7 +119,7 @@ static void ListTraces(void)
1381 PR_FIND_NEXT_TRACE_RNAME(rh, rh, qh );
1382 while ( rh != NULL )
1384 - PR_GET_TRACE_NAME_FROM_HANDLE( rh, qname, rname, desc );
1385 + PR_GET_TRACE_NAME_FROM_HANDLE( rh, &qn, &rn, &dn );
1386 PR_LOG( lm, msgLevel,
1387 ( "QName: %s RName: %s Desc: %s",
1389 @@ -127,7 +127,7 @@ static void ListTraces(void)
1391 PR_FIND_NEXT_TRACE_QNAME(qh, qh);
1395 } /* end ListCounters() */
1398 @@ -326,7 +326,7 @@ static void PR_CALLBACK SampleTrace( voi
1400 static void TraceTest( void )
1405 PR_DEFINE_TRACE( th );
1407 --- pr/tests/io_timeout.c.orig 2015-10-16 13:22:19 UTC
1408 +++ pr/tests/io_timeout.c
1410 /* Used to get the command line option */
1411 #include "plgetopt.h"
1415 +#include <string.h>
1418 #define NUM_THREADS 1
1419 -#define BASE_PORT 8000
1420 +#define BASE_PORT 38011
1421 #define DEFAULT_ACCEPT_TIMEOUT 2
1423 typedef struct threadInfo {
1424 @@ -38,7 +40,7 @@ typedef struct threadInfo {
1427 PRIntn failed_already = 0;
1428 -PRIntn debug_mode = 0;
1429 +PRIntn debug_mode = 1;
1431 #define LOCAL_SCOPE_STRING "LOCAL scope"
1432 #define GLOBAL_SCOPE_STRING "GLOBAL scope"
1433 @@ -54,7 +56,7 @@ thread_main(void *_info)
1434 PRFileDesc *clientSock;
1436 PRThreadScope tscope;
1438 + const char *scope_str;
1442 @@ -73,6 +75,7 @@ thread_main(void *_info)
1445 PR_NOT_REACHED("Invalid thread scope");
1449 printf("thread id %d, scope %s\n", info->id, scope_str);
1450 @@ -91,7 +94,12 @@ thread_main(void *_info)
1451 rv = PR_Bind(listenSock, &listenAddr);
1452 if (rv == PR_FAILURE) {
1454 - printf("unable to bind\n");
1455 + printf("unable to bind to %d: %s\n",
1456 + BASE_PORT + info->id, strerror(PR_GetOSError()));
1457 + if (PR_GetOSError() == EADDRINUSE) {
1458 + printf("can not proceed with this test\n");
1464 @@ -113,8 +121,9 @@ thread_main(void *_info)
1465 if (clientSock == NULL) {
1466 if (PR_GetError() == PR_IO_TIMEOUT_ERROR) {
1468 - printf("PR_Accept() timeout worked!\n");
1469 - printf("TEST PASSED! PR_Accept() returned error %d\n",
1470 + printf("PR_Accept() timeout worked!\n"
1471 + "TEST PASSED! PR_Accept() returned error "
1472 + "PR_IO_TIMEOUT_ERROR (%ld)\n",
1473 PR_IO_TIMEOUT_ERROR);
1476 --- pr/tests/layer.c.orig 2015-10-16 13:22:19 UTC
1477 +++ pr/tests/layer.c
1478 @@ -45,7 +45,10 @@ static PRUint16 default_port = 12273;
1479 static PRFileDesc *PushLayer(PRFileDesc *stack)
1481 PRFileDesc *layer = PR_CreateIOLayerStub(identity, &myMethods);
1482 - PRStatus rv = PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
1483 +#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
1484 + PRStatus rv = /* we only need rv for PR_ASSERT() */
1486 + PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), layer);
1487 if (verbosity > quiet)
1488 PR_fprintf(logFile, "Pushed layer(0x%x) onto stack(0x%x)\n", layer, stack);
1489 PR_ASSERT(PR_SUCCESS == rv);
1490 --- pr/tests/lazyinit.c.orig 2015-10-16 13:22:19 UTC
1491 +++ pr/tests/lazyinit.c
1492 @@ -43,7 +43,6 @@ int main(int argc, char **argv)
1496 - PRCondVar *cv = NULL;
1497 PRThread *thread = NULL;
1498 PRIntervalTime interval = 0;
1499 PRFileDesc *file, *udp, *tcp, *pair[2];
1500 --- pr/tests/lltest.c.orig 2015-10-16 13:22:19 UTC
1501 +++ pr/tests/lltest.c
1502 @@ -545,6 +545,7 @@ TestConversion( void )
1507 static void ShiftCompileOnly()
1510 @@ -561,6 +562,7 @@ static void ShiftCompileOnly()
1511 LL_ISHL(ia, 49, 32);
1513 } /* ShiftCompileOnly */
1518 @@ -635,7 +637,6 @@ TestArithmetic( void )
1519 PRInt64 largeValPlusOne = LL_INIT( 0x00000002, 0x00000000 );
1520 PRInt64 largeValTimesTwo = LL_INIT( 0x00000003, 0xfffffffe );
1521 PRInt64 largeMultCand = LL_INIT( 0x00000000, 0x7fffffff );
1522 - PRInt64 largeMinusMultCand = LL_INIT( 0xffffffff, 0x10000001 );
1523 PRInt64 largeMultCandx64K = LL_INIT( 0x00007fff, 0xffff0000 );
1524 PRInt64 largeNumSHL5 = LL_INIT( 0x0000001f, 0xffffffe0 );
1525 PRInt64 result, result2;
1526 --- pr/tests/mbcs.c.orig 2015-10-16 13:22:19 UTC
1528 @@ -54,13 +54,12 @@ char *dirName = NULL; /* directory nam
1530 ** Traverse directory
1532 -static void TraverseDirectory( unsigned char *dir )
1533 +static void TraverseDirectory(const char *dir)
1536 PRDirEntry *dirEntry;
1543 @@ -81,16 +80,16 @@ static void TraverseDirectory( unsigned
1546 if ( PR_FILE_FILE == info.type ) {
1547 - printf("File: %s \tsize: %ld\n", dirEntry->name, info.size );
1548 + printf("File: %s \tsize: %ld\n", dirEntry->name, (long)info.size );
1549 fd = PR_Open( file, PR_RDONLY, 0 );
1551 printf("PR_Open() failed. Error: %ld, OSError: %ld\n",
1552 - PR_GetError(), PR_GetOSError());
1553 + (long)PR_GetError(), (long)PR_GetOSError());
1555 rc = PR_Close( fd );
1556 if ( PR_FAILURE == rc ) {
1557 printf("PR_Close() failed. Error: %ld, OSError: %ld\n",
1558 - PR_GetError(), PR_GetOSError());
1559 + (long)PR_GetError(), (long)PR_GetOSError());
1561 } else if ( PR_FILE_DIRECTORY == info.type ) {
1562 sprintf( nextDir, "%s/%s", dir, dirEntry->name );
1563 --- pr/tests/nbconn.c.orig 2015-10-16 13:22:19 UTC
1564 +++ pr/tests/nbconn.c
1565 @@ -54,8 +54,7 @@ int main(int argc, char **argv)
1567 PRSocketOptionData optData;
1568 const char *hostname = NULL;
1569 - PRIntn default_case, n, bytes_read, bytes_sent;
1570 - PRInt32 failed_already = 0;
1571 + PRIntn default_case, n;
1575 @@ -164,7 +163,7 @@ int main(int argc, char **argv)
1578 printf( "PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
1579 - PR_GetError(), PR_GetOSError());
1580 + (long)PR_GetError(), (long)PR_GetOSError());
1584 @@ -235,7 +234,7 @@ connection_success_test()
1585 PRThread *thr = NULL;
1587 char send_buf[DATA_BUF_SIZE], recv_buf[DATA_BUF_SIZE];
1588 - PRIntn default_case, n, bytes_read, bytes_sent;
1589 + PRIntn n, bytes_read, bytes_sent;
1590 PRIntn failed_already = 0;
1593 @@ -311,7 +310,7 @@ connection_success_test()
1597 - DPRINTF(("Created TCP_Server thread [0x%x]\n",thr));
1598 + DPRINTF(("Created TCP_Server thread [%p]\n", thr));
1600 pd.in_flags = PR_POLL_WRITE | PR_POLL_EXCEPT;
1601 n = PR_Poll(&pd, 1, PR_INTERVAL_NO_TIMEOUT);
1602 @@ -390,7 +389,7 @@ connection_success_test()
1603 DPRINTF(("Data integrity verified\n"));
1605 fprintf(stderr,"PR_GetConnectStatus: connect failed: (%ld, %ld)\n",
1606 - PR_GetError(), PR_GetOSError());
1607 + (long)PR_GetError(), (long)PR_GetOSError());
1611 @@ -496,7 +495,6 @@ connection_failure_test()
1614 if (PR_GetConnectStatus(&pd) == PR_SUCCESS) {
1616 fprintf(stderr,"PR_GetConnectStatus succeeded, expected to fail\n");
1619 --- pr/tests/nblayer.c.orig 2015-10-16 13:22:19 UTC
1620 +++ pr/tests/nblayer.c
1621 @@ -299,7 +299,7 @@ static PRStatus PR_CALLBACK MyClose(PRFi
1622 static PRInt16 PR_CALLBACK MyPoll(
1623 PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags)
1625 - PRInt16 my_flags, new_flags;
1626 + PRInt16 my_flags = -1, new_flags;
1627 PRFilePrivate *mine = (PRFilePrivate*)fd->secret;
1628 if (0 != (PR_POLL_READ & in_flags))
1630 @@ -342,7 +342,7 @@ static PRFileDesc * PR_CALLBACK MyAccept
1631 PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout)
1634 - PRFileDesc *newfd, *layer = fd;
1635 + PRFileDesc *newfd;
1636 PRFileDesc *newstack;
1637 PRFilePrivate *newsecret;
1639 @@ -428,6 +428,8 @@ static PRInt32 PR_CALLBACK MyRecv(
1640 mine->rcvinprogress = 0;
1641 return mine->rcvreq; /* << -- that's it! */
1643 + PR_ASSERT(!"How did I get this mine->rcvstate?");
1648 @@ -484,6 +486,8 @@ static PRInt32 PR_CALLBACK MySend(
1649 mine->xmtinprogress = 0;
1650 return mine->xmtreq; /* <<-- That's the one! */
1652 + PR_ASSERT(!"How did I get this mine->xmtstate?");
1657 --- pr/tests/nonblock.c.orig 2015-10-16 13:22:19 UTC
1658 +++ pr/tests/nonblock.c
1660 static void PR_CALLBACK
1661 clientThreadFunc(void *arg)
1663 - PRUintn port = (PRUintn)arg;
1664 + intptr_t port = (intptr_t)arg;
1667 char buf[CHUNK_SIZE];
1668 @@ -147,7 +147,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1671 clientThread = PR_CreateThread(PR_USER_THREAD,
1672 - clientThreadFunc, (void *) listenPort,
1673 + clientThreadFunc, (void *) (intptr_t)listenPort,
1674 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1675 PR_UNJOINABLE_THREAD, 0);
1676 if (clientThread == NULL) {
1677 @@ -191,7 +191,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1678 if (retVal != -1 || PR_GetError() != PR_WOULD_BLOCK_ERROR) {
1679 PL_PrintError("First Receive:\n");
1680 fprintf(stderr, "First PR_Recv: retVal: %ld, Error: %ld\n",
1681 - retVal, PR_GetError());
1682 + (long)retVal, (long)PR_GetError());
1685 printf("read: EWOULDBLOCK, good\n");
1686 @@ -201,7 +201,7 @@ static PRIntn PR_CALLBACK RealMain( PRIn
1687 if (retVal != CHUNK_SIZE) {
1688 PL_PrintError("Second Receive:\n");
1689 fprintf(stderr, "Second PR_Recv: retVal: %ld, Error: %ld\n",
1690 - retVal, PR_GetError());
1691 + (long)retVal, (long)PR_GetError());
1694 printf("read: %d bytes, good\n", retVal);
1695 --- pr/tests/obsints.c.orig 2015-10-16 13:22:19 UTC
1696 +++ pr/tests/obsints.c
1697 @@ -25,6 +25,9 @@ int main(int argc, char **argv)
1698 #else /* NO_NSPR_10_SUPPORT */
1700 #include "prtypes.h" /* which includes protypes.h */
1701 +#if !defined(__GNUC__)
1705 int main(int argc, char **argv)
1707 @@ -32,17 +35,17 @@ int main(int argc, char **argv)
1708 * Compilation fails if any of these integer types are not
1709 * defined by protypes.h.
1723 + uintn uin __unused;
1726 + uint8 ui8 __unused;
1727 + int16 i16 __unused;
1728 + uint16 ui16 __unused;
1729 + int32 i32 __unused;
1730 + uint32 ui32 __unused;
1731 + int64 i64 __unused;
1732 + uint64 ui64 __unused;
1736 --- pr/tests/parsetm.c.orig 2015-10-16 13:22:19 UTC
1737 +++ pr/tests/parsetm.c
1738 @@ -31,8 +31,8 @@ static void PrintExplodedTime(const PREx
1740 /* Print day of the week, month, day, hour, minute, and second */
1741 if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
1742 - dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
1743 - et->tm_hour, et->tm_min, et->tm_sec);
1744 + dayOfWeek[et->tm_wday], month[et->tm_month], (long)et->tm_mday,
1745 + (long)et->tm_hour, (long)et->tm_min, (long)et->tm_sec);
1747 /* Print time zone */
1748 totalOffset = et->tm_params.tp_gmt_offset + et->tm_params.tp_dst_offset;
1749 @@ -47,7 +47,7 @@ static void PrintExplodedTime(const PREx
1750 hourOffset = totalOffset / 3600;
1751 minOffset = (totalOffset % 3600) / 60;
1753 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
1754 + printf("%s%02ld%02ld ", sign, (long)hourOffset, (long)minOffset);
1758 --- pr/tests/peek.c.orig 2015-10-16 13:22:19 UTC
1760 @@ -135,7 +135,7 @@ static void ClientNB(void *arg)
1763 PRSocketOptionData opt;
1764 - PRUint16 port = (PRUint16) arg;
1765 + PRUint16 port = (intptr_t) arg;
1767 char buf[BUFFER_SIZE];
1769 @@ -299,7 +299,7 @@ RunTest(PRThreadScope scope, PRFileDesc
1772 client = PR_CreateThread(
1773 - PR_USER_THREAD, ClientNB, (void *) port,
1774 + PR_USER_THREAD, ClientNB, (void *)(intptr_t) port,
1775 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
1776 if (NULL == client) {
1777 fprintf(stderr, "PR_CreateThread failed\n");
1778 --- pr/tests/perf.c.orig 2015-10-16 13:22:19 UTC
1780 @@ -141,7 +141,7 @@ static void PR_CALLBACK CXReader(void *a
1782 for (i = 0; i < n; i++) {
1784 - DPRINTF(("CXReader: thread = 0x%lx waiting\n",
1785 + DPRINTF(("CXReader: thread = %p waiting\n",
1786 PR_GetCurrentThread()));
1787 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
1789 @@ -154,7 +154,7 @@ static void PR_CALLBACK CXReader(void *a
1792 PR_ExitMonitor(mon2);
1793 - DPRINTF(("CXReader: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1794 + DPRINTF(("CXReader: thread = %p exiting\n", PR_GetCurrentThread()));
1797 static void PR_CALLBACK CXWriter(void *arg)
1798 @@ -165,7 +165,7 @@ static void PR_CALLBACK CXWriter(void *a
1800 for (i = 0; i < n; i++) {
1802 - DPRINTF(("CXWriter: thread = 0x%lx waiting\n",
1803 + DPRINTF(("CXWriter: thread = %p waiting\n",
1804 PR_GetCurrentThread()));
1805 PR_Wait(mon, PR_INTERVAL_NO_TIMEOUT);
1807 @@ -178,7 +178,7 @@ static void PR_CALLBACK CXWriter(void *a
1810 PR_ExitMonitor(mon2);
1811 - DPRINTF(("CXWriter: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1812 + DPRINTF(("CXWriter: thread = %p exiting\n", PR_GetCurrentThread()));
1815 static void ContextSwitch(PRThreadScope scope1, PRThreadScope scope2)
1816 @@ -198,7 +198,7 @@ static void ContextSwitch(PRThreadScope
1818 fprintf(stderr, "ContextSwitch: cannot create thread\n");
1820 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
1821 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
1822 (scope1 == PR_GLOBAL_THREAD ?
1823 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1825 @@ -212,7 +212,7 @@ static void ContextSwitch(PRThreadScope
1827 fprintf(stderr, "ContextSwitch: cannot create thread\n");
1829 - DPRINTF(("ContextSwitch: created %s thread = 0x%lx\n",
1830 + DPRINTF(("ContextSwitch: created %s thread = %p\n",
1831 (scope2 == PR_GLOBAL_THREAD ?
1832 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1834 @@ -254,10 +254,10 @@ static void PR_CALLBACK SemaThread(void
1837 for (i = 0; i < n; i++) {
1838 - DPRINTF(("SemaThread: thread = 0x%lx waiting on sem = 0x%lx\n",
1839 + DPRINTF(("SemaThread: thread = %p waiting on sem = %p\n",
1840 PR_GetCurrentThread(), sem[0]));
1842 - DPRINTF(("SemaThread: thread = 0x%lx posting on sem = 0x%lx\n",
1843 + DPRINTF(("SemaThread: thread = %p posting on sem = %p\n",
1844 PR_GetCurrentThread(), sem[1]));
1847 @@ -266,7 +266,7 @@ static void PR_CALLBACK SemaThread(void
1850 PR_ExitMonitor(mon2);
1851 - DPRINTF(("SemaThread: thread = 0x%lx exiting\n", PR_GetCurrentThread()));
1852 + DPRINTF(("SemaThread: thread = %p exiting\n", PR_GetCurrentThread()));
1855 static PRSemaphore *sem_set1[2];
1856 @@ -294,7 +294,7 @@ static void SemaContextSwitch(PRThreadSc
1858 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
1860 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
1861 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
1862 (scope1 == PR_GLOBAL_THREAD ?
1863 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1865 @@ -309,7 +309,7 @@ static void SemaContextSwitch(PRThreadSc
1867 fprintf(stderr, "SemaContextSwitch: cannot create thread\n");
1869 - DPRINTF(("SemaContextSwitch: created %s thread = 0x%lx\n",
1870 + DPRINTF(("SemaContextSwitch: created %s thread = %p\n",
1871 (scope2 == PR_GLOBAL_THREAD ?
1872 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD"),
1874 --- pr/tests/pipepong.c.orig 2015-10-16 13:22:19 UTC
1875 +++ pr/tests/pipepong.c
1876 @@ -36,7 +36,7 @@ int main(int argc, char **argv)
1877 nBytes = fread(buf, 1, 5, stdin);
1878 fprintf(stderr, "pong process: received \"%s\"\n", buf);
1880 - fprintf(stderr, "pong process: expected 5 bytes but got %d bytes\n",
1881 + fprintf(stderr, "pong process: expected 5 bytes but got %zd bytes\n",
1885 --- pr/tests/poll_nm.c.orig 2015-10-16 13:22:19 UTC
1886 +++ pr/tests/poll_nm.c
1887 @@ -47,7 +47,7 @@ PRIntn debug_mode;
1888 static void PR_CALLBACK
1889 clientThreadFunc(void *arg)
1891 - PRUintn port = (PRUintn) arg;
1892 + PRUintn port = (intptr_t) arg;
1896 @@ -196,7 +196,7 @@ int main(int argc, char **argv)
1899 clientThread = PR_CreateThread(PR_USER_THREAD,
1900 - clientThreadFunc, (void *) listenPort1,
1901 + clientThreadFunc, (void *)(intptr_t)listenPort1,
1902 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1903 PR_UNJOINABLE_THREAD, 0);
1904 if (clientThread == NULL) {
1905 @@ -206,7 +206,7 @@ int main(int argc, char **argv)
1908 clientThread = PR_CreateThread(PR_USER_THREAD,
1909 - clientThreadFunc, (void *) listenPort2,
1910 + clientThreadFunc, (void *)(intptr_t)listenPort2,
1911 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1912 PR_UNJOINABLE_THREAD, 0);
1913 if (clientThread == NULL) {
1914 --- pr/tests/prfz.c.orig 2015-10-16 13:22:19 UTC
1920 -#include <sys/types.h>
1921 +#include <stdint.h>
1925 --- pr/tests/provider.c.orig 2015-10-16 13:22:19 UTC
1926 +++ pr/tests/provider.c
1927 @@ -1049,7 +1049,7 @@ int main(int argc, char **argv)
1931 - CSClient_t *client;
1932 + CSClient_t *client = NULL;
1933 PRStatus rv, joinStatus;
1934 CSServer_t *server = NULL;
1936 --- pr/tests/prpoll.c.orig 2015-10-16 13:22:19 UTC
1937 +++ pr/tests/prpoll.c
1938 @@ -39,7 +39,7 @@ int main(int argc, char **argv)
1940 clientThreadFunc(void *arg)
1942 - PRUint16 port = (PRUint16) arg;
1943 + PRUint16 port = (PRUint16)(uintptr_t)arg;
1947 @@ -73,7 +73,7 @@ int main(int argc, char **argv)
1950 struct sockaddr_in saddr;
1952 + socklen_t saddr_len;
1953 PRUint16 listenPort3;
1954 PRFileDesc *socket_poll_fd;
1956 @@ -199,7 +199,7 @@ int main(int argc, char **argv)
1959 clientThread = PR_CreateThread(PR_USER_THREAD,
1960 - clientThreadFunc, (void *) listenPort1,
1961 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
1962 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
1963 PR_UNJOINABLE_THREAD, 0);
1964 if (clientThread == NULL) {
1965 @@ -208,7 +208,7 @@ int main(int argc, char **argv)
1968 clientThread = PR_CreateThread(PR_USER_THREAD,
1969 - clientThreadFunc, (void *) listenPort2,
1970 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
1971 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
1972 PR_UNJOINABLE_THREAD, 0);
1973 if (clientThread == NULL) {
1974 @@ -217,7 +217,7 @@ int main(int argc, char **argv)
1977 clientThread = PR_CreateThread(PR_USER_THREAD,
1978 - clientThreadFunc, (void *) listenPort3,
1979 + clientThreadFunc, (void *)(uintptr_t)listenPort3,
1980 PR_PRIORITY_NORMAL, PR_GLOBAL_BOUND_THREAD,
1981 PR_UNJOINABLE_THREAD, 0);
1982 if (clientThread == NULL) {
1983 --- pr/tests/randseed.c.orig 2015-10-16 13:22:19 UTC
1984 +++ pr/tests/randseed.c
1985 @@ -48,7 +48,6 @@ static void Help( void )
1986 static void PrintRand( void *buf, PRIntn size )
1991 printf("%4.4d--\n", size );
1993 --- pr/tests/ranfile.c.orig 2015-10-16 13:22:19 UTC
1994 +++ pr/tests/ranfile.c
1995 @@ -130,7 +130,7 @@ static void PR_CALLBACK Thread(void *arg
1996 PRStatus rv = PR_SUCCESS;
1997 Hammer_t *cd = (Hammer_t*)arg;
1999 - (void)sprintf(filename, "%ssg%04ld.dat", baseName, cd->id);
2000 + (void)sprintf(filename, "%ssg%04d.dat", baseName, (int)cd->id);
2002 if (debug_mode) printf("Starting work on %s\n", filename);
2004 @@ -364,14 +364,14 @@ int main(int argc, char **argv)
2007 if (debug_mode) printf(
2008 - "%s: test failed %s after %ld seconds\n",
2009 - programName, where[hammer[poll].problem], duration);
2010 + "%s: test failed %s after %d seconds\n",
2011 + programName, where[hammer[poll].problem], (int)duration);
2012 else failed_already=1;
2016 if (debug_mode) printf(
2017 - "%s: [%ld [%ld] %ld] writes/sec average\n",
2018 + "%s: [%d [%d] %d] writes/sec average\n",
2019 programName, writesMin, writesTot * 1000 / durationTot, writesMax);
2021 PR_DestroyCondVar(cv);
2022 --- pr/tests/runtests.sh.orig 2015-10-16 13:22:19 UTC
2023 +++ pr/tests/runtests.sh
2024 @@ -58,9 +58,6 @@ fi
2025 # Tests not run (but should)
2028 -#forktest (failed on IRIX)
2029 -#nbconn - fails on some platforms
2030 -#poll_er - fails on some platforms? limited use?
2031 #prpoll - the bad-FD test needs to be moved to a different test
2032 #sleep - specific to OS/2
2034 @@ -92,6 +89,7 @@ exit
2042 @@ -99,7 +97,6 @@ getproto
2050 @@ -120,6 +117,7 @@ logger
2058 @@ -136,6 +134,7 @@ perf
2066 @@ -208,7 +207,7 @@ OBJDIR=`basename $PWD`
2067 printf "\nNSPR Test Results - $OBJDIR\n\n"
2068 printf "BEGIN\t\t\t`date`\n"
2069 printf "NSPR_TEST_LOGFILE\t${LOGFILE}\n\n"
2070 -printf "Test\t\t\tResult\n\n"
2071 +printf " Test\t\t\tResult\n\n"
2072 if [ $OS_PLATFORM = "Windows_95" ] || [ $OS_PLATFORM = "Windows_98" ] || [ $OS_PLATFORM = "Windows_NT" ] || [ $OS_PLATFORM = "OS/2" ] ; then
2075 @@ -226,10 +225,8 @@ if [ $OS_PLATFORM = "Windows_95" ] || [
2080 - printf "\nBEGIN TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2082 - ./$prog >> ${LOGFILE} 2>&1 &
2084 + ./$prog >> $prog.output 2>&1 &
2087 if test -n "$TEST_TIMEOUT" && test "$TEST_TIMEOUT" -gt 0
2088 @@ -244,28 +241,11 @@ else
2089 printf "\t\t\tPassed\n";
2091 printf "\t\t\tFAILED\n";
2092 + sed "s,^, $prog: ," < $prog.output
2095 - printf "\nEND TEST: $prog\n\n" >> ${LOGFILE} 2>&1
2099 printf "END\t\t\t`date`\n"
2118 --- pr/tests/sel_spd.c.orig 2015-10-16 13:22:19 UTC
2119 +++ pr/tests/sel_spd.c
2124 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
2125 +# include <unistd.h> /* getopt(3) */
2131 #define PORT_BASE 19000
2133 typedef struct timer_slot_t {
2134 - unsigned long d_connect;
2135 - unsigned long d_cl_data;
2136 - unsigned long d_sv_data;
2137 - unsigned long d_close;
2138 - unsigned long d_total;
2139 - unsigned long requests;
2140 + unsigned int d_connect;
2141 + unsigned int d_cl_data;
2142 + unsigned int d_sv_data;
2143 + unsigned int d_close;
2144 + unsigned int d_total;
2145 + unsigned int requests;
2148 -static long _iterations = 5;
2149 -static long _client_data = 8192;
2150 +static int _iterations = 5;
2151 +static int _client_data = 8192;
2155 @@ -40,12 +43,11 @@ static long _client_data = 8192;
2156 * memory and not be able to allocate thread stack or client/server data
2159 -static long _server_data = (8*1024);
2160 -static long _threads_max = 10, _threads = 10;
2161 +static int _server_data = (8*1024);
2163 -static long _server_data = (128*1024);
2164 -static long _threads_max = 10, _threads = 10;
2165 +static int _server_data = (128*1024);
2167 +static int _threads_max = 10, _threads = 10;
2169 static int verbose=0;
2170 static PRMonitor *exit_cv;
2171 @@ -101,7 +103,7 @@ _server_thread(void *arg_id)
2172 void _client_thread(void *);
2174 int *id = (int *)arg_id;
2176 + PRFileDesc *sock = NULL;
2177 PRSocketOptionData sockopt;
2179 PRFileDesc * newsock;
2180 @@ -469,12 +471,12 @@ void
2181 tally_results(int verbose)
2184 - unsigned long tot_connect = 0;
2185 - unsigned long tot_cl_data = 0;
2186 - unsigned long tot_sv_data = 0;
2187 - unsigned long tot_close = 0;
2188 - unsigned long tot_all = 0;
2189 - unsigned long tot_requests = 0;
2190 + unsigned int tot_connect = 0;
2191 + unsigned int tot_cl_data = 0;
2192 + unsigned int tot_sv_data = 0;
2193 + unsigned int tot_close = 0;
2194 + unsigned int tot_all = 0;
2195 + unsigned int tot_requests = 0;
2197 fprintf(stdout, "Server results:\n\n");
2198 for (index=0; index<_threads_max*2; index+=2) {
2199 --- pr/tests/selct_nm.c.orig 2015-10-16 13:22:19 UTC
2200 +++ pr/tests/selct_nm.c
2201 @@ -45,7 +45,7 @@ PRIntn debug_mode;
2203 clientThreadFunc(void *arg)
2205 - PRUintn port = (PRUintn) arg;
2206 + PRUintn port = (PRUintn)(uintptr_t)arg;
2210 @@ -165,7 +165,7 @@ failed_already=1;
2211 if (debug_mode) printf("%s", buf);
2213 clientThread = PR_CreateThread(PR_USER_THREAD,
2214 - clientThreadFunc, (void *) listenPort1,
2215 + clientThreadFunc, (void *)(uintptr_t)listenPort1,
2216 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2217 PR_UNJOINABLE_THREAD, 0);
2218 if (clientThread == NULL) {
2219 @@ -175,7 +175,7 @@ failed_already=1;
2222 clientThread = PR_CreateThread(PR_USER_THREAD,
2223 - clientThreadFunc, (void *) listenPort2,
2224 + clientThreadFunc, (void *)(uintptr_t)listenPort2,
2225 PR_PRIORITY_NORMAL, PR_LOCAL_THREAD,
2226 PR_UNJOINABLE_THREAD, 0);
2227 if (clientThread == NULL) {
2228 --- pr/tests/select2.c.orig 2015-10-16 13:22:19 UTC
2229 +++ pr/tests/select2.c
2230 @@ -53,6 +53,7 @@ PRInt32 count;
2232 ***********************************************************************/
2234 +static int exitcode = 2;
2236 static void Test_Result (int result)
2238 @@ -60,9 +61,12 @@ static void Test_Result (int result)
2242 + if (exitcode == 2)
2250 printf ("NOSTATUS\n");
2251 @@ -319,4 +323,5 @@ int main(int argc, char **argv)
2257 --- pr/tests/semaerr.c.orig 2015-10-16 13:22:19 UTC
2258 +++ pr/tests/semaerr.c
2259 @@ -65,7 +65,7 @@ int main(int argc, char **argv)
2262 if (PR_GetError() != PR_FILE_NOT_FOUND_ERROR) {
2263 - fprintf(stderr, "Expected error is %d but got (%d, %d)\n",
2264 + fprintf(stderr, "Expected error is %ld (PR_FILE_NOT_FOUND_ERROR) but got (%d, %d)\n",
2265 PR_FILE_NOT_FOUND_ERROR, PR_GetError(), PR_GetOSError());
2268 --- pr/tests/semaerr1.c.orig 2015-10-16 13:22:19 UTC
2269 +++ pr/tests/semaerr1.c
2270 @@ -75,7 +75,7 @@ int main(int argc, char **argv)
2273 if (PR_GetError() != PR_FILE_EXISTS_ERROR) {
2274 - fprintf(stderr, "Expect %d but got %d\n", PR_FILE_EXISTS_ERROR,
2275 + fprintf(stderr, "Expected %ld (PR_FILE_EXISTS_ERROR) but got %d\n", PR_FILE_EXISTS_ERROR,
2279 --- pr/tests/sendzlf.c.orig 2015-10-16 13:22:19 UTC
2280 +++ pr/tests/sendzlf.c
2281 @@ -26,7 +26,7 @@ static void ClientThread(void *arg)
2285 - PRUint16 port = (PRUint16) arg;
2286 + PRUint16 port = (PRUint16)(uintptr_t)arg;
2290 @@ -184,7 +184,7 @@ int main(int argc, char **argv)
2293 clientThread = PR_CreateThread(PR_USER_THREAD,
2294 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
2295 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
2296 PR_PRIORITY_NORMAL, scope, PR_JOINABLE_THREAD, 0);
2297 if (NULL == clientThread) {
2298 fprintf(stderr, "PR_CreateThread failed\n");
2299 --- pr/tests/server_test.c.orig 2015-10-16 13:22:19 UTC
2300 +++ pr/tests/server_test.c
2301 @@ -60,7 +60,7 @@ PRCondVar *ServerStateCV;
2303 #define DPRINTF printf
2306 +#define DPRINTF(...)
2310 @@ -502,6 +502,7 @@ static void do_workUU(void)
2315 static void do_workUK(void)
2317 ServerScope = PR_LOCAL_THREAD;
2318 @@ -522,6 +523,7 @@ static void do_workKK(void)
2319 ClientScope = PR_GLOBAL_THREAD;
2325 static void Measure(void (*func)(void), const char *msg)
2326 --- pr/tests/servr_kk.c.orig 2015-10-16 13:22:19 UTC
2327 +++ pr/tests/servr_kk.c
2328 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2330 #define DPRINTF printf
2333 +#define DPRINTF(...)
2336 PRIntn failed_already=0;
2337 @@ -472,6 +472,7 @@ void do_work()
2338 PR_JoinThread(ServerThread);
2342 static void do_workUU(void)
2344 ServerScope = PR_LOCAL_THREAD;
2345 @@ -492,6 +493,7 @@ static void do_workKU(void)
2346 ClientScope = PR_LOCAL_THREAD;
2351 static void do_workKK(void)
2353 --- pr/tests/servr_ku.c.orig 2015-10-16 13:22:19 UTC
2354 +++ pr/tests/servr_ku.c
2355 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2357 #define DPRINTF printf
2360 +#define DPRINTF(...)
2363 PRIntn failed_already=0;
2364 --- pr/tests/servr_uk.c.orig 2015-10-16 13:22:19 UTC
2365 +++ pr/tests/servr_uk.c
2366 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2368 #define DPRINTF printf
2371 +#define DPRINTF(...)
2374 PRIntn failed_already=0;
2375 --- pr/tests/servr_uu.c.orig 2015-10-16 13:22:19 UTC
2376 +++ pr/tests/servr_uu.c
2377 @@ -57,7 +57,7 @@ PRCondVar *ServerStateCV;
2379 #define DPRINTF printf
2382 +#define DPRINTF(...)
2385 PRIntn failed_already=0;
2386 --- pr/tests/short_thread.c.orig 2015-10-16 13:22:19 UTC
2387 +++ pr/tests/short_thread.c
2388 @@ -43,8 +43,8 @@ int main (int argc, char **argv)
2389 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0))
2392 - "simple_test: Error - PR_CreateThread failed: (%ld, %ld)\n",
2393 - PR_GetError(), PR_GetOSError());
2394 + "simple_test: Error - PR_CreateThread failed: (%d, %d)\n",
2395 + PR_GetError(), PR_GetOSError());
2399 --- pr/tests/socket.c.orig 2015-10-16 13:22:19 UTC
2400 +++ pr/tests/socket.c
2401 @@ -103,13 +103,15 @@ char *LARGE_FILE_NAME = "/tmp/prsocket_t
2404 static PRInt32 num_tcp_clients = NUM_TCP_CLIENTS;
2405 -static PRInt32 num_udp_clients = NUM_UDP_CLIENTS;
2406 static PRInt32 num_transmitfile_clients = NUM_TRANSMITFILE_CLIENTS;
2407 static PRInt32 num_tcp_connections_per_client = NUM_TCP_CONNECTIONS_PER_CLIENT;
2408 static PRInt32 tcp_mesg_size = TCP_MESG_SIZE;
2409 static PRInt32 num_tcp_mesgs_per_connection = NUM_TCP_MESGS_PER_CONNECTION;
2410 +#if defined(SYMBIAN) && !defined(__WINSCW__)
2411 +static PRInt32 num_udp_clients = NUM_UDP_CLIENTS;
2412 static PRInt32 num_udp_datagrams_per_client = NUM_UDP_DATAGRAMS_PER_CLIENT;
2413 static PRInt32 udp_datagram_size = UDP_DGRAM_SIZE;
2416 static PRInt32 thread_count;
2417 PRUint16 server_domain = PR_AF_INET, client_domain = PR_AF_INET;
2418 @@ -181,19 +183,23 @@ readn(PRFileDesc *sockfd, char *buf, int
2425 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
2428 timeout = PR_SecondsToInterval(2);
2430 for (rem=len; rem; offset += bytes, rem -= bytes) {
2431 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
2432 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
2433 PR_GetCurrentThread(), rem));
2437 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
2439 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
2440 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
2441 PR_GetCurrentThread(), bytes));
2444 @@ -224,11 +230,11 @@ writen(PRFileDesc *sockfd, char *buf, in
2447 for (rem=len; rem; offset += bytes, rem -= bytes) {
2448 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
2449 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
2450 PR_GetCurrentThread(), rem));
2451 bytes = PR_Send(sockfd, buf + offset, rem, 0,
2452 PR_INTERVAL_NO_TIMEOUT);
2453 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
2454 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
2455 PR_GetCurrentThread(), bytes));
2458 @@ -279,7 +285,7 @@ Serve_Client(void *arg)
2459 fprintf(stderr,"prsocket_test: ERROR - PR_Shutdown\n");
2462 - DPRINTF(("Serve_Client [0x%lx]: inbuf[0] = 0x%lx\n",PR_GetCurrentThread(),
2463 + DPRINTF(("Serve_Client [%p]: inbuf[0] = %d\n",PR_GetCurrentThread(),
2464 (*((int *) in_buf->data))));
2465 if (writen(sockfd, in_buf->data, bytes) < bytes) {
2466 fprintf(stderr,"prsocket_test: ERROR - Serve_Client:writen\n");
2467 @@ -418,7 +424,7 @@ TCP_Server(void *arg)
2471 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2472 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2473 netaddr.inet.ip, netaddr.inet.port));
2474 if (PR_SetNetAddr(PR_IpAddrLoopback, client_domain,
2475 PR_ntohs(PR_NetAddrInetPort(&netaddr)),
2476 @@ -460,7 +466,7 @@ TCP_Server(void *arg)
2477 scp->datalen = sp->datalen;
2479 t = create_new_thread(PR_USER_THREAD,
2480 - Serve_Client, (void *)scp,
2481 + Serve_Client, (void *)scp,
2484 PR_UNJOINABLE_THREAD,
2485 @@ -470,7 +476,7 @@ TCP_Server(void *arg)
2489 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", t));
2490 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", t));
2494 @@ -486,9 +492,10 @@ exit:
2495 --(*sp->exit_counter);
2496 PR_Notify(sp->exit_mon);
2497 PR_ExitMonitor(sp->exit_mon);
2498 - DPRINTF(("TCP_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2499 + DPRINTF(("TCP_Server [%p] exiting\n", PR_GetCurrentThread()));
2502 +#if defined(SYMBIAN) && !defined(__WINSCW__)
2506 @@ -544,7 +551,7 @@ UDP_Server(void *arg)
2510 - DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2511 + DPRINTF(("PR_Bind: UDP Server netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2512 netaddr.inet.ip, netaddr.inet.port));
2514 * We can't use the IP address returned by PR_GetSockName in
2515 @@ -582,13 +589,13 @@ UDP_Server(void *arg)
2517 memset(&netaddr, 0 , sizeof(netaddr));
2518 for (i = 0; i < (num_udp_clients * num_udp_datagrams_per_client); i++) {
2519 - DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
2520 + DPRINTF(("UDP_Server: calling PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
2521 netaddr.inet.ip, netaddr.inet.port, bytes, in_buf->data,
2524 rv = PR_RecvFrom(sockfd, in_buf->data, bytes, 0, &netaddr,
2525 PR_INTERVAL_NO_TIMEOUT);
2526 - DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%lx, port = %d bytes = %d inbuf = 0x%lx, inbuf[0] = 0x%lx\n",
2527 + DPRINTF(("UDP_Server: PR_RecvFrom client - ip = 0x%x, port = %d bytes = %d inbuf = %p, inbuf[0] = 0x%x\n",
2528 netaddr.inet.ip, netaddr.inet.port, rv, in_buf->data,
2531 @@ -611,8 +618,9 @@ UDP_Server(void *arg)
2532 --(*sp->exit_counter);
2533 PR_Notify(sp->exit_mon);
2534 PR_ExitMonitor(sp->exit_mon);
2535 - DPRINTF(("UDP_Server [0x%x] exiting\n", PR_GetCurrentThread()));
2536 + DPRINTF(("UDP_Server [%p] exiting\n", PR_GetCurrentThread()));
2538 +#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */
2542 @@ -655,7 +663,7 @@ TCP_Client(void *arg)
2544 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0){
2545 fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
2546 - PR_GetError(), PR_GetOSError());
2547 + (long)PR_GetError(), (long)PR_GetOSError());
2551 @@ -663,7 +671,7 @@ TCP_Client(void *arg)
2553 * fill in random data
2555 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
2556 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
2560 @@ -676,7 +684,7 @@ TCP_Client(void *arg)
2564 - DPRINTF(("TCP Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
2565 + DPRINTF(("TCP Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
2566 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
2567 if (readn(sockfd, in_buf->data, bytes) < bytes) {
2568 fprintf(stderr,"prsocket_test: ERROR - TCP_Client:readn\n");
2569 @@ -716,13 +724,14 @@ TCP_Client(void *arg)
2570 --(*cp->exit_counter);
2571 PR_Notify(cp->exit_mon);
2572 PR_ExitMonitor(cp->exit_mon);
2573 - DPRINTF(("TCP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
2574 + DPRINTF(("TCP_Client [%p] exiting\n", PR_GetCurrentThread()));
2577 +#if defined(SYMBIAN) && !defined(__WINSCW__)
2581 - * Create a socket and bind an address
2582 + * Create a socket and bind an address
2583 * Communicate with the server at the address specified in the argument.
2584 * Fill in a buffer, write data to server, read it back and check
2585 * for data corruption.
2586 @@ -780,7 +789,7 @@ UDP_Client(void *arg)
2590 - DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2591 + DPRINTF(("PR_Bind: UDP Client netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2592 netaddr.inet.ip, netaddr.inet.port));
2594 netaddr = cp->server_addr;
2595 @@ -797,9 +806,9 @@ UDP_Client(void *arg)
2597 * fill in random data
2599 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx bytes = 0x%lx\n",
2600 + DPRINTF(("UDP_Client [%p]: out_buf = %p bytes = %d\n",
2601 PR_GetCurrentThread(), out_buf->data, bytes));
2602 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i, bytes);
2603 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i, bytes);
2607 @@ -812,7 +821,7 @@ UDP_Client(void *arg)
2611 - DPRINTF(("UDP_Client [0x%lx]: out_buf = 0x%lx out_buf[0] = 0x%lx\n",
2612 + DPRINTF(("UDP_Client [%p]: out_buf = %p out_buf[0] = 0x%x\n",
2613 PR_GetCurrentThread(), out_buf, (*((int *) out_buf->data))));
2614 if (cp->udp_connect)
2615 rv = PR_Recv(sockfd, in_buf->data, bytes, 0,
2616 @@ -823,7 +832,7 @@ UDP_Client(void *arg)
2620 - DPRINTF(("UDP_Client [0x%lx]: in_buf = 0x%lx in_buf[0] = 0x%lx\n",
2621 + DPRINTF(("UDP_Client [%p]: in_buf = %p in_buf[0] = 0x%x\n",
2622 PR_GetCurrentThread(), in_buf, (*((int *) in_buf->data))));
2624 * verify the data read
2625 @@ -848,12 +857,13 @@ UDP_Client(void *arg)
2626 PR_Notify(cp->exit_mon);
2627 PR_ExitMonitor(cp->exit_mon);
2629 - DPRINTF(("UDP_Client [0x%x] exiting\n", PR_GetCurrentThread()));
2630 + DPRINTF(("UDP_Client [%p] exiting\n", PR_GetCurrentThread()));
2632 +#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */
2635 * TCP_Socket_Client_Server_Test - concurrent server test
2638 * One server and several clients are started
2639 * Each client connects to the server and sends a chunk of data
2640 * For each connection, server starts another thread to read the data
2641 @@ -905,7 +915,7 @@ TCP_Socket_Client_Server_Test(void)
2642 sparamp->exit_counter = &thread_count;
2643 sparamp->datalen = datalen;
2644 t = PR_CreateThread(PR_USER_THREAD,
2645 - TCP_Server, (void *)sparamp,
2646 + TCP_Server, (void *)sparamp,
2649 PR_UNJOINABLE_THREAD,
2650 @@ -915,7 +925,7 @@ TCP_Socket_Client_Server_Test(void)
2654 - DPRINTF(("Created TCP server = 0x%lx\n", t));
2655 + DPRINTF(("Created TCP server = %p\n", t));
2659 @@ -949,7 +959,7 @@ TCP_Socket_Client_Server_Test(void)
2663 - DPRINTF(("Created TCP client = 0x%lx\n", t));
2664 + DPRINTF(("Created TCP client = %p\n", t));
2667 /* Wait for server and client threads to exit */
2668 @@ -959,17 +969,18 @@ TCP_Socket_Client_Server_Test(void)
2670 PR_ExitMonitor(mon2);
2671 printf("%30s","TCP_Socket_Client_Server_Test:");
2672 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
2673 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
2674 num_tcp_clients, num_tcp_connections_per_client);
2675 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
2676 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
2677 num_tcp_mesgs_per_connection, tcp_mesg_size);
2682 +#if defined(SYMBIAN) && !defined(__WINSCW__)
2684 * UDP_Socket_Client_Server_Test - iterative server test
2687 * One server and several clients are started
2688 * Each client connects to the server and sends a chunk of data
2689 * For each connection, server starts another thread to read the data
2690 @@ -1023,7 +1034,7 @@ UDP_Socket_Client_Server_Test(void)
2691 sparamp->datalen = datalen;
2692 DPRINTF(("Creating UDP server"));
2693 t = PR_CreateThread(PR_USER_THREAD,
2694 - UDP_Server, (void *)sparamp,
2695 + UDP_Server, (void *)sparamp,
2698 PR_UNJOINABLE_THREAD,
2699 @@ -1084,12 +1095,13 @@ UDP_Socket_Client_Server_Test(void)
2701 PR_ExitMonitor(mon2);
2702 printf("%30s","UDP_Socket_Client_Server_Test: ");
2703 - printf("%2ld Server %2ld Clients\n",1l, num_udp_clients);
2704 - printf("%30s %2ld datagrams_per_client %4ld bytes_per_datagram\n",":",
2705 + printf(" 1 Server %2d Clients\n", num_udp_clients);
2706 + printf("%30s %2d datagrams_per_client %4d bytes_per_datagram\n",":",
2707 num_udp_datagrams_per_client, udp_datagram_size);
2711 +#endif /* defined(SYMBIAN) && !defined(__WINSCW__) */
2713 static PRFileDesc *small_file_fd, *large_file_fd;
2714 static void *small_file_addr, *small_file_header, *large_file_addr;
2715 @@ -1441,7 +1453,7 @@ TransmitFile_Client(void *arg)
2716 --(*cp->exit_counter);
2717 PR_Notify(cp->exit_mon);
2718 PR_ExitMonitor(cp->exit_mon);
2719 - DPRINTF(("TransmitFile_Client [0x%lx] exiting\n", PR_GetCurrentThread()));
2720 + DPRINTF(("TransmitFile_Client [%p] exiting\n", PR_GetCurrentThread()));
2724 @@ -1484,7 +1496,7 @@ Serve_TransmitFile_Client(void *arg)
2725 if (bytes != (SMALL_FILE_SIZE+ SMALL_FILE_HEADER_SIZE)) {
2727 "prsocet_test: PR_TransmitFile failed: (%ld, %ld)\n",
2728 - PR_GetError(), PR_GetOSError());
2729 + (long)PR_GetError(), (long)PR_GetOSError());
2732 bytes = PR_TransmitFile(sockfd, local_large_file_fd, NULL, 0,
2733 @@ -1492,7 +1504,7 @@ Serve_TransmitFile_Client(void *arg)
2734 if (bytes != LARGE_FILE_SIZE) {
2736 "prsocket_test: PR_TransmitFile failed: (%ld, %ld)\n",
2737 - PR_GetError(), PR_GetOSError());
2738 + (long)PR_GetError(), (long)PR_GetOSError());
2742 @@ -1520,7 +1532,7 @@ Serve_TransmitFile_Client(void *arg)
2745 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2746 - PR_GetError(), PR_GetOSError());
2747 + (long)PR_GetError(), (long)PR_GetOSError());
2751 @@ -1544,7 +1556,7 @@ Serve_TransmitFile_Client(void *arg)
2754 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2755 - PR_GetError(), PR_GetOSError());
2756 + (long)PR_GetError(), (long)PR_GetOSError());
2760 @@ -1566,7 +1578,7 @@ Serve_TransmitFile_Client(void *arg)
2763 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2764 - PR_GetError(), PR_GetOSError());
2765 + (long)PR_GetError(), (long)PR_GetOSError());
2769 @@ -1588,7 +1600,7 @@ Serve_TransmitFile_Client(void *arg)
2772 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2773 - PR_GetError(), PR_GetOSError());
2774 + (long)PR_GetError(), (long)PR_GetOSError());
2778 @@ -1610,7 +1622,7 @@ Serve_TransmitFile_Client(void *arg)
2781 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2782 - PR_GetError(), PR_GetOSError());
2783 + (long)PR_GetError(), (long)PR_GetOSError());
2787 @@ -1632,7 +1644,7 @@ Serve_TransmitFile_Client(void *arg)
2790 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2791 - PR_GetError(), PR_GetOSError());
2792 + (long)PR_GetError(), (long)PR_GetOSError());
2796 @@ -1654,7 +1666,7 @@ Serve_TransmitFile_Client(void *arg)
2799 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2800 - PR_GetError(), PR_GetOSError());
2801 + (long)PR_GetError(), (long)PR_GetOSError());
2805 @@ -1678,7 +1690,7 @@ Serve_TransmitFile_Client(void *arg)
2808 "prsocket_test: PR_SendFile failed: (%ld, %ld)\n",
2809 - PR_GetError(), PR_GetOSError());
2810 + (long)PR_GetError(), (long)PR_GetOSError());
2814 @@ -1752,7 +1764,7 @@ TransmitFile_Server(void *arg)
2818 - DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
2819 + DPRINTF(("TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
2820 netaddr.inet.ip, netaddr.inet.port));
2821 tcp_server_addr.inet.family = netaddr.inet.family;
2822 tcp_server_addr.inet.port = netaddr.inet.port;
2823 @@ -1807,7 +1819,7 @@ TransmitFile_Server(void *arg)
2824 scp->datalen = sp->datalen;
2826 t[i] = PR_CreateThread(PR_USER_THREAD,
2827 - Serve_TransmitFile_Client, (void *)scp,
2828 + Serve_TransmitFile_Client, (void *)scp,
2832 @@ -1818,7 +1830,7 @@ TransmitFile_Server(void *arg)
2836 - DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = 0x%lx\n", t));
2837 + DPRINTF(("TransmitFile_Server: Created Serve_TransmitFile_Client = %p\n", t));
2841 @@ -1846,12 +1858,12 @@ exit:
2842 --(*sp->exit_counter);
2843 PR_Notify(sp->exit_mon);
2844 PR_ExitMonitor(sp->exit_mon);
2845 - DPRINTF(("TransmitFile_Server [0x%lx] exiting\n", PR_GetCurrentThread()));
2846 + DPRINTF(("TransmitFile_Server [%p] exiting\n", PR_GetCurrentThread()));
2850 - * Socket_Misc_Test - test miscellaneous functions
2852 + * Socket_Misc_Test - test miscellaneous functions
2856 Socket_Misc_Test(void)
2857 @@ -1986,7 +1998,7 @@ Socket_Misc_Test(void)
2859 "prsocket_test failed to write to file %s: (%ld, %ld)\n",
2861 - PR_GetError(), PR_GetOSError());
2862 + (long)PR_GetError(), (long)PR_GetOSError());
2866 @@ -2065,7 +2077,7 @@ Socket_Misc_Test(void)
2867 sparamp->exit_counter = &thread_count;
2868 sparamp->datalen = datalen;
2869 t = PR_CreateThread(PR_USER_THREAD,
2870 - TransmitFile_Server, (void *)sparamp,
2871 + TransmitFile_Server, (void *)sparamp,
2874 PR_UNJOINABLE_THREAD,
2875 @@ -2076,7 +2088,7 @@ Socket_Misc_Test(void)
2879 - DPRINTF(("Created TCP server = 0x%x\n", t));
2880 + DPRINTF(("Created TCP server = %p\n", t));
2884 @@ -2113,7 +2125,7 @@ Socket_Misc_Test(void)
2888 - DPRINTF(("Created TransmitFile client = 0x%lx\n", t));
2889 + DPRINTF(("Created TransmitFile client = %p\n", t));
2892 /* Wait for server and client threads to exit */
2893 @@ -2144,7 +2156,7 @@ done:
2895 if ((PR_RmDir(TEST_DIR)) == PR_FAILURE) {
2896 fprintf(stderr,"prsocket_test failed to rmdir %s: (%ld, %ld)\n",
2897 - TEST_DIR, PR_GetError(), PR_GetOSError());
2898 + TEST_DIR, (long)PR_GetError(), (long)PR_GetOSError());
2902 --- pr/tests/sprintf.c.orig 2015-10-16 13:22:19 UTC
2903 +++ pr/tests/sprintf.c
2904 @@ -127,7 +127,7 @@ static void test_l(char *pattern, char *
2905 (strncmp(s, sbuf, sizeof(sbuf)) != 0)) {
2907 "pattern='%s' l=%ld\nPR_smprintf='%s'\nPR_snprintf='%s'\n sprintf='%s'\n",
2908 - pattern, l, s, buf, sbuf);
2909 + pattern, (long)l, s, buf, sbuf);
2910 PR_smprintf_free(s);
2913 --- pr/tests/stack.c.orig 2015-10-16 13:22:19 UTC
2914 +++ pr/tests/stack.c
2915 @@ -54,7 +54,7 @@ PRFileDesc *errhandle;
2916 int main(int argc, char **argv)
2918 #if !(defined(SYMBIAN) && defined(__WINS__))
2919 - PRInt32 rv, cnt, sum;
2922 PRStack *list1, *list2;
2924 @@ -209,7 +209,7 @@ int main(int argc, char **argv)
2925 static void stackop(void *thread_arg)
2927 PRInt32 val, cnt, index, loops;
2928 - DataRecord *Items, *Item;
2929 + DataRecord *Items;
2930 PRStack *list1, *list2;
2932 stack_data *arg = (stack_data *) thread_arg;
2933 --- pr/tests/suspend.c.orig 2015-10-16 13:22:19 UTC
2934 +++ pr/tests/suspend.c
2935 @@ -30,14 +30,14 @@ void PR_CALLBACK
2936 Level_2_Thread(void *arg)
2938 PR_Sleep(PR_MillisecondsToInterval(4 * 1000));
2939 - printf("Level_2_Thread[0x%lx] exiting\n",PR_GetCurrentThread());
2940 + printf("Level_2_Thread[%p] exiting\n",PR_GetCurrentThread());
2945 Level_1_Thread(void *arg)
2947 - PRUint32 tmp = (PRUint32)arg;
2948 + PRUint32 tmp = (PRUint32)(uintptr_t)arg;
2949 PRThreadScope scope = (PRThreadScope) tmp;
2952 @@ -52,7 +52,7 @@ Level_1_Thread(void *arg)
2954 printf("Could not create thread!\n");
2956 - printf("Level_1_Thread[0x%lx] created %15s thread 0x%lx\n",
2957 + printf("Level_1_Thread[%p] created %15s thread %p\n",
2958 PR_GetCurrentThread(),
2959 (scope == PR_GLOBAL_THREAD) ?
2960 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
2961 @@ -63,7 +63,7 @@ Level_1_Thread(void *arg)
2964 PR_ExitMonitor(mon);
2965 - printf("Thread[0x%lx] exiting\n",PR_GetCurrentThread());
2966 + printf("Thread[%p] exiting\n",PR_GetCurrentThread());
2969 static PRStatus PR_CALLBACK print_thread(PRThread *thread, int i, void *arg)
2970 @@ -72,14 +72,15 @@ static PRStatus PR_CALLBACK print_thread
2974 - "\nprint_thread[0x%lx]: %-20s - i = %ld\n",thread,
2975 + "\nprint_thread[%p]: %-20s - i = %ld\n",thread,
2976 (PR_GLOBAL_THREAD == PR_GetThreadScope(thread)) ?
2977 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", i);
2978 registers = PR_GetGCRegisters(thread, 0, (int *)&words);
2980 - printf("Registers R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
2981 - registers[0],registers[1],registers[2],registers[3]);
2982 - printf("Stack Pointer = 0x%lx\n", PR_GetSP(thread));
2983 + printf("Regsters R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
2984 + (unsigned long)registers[0], (unsigned long)registers[1],
2985 + (unsigned long)registers[2], (unsigned long)registers[3]);
2986 + printf("Stack Pointer = %p\n", PR_GetSP(thread));
2990 @@ -107,7 +108,7 @@ static void Level_0_Thread(PRThreadScope
2991 printf("Could not create thread!\n");
2994 - printf("Level_0_Thread[0x%lx] created %15s thread 0x%lx\n",
2995 + printf("Level_0_Thread[%p] created %15s thread %p\n",
2996 PR_GetCurrentThread(),
2997 (scope1 == PR_GLOBAL_THREAD) ?
2998 "PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
2999 @@ -119,9 +120,10 @@ static void Level_0_Thread(PRThreadScope
3000 PR_EnumerateThreads(print_thread, NULL);
3001 registers = PR_GetGCRegisters(me, 1, (int *)&words);
3003 - printf("My Registers: R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
3004 - registers[0],registers[1],registers[2],registers[3]);
3005 - printf("My Stack Pointer = 0x%lx\n", PR_GetSP(me));
3006 + printf("My Registers: R0 = 0x%lx R1 = 0x%lx R2 = 0x%lx R3 = 0x%lx\n",
3007 + (unsigned long)registers[0], (unsigned long)registers[1],
3008 + (unsigned long)registers[2], (unsigned long)registers[3]);
3009 + printf("My Stack Pointer = %p\n", PR_GetSP(me));
3012 /* Wait for all threads to exit */
3013 --- pr/tests/switch.c.orig 2015-10-16 13:22:19 UTC
3014 +++ pr/tests/switch.c
3015 @@ -80,7 +80,7 @@ PRIntn PR_CALLBACK Switch(PRIntn argc, c
3017 PRBool help = PR_FALSE;
3018 PRUintn concurrency = 1;
3019 - Shared *shared, *link;
3020 + Shared *shared = NULL, *link;
3021 PRIntervalTime timein, timeout;
3022 PRThreadScope thread_scope = PR_LOCAL_THREAD;
3023 PRUintn thread_count, inner_count, loop_count, average;
3024 --- pr/tests/testfile.c.orig 2015-10-16 13:22:19 UTC
3025 +++ pr/tests/testfile.c
3026 @@ -36,6 +36,9 @@ static int _debug_on = 0;
3030 +#if defined(XP_UNIX) || defined(XP_OS2_EMX)
3031 +# include <unistd.h> /* getopt(3) */
3034 #define DPRINTF(arg) if (_debug_on) printf arg
3036 @@ -93,7 +96,7 @@ static PRInt32 PR_CALLBACK DirTest(void
3037 PRInt32 dirtest_failed = 0;
3039 PRThread* create_new_thread(PRThreadType type,
3040 - void (*start)(void *arg),
3041 + void *(*start)(void *arg),
3043 PRThreadPriority priority,
3044 PRThreadScope scope,
3045 @@ -155,7 +158,7 @@ PRInt32 native_thread = 0;
3046 return((PRThread *) thandle);
3049 - return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3050 + return(PR_CreateThread(type,(void (*)(void*))start,arg,priority,scope,state,stackSize));
3053 return(PR_CreateThread(type,start,arg,priority,scope,state,stackSize));
3054 @@ -316,8 +319,8 @@ char tmpname[1024];
3056 "testfile PR_GetFileInfo returned incorrect status-change time: %s\n",
3058 - printf("ft = %lld, ft1 = %lld\n",file_info.creationTime,
3059 - file_info1.creationTime);
3060 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.creationTime,
3061 + (long long)file_info1.creationTime);
3065 @@ -342,8 +345,8 @@ char tmpname[1024];
3067 "testfile PR_GetFileInfo returned incorrect modify time: %s\n",
3069 - printf("ft = %lld, ft1 = %lld\n",file_info.modifyTime,
3070 - file_info1.modifyTime);
3071 + printf("ft = %lld, ft1 = %lld\n", (long long)file_info.modifyTime,
3072 + (long long)file_info1.modifyTime);
3076 @@ -469,7 +472,7 @@ File_Rdwr_Param *fparamp;
3077 memset(fparamp->buf, i, len);
3079 t = create_new_thread(PR_USER_THREAD,
3080 - File_Write, (void *)fparamp,
3081 + (void *(*)(void *))File_Write, (void *)fparamp,
3084 PR_UNJOINABLE_THREAD,
3085 @@ -504,7 +507,7 @@ File_Rdwr_Param *fparamp;
3088 t = create_new_thread(PR_USER_THREAD,
3089 - File_Read, (void *)fparamp,
3090 + (void *(*)(void *))File_Read, (void *)fparamp,
3093 PR_UNJOINABLE_THREAD,
3094 @@ -572,7 +575,7 @@ struct dirtest_arg thrarg;
3097 t = create_new_thread(PR_USER_THREAD,
3099 + (void *(*)(void *))DirTest, &thrarg,
3102 PR_UNJOINABLE_THREAD,
3103 @@ -895,8 +898,6 @@ int main(int argc, char **argv)
3105 #if defined(XP_UNIX) || defined(XP_OS2)
3107 - extern char *optarg;
3108 - extern int optind;
3110 #if defined(XP_UNIX) || defined(XP_OS2)
3111 while ((opt = getopt(argc, argv, "d")) != EOF) {
3112 --- pr/tests/threads.c.orig 2015-10-16 13:22:19 UTC
3113 +++ pr/tests/threads.c
3114 @@ -27,7 +27,7 @@ void
3116 DumbThread(void *arg)
3118 - PRInt32 tmp = (PRInt32)arg;
3119 + PRInt32 tmp = (PRInt32)(intptr_t)arg;
3120 PRThreadScope scope = (PRThreadScope)tmp;
3123 @@ -167,10 +167,10 @@ int main(int argc, char **argv)
3128 -** Tests lots of thread creations. \n\
3129 -** Create %ld native threads %ld times. \n\
3130 -** Create %ld user threads %ld times \n", iterations,count,iterations,count);
3131 + printf("** Tests lots of thread creations.\n"
3132 + "** Create %d native threads %d times.\n"
3133 + "** Create %d user threads %d times.\n", iterations, count,
3134 + iterations, count);
3137 for (index=0; index<iterations; index++) {
3138 --- pr/tests/thrpool_client.c.orig 2015-10-16 13:22:19 UTC
3139 +++ pr/tests/thrpool_client.c
3140 @@ -82,11 +82,11 @@ readn(PRFileDesc *sockfd, char *buf, int
3141 PRIntervalTime timeout = PR_INTERVAL_NO_TIMEOUT;
3143 for (rem=len; rem; offset += bytes, rem -= bytes) {
3144 - DPRINTF(("thread = 0x%lx: calling PR_Recv, bytes = %d\n",
3145 + DPRINTF(("thread = %p: calling PR_Recv, bytes = %d\n",
3146 PR_GetCurrentThread(), rem));
3147 bytes = PR_Recv(sockfd, buf + offset, rem, 0,
3149 - DPRINTF(("thread = 0x%lx: returning from PR_Recv, bytes = %d\n",
3150 + DPRINTF(("thread = %p: returning from PR_Recv, bytes = %d\n",
3151 PR_GetCurrentThread(), bytes));
3154 @@ -107,11 +107,11 @@ writen(PRFileDesc *sockfd, char *buf, in
3157 for (rem=len; rem; offset += bytes, rem -= bytes) {
3158 - DPRINTF(("thread = 0x%lx: calling PR_Send, bytes = %d\n",
3159 + DPRINTF(("thread = %p: calling PR_Send, bytes = %d\n",
3160 PR_GetCurrentThread(), rem));
3161 bytes = PR_Send(sockfd, buf + offset, rem, 0,
3162 PR_INTERVAL_NO_TIMEOUT);
3163 - DPRINTF(("thread = 0x%lx: returning from PR_Send, bytes = %d\n",
3164 + DPRINTF(("thread = %p: returning from PR_Send, bytes = %d\n",
3165 PR_GetCurrentThread(), bytes));
3168 @@ -164,7 +164,7 @@ TCP_Client(void *arg)
3170 DPRINTF(("TCP client connecting to server:%d\n", server_port));
3171 if (PR_Connect(sockfd, &netaddr,PR_INTERVAL_NO_TIMEOUT) < 0){
3172 - fprintf(stderr, "PR_Connect failed: (%ld, %ld)\n",
3173 + fprintf(stderr, "PR_Connect failed: (%d, %d)\n",
3174 PR_GetError(), PR_GetOSError());
3177 @@ -173,7 +173,7 @@ TCP_Client(void *arg)
3179 * fill in random data
3181 - memset(out_buf->data, ((PRInt32) (&netaddr)) + i + j, bytes);
3182 + memset(out_buf->data, ((intptr_t)(&netaddr)) + i + j, bytes);
3186 @@ -281,7 +281,7 @@ TCP_Socket_Client_Server_Test(void)
3187 PR_EnterMonitor(mon2);
3189 PR_ExitMonitor(mon2);
3190 - DPRINTF(("Created TCP client = 0x%lx\n", thr));
3191 + DPRINTF(("Created TCP client = %p\n", thr));
3193 /* Wait for client jobs to exit */
3194 PR_EnterMonitor(mon2);
3195 @@ -291,9 +291,9 @@ TCP_Socket_Client_Server_Test(void)
3197 PR_ExitMonitor(mon2);
3198 printf("%30s","TCP_Socket_Client_Server_Test:");
3199 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3200 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3201 num_tcp_clients, num_tcp_connections_per_client);
3202 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3203 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3204 num_tcp_mesgs_per_connection, tcp_mesg_size);
3207 --- pr/tests/thrpool_server.c.orig 2015-10-16 13:22:19 UTC
3208 +++ pr/tests/thrpool_server.c
3209 @@ -329,7 +329,7 @@ TCP_Server(void *arg)
3213 - "TCP_Server: PR_BIND netaddr.inet.ip = 0x%lx, netaddr.inet.port = %d\n",
3214 + "TCP_Server: PR_BIND netaddr.inet.ip = 0x%x, netaddr.inet.port = %d\n",
3215 netaddr.inet.ip, netaddr.inet.port));
3217 sp = PR_NEW(Server_Param);
3218 @@ -341,7 +341,7 @@ TCP_Server(void *arg)
3219 sp->iod.socket = sockfd;
3220 sp->iod.timeout = PR_SecondsToInterval(60);
3221 sp->datalen = tcp_mesg_size;
3222 - sp->exit_mon = sc_mon;
3223 + sp->exit_mon = NULL;
3224 sp->job_counterp = &job_counter;
3225 sp->conn_counter = 0;
3227 @@ -464,7 +464,7 @@ TCP_Server_Accept(void *arg)
3230 PR_ASSERT(NULL != jobp);
3231 - DPRINTF(("TCP_Server: Created Serve_Client = 0x%lx\n", jobp));
3232 + DPRINTF(("TCP_Server: Created Serve_Client = %p\n", jobp));
3235 * single-threaded update; no lock needed
3236 @@ -481,7 +481,7 @@ TCP_Server_Accept(void *arg)
3237 print_stats, sp, PR_FALSE);
3239 PR_ASSERT(NULL != jobp);
3240 - DPRINTF(("TCP_Server: Created print_stats timer job = 0x%lx\n", jobp));
3241 + DPRINTF(("TCP_Server: Created print_stats timer job = %p\n", jobp));
3244 PR_EnterMonitor(sp->exit_mon);
3245 @@ -498,9 +498,9 @@ exit:
3247 PR_DestroyMonitor(sp->exit_mon);
3248 printf("%30s","TCP_Socket_Client_Server_Test:");
3249 - printf("%2ld Server %2ld Clients %2ld connections_per_client\n",1l,
3250 + printf(" 1 Server %2d Clients %2d connections_per_client\n",
3251 num_tcp_clients, num_tcp_connections_per_client);
3252 - printf("%30s %2ld messages_per_connection %4ld bytes_per_message\n",":",
3253 + printf("%30s %2d messages_per_connection %4d bytes_per_message\n",":",
3254 num_tcp_mesgs_per_connection, tcp_mesg_size);
3256 DPRINTF(("%s: calling PR_ShutdownThreadPool\n", program_name));
3257 --- pr/tests/thruput.c.orig 2015-10-16 13:22:19 UTC
3258 +++ pr/tests/thruput.c
3259 @@ -66,7 +66,7 @@ static void PR_CALLBACK Clientel(void *a
3263 - PRInt32 bytes, sampled;
3264 + PRInt32 bytes, sampled = -1;
3265 PRIntervalTime now, interval;
3266 PRBool do_display = PR_FALSE;
3267 Shared *shared = (Shared*)arg;
3268 @@ -175,7 +175,7 @@ static void Client(const char *server_na
3270 static void PR_CALLBACK Servette(void *arg)
3272 - PRInt32 bytes, sampled;
3273 + PRInt32 bytes, sampled = -1;
3274 PRIntervalTime now, interval;
3275 PRBool do_display = PR_FALSE;
3276 PRFileDesc *client = (PRFileDesc*)arg;
3277 @@ -373,6 +373,7 @@ int main(int argc, char **argv)
3278 else Client(server_name);
3285 --- pr/tests/timemac.c.orig 2015-10-16 13:22:19 UTC
3286 +++ pr/tests/timemac.c
3287 @@ -24,7 +24,7 @@ static void printExplodedTime(const PREx
3290 /* Print day of the week, month, day, hour, minute, and second */
3291 - printf( "%s %s %ld %02ld:%02ld:%02ld ",
3292 + printf( "%s %s %d %02d:%02d:%02d ",
3293 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3294 et->tm_hour, et->tm_min, et->tm_sec);
3296 @@ -40,7 +40,7 @@ static void printExplodedTime(const PREx
3298 hourOffset = totalOffset / 3600;
3299 minOffset = (totalOffset % 3600) / 60;
3300 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3301 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3305 @@ -97,7 +97,7 @@ int main(int argc, char** argv)
3306 printf("Current local time is ");
3307 printExplodedTime(&et);
3309 - printf("GMT offset is %ld, DST offset is %ld\n",
3310 + printf("GMT offset is %d, DST offset is %d\n",
3311 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3312 t2 = PR_ImplodeTime(&et);
3313 if (LL_NE(t1, t2)) {
3314 --- pr/tests/timetest.c.orig 2015-10-16 13:22:19 UTC
3315 +++ pr/tests/timetest.c
3316 @@ -36,7 +36,7 @@ static void PrintExplodedTime(const PREx
3319 /* Print day of the week, month, day, hour, minute, and second */
3320 - if (debug_mode) printf("%s %s %ld %02ld:%02ld:%02ld ",
3321 + if (debug_mode) printf("%s %s %d %02d:%02d:%02d ",
3322 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3323 et->tm_hour, et->tm_min, et->tm_sec);
3325 @@ -53,7 +53,7 @@ static void PrintExplodedTime(const PREx
3326 hourOffset = totalOffset / 3600;
3327 minOffset = (totalOffset % 3600) / 60;
3329 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3330 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3334 @@ -232,7 +232,7 @@ int main(int argc, char** argv)
3335 if (debug_mode) printf("Current local time is ");
3336 PrintExplodedTime(&et);
3337 if (debug_mode) printf("\n");
3338 - if (debug_mode) printf("GMT offset is %ld, DST offset is %ld\n",
3339 + if (debug_mode) printf("GMT offset is %d, DST offset is %d\n",
3340 et.tm_params.tp_gmt_offset, et.tm_params.tp_dst_offset);
3341 t2 = PR_ImplodeTime(&et);
3342 if (LL_NE(t1, t2)) {
3343 --- pr/tests/y2k.c.orig 2015-10-16 13:22:19 UTC
3345 @@ -43,7 +43,7 @@ static void PrintExplodedTime(const PREx
3348 /* Print day of the week, month, day, hour, minute, and second */
3349 - printf("%s %s %2ld %02ld:%02ld:%02ld ",
3350 + printf("%s %s %2d %02d:%02d:%02d ",
3351 dayOfWeek[et->tm_wday], month[et->tm_month], et->tm_mday,
3352 et->tm_hour, et->tm_min, et->tm_sec);
3354 @@ -62,7 +62,7 @@ static void PrintExplodedTime(const PREx
3356 hourOffset = totalOffset / 3600;
3357 minOffset = (totalOffset % 3600) / 60;
3358 - printf("%s%02ld%02ld ", sign, hourOffset, minOffset);
3359 + printf("%s%02d%02d ", sign, hourOffset, minOffset);
3361 #ifdef PRINT_DETAILS
3362 printf("{%d, %d, %d, %d, %d, %d, %d, %d, %d, { %d, %d}}\n",et->tm_usec,
3363 --- pr/tests/y2ktmo.c.orig 2015-10-16 13:22:19 UTC
3364 +++ pr/tests/y2ktmo.c
3365 @@ -70,7 +70,7 @@ static struct _timeb start_time_tb;
3367 static void SleepThread(void *arg)
3369 - PRIntervalTime timeout = (PRIntervalTime) arg;
3370 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3371 PRIntervalTime elapsed;
3372 #if defined(XP_UNIX) || defined(WIN32)
3373 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3374 @@ -121,7 +121,7 @@ static void SleepThread(void *arg)
3376 static void AcceptThread(void *arg)
3378 - PRIntervalTime timeout = (PRIntervalTime) arg;
3379 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3380 PRIntervalTime elapsed;
3381 #if defined(XP_UNIX) || defined(WIN32)
3382 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3383 @@ -197,7 +197,7 @@ static void AcceptThread(void *arg)
3385 static void PollThread(void *arg)
3387 - PRIntervalTime timeout = (PRIntervalTime) arg;
3388 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3389 PRIntervalTime elapsed;
3390 #if defined(XP_UNIX) || defined(WIN32)
3391 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3392 @@ -276,7 +276,7 @@ static void PollThread(void *arg)
3394 static void WaitCondVarThread(void *arg)
3396 - PRIntervalTime timeout = (PRIntervalTime) arg;
3397 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3398 PRIntervalTime elapsed;
3399 #if defined(XP_UNIX) || defined(WIN32)
3400 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3401 @@ -340,7 +340,7 @@ static void WaitCondVarThread(void *arg)
3403 static void WaitMonitorThread(void *arg)
3405 - PRIntervalTime timeout = (PRIntervalTime) arg;
3406 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3407 PRIntervalTime elapsed;
3408 #if defined(XP_UNIX) || defined(WIN32)
3409 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3410 @@ -397,7 +397,7 @@ static void WaitMonitorThread(void *arg)
3412 static void WaitCMonitorThread(void *arg)
3414 - PRIntervalTime timeout = (PRIntervalTime) arg;
3415 + PRIntervalTime timeout = (PRIntervalTime)(intptr_t)arg;
3416 PRIntervalTime elapsed;
3417 #if defined(XP_UNIX) || defined(WIN32)
3418 PRInt32 timeout_msecs = PR_IntervalToMilliseconds(timeout);
3419 @@ -528,7 +528,7 @@ int main(int argc, char **argv)
3420 for (i = 0; i < num_thread_scopes; i++) {
3421 for (j = 0; j < num_thread_funcs; j++) {
3422 threads[idx] = PR_CreateThread(PR_USER_THREAD, threadFuncs[j],
3423 - (void*)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3424 + (void*)(intptr_t)PR_SecondsToInterval(secs), PR_PRIORITY_NORMAL,
3425 threadScopes[i], PR_JOINABLE_THREAD, 0);
3426 if (threads[idx] == NULL) {
3427 fprintf(stderr, "PR_CreateThread failed\n");
3428 --- pr/tests/zerolen.c.orig 2015-10-16 13:22:19 UTC
3429 +++ pr/tests/zerolen.c
3430 @@ -45,7 +45,7 @@ static void ClientThread(void *arg)
3434 - PRUint16 port = (PRUint16) arg;
3435 + PRUint16 port = (PRUint16)(uintptr_t)arg;
3439 @@ -127,7 +127,7 @@ int main()
3440 * First test PR_Writev.
3442 clientThread = PR_CreateThread(PR_USER_THREAD,
3443 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3444 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3445 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3446 if (NULL == clientThread) {
3447 fprintf(stderr, "PR_CreateThread failed\n");
3448 @@ -171,7 +171,7 @@ int main()
3449 * Then test PR_Write.
3451 clientThread = PR_CreateThread(PR_USER_THREAD,
3452 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3453 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3454 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3455 if (NULL == clientThread) {
3456 fprintf(stderr, "PR_CreateThread failed\n");
3457 @@ -216,7 +216,7 @@ int main()
3458 * Finally test PR_Send.
3460 clientThread = PR_CreateThread(PR_USER_THREAD,
3461 - ClientThread, (void *) PR_ntohs(PR_NetAddrInetPort(&addr)),
3462 + ClientThread, (void *)(uintptr_t)PR_ntohs(PR_NetAddrInetPort(&addr)),
3463 PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0);
3464 if (NULL == clientThread) {
3465 fprintf(stderr, "PR_CreateThread failed\n");
3468 [FILE:2133:patches/patch-warnings]
3469 --- pr/include/prcountr.h.orig 2015-10-16 13:22:19 UTC
3470 +++ pr/include/prcountr.h
3471 @@ -394,7 +394,7 @@ NSPR_API(void)
3472 #define PR_GET_COUNTER(counter,handle)\
3473 (counter) = PR_GetCounter((handle))
3475 -#define PR_GET_COUNTER(counter,handle) 0
3476 +#define PR_GET_COUNTER(counter,handle)
3480 @@ -468,7 +468,7 @@ NSPR_API(void)
3481 #define PR_FIND_NEXT_COUNTER_QNAME(next,handle)\
3482 (next) = PR_FindNextCounterQname((handle))
3484 -#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
3485 +#define PR_FIND_NEXT_COUNTER_QNAME(next,handle)
3488 NSPR_API(PRCounterHandle)
3489 --- pr/src/misc/pralarm.c.orig 2015-10-16 13:22:19 UTC
3490 +++ pr/src/misc/pralarm.c
3491 @@ -101,7 +101,7 @@ static void PR_CALLBACK pr_alarmNotifier
3493 while (why != abort)
3495 - PRIntervalTime pause;
3496 + PRIntervalTime pause = 0;
3498 PR_Lock(alarm->lock);
3500 --- pr/src/misc/prdtoa.c.orig 2015-10-16 13:22:19 UTC
3501 +++ pr/src/misc/prdtoa.c
3502 @@ -2751,7 +2751,7 @@ dtoa
3503 to hold the suppressed trailing zeros.
3506 - int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1,
3507 + int bbits, b2, b5, be, dig, i, ieps, ilim = -1, ilim0, ilim1 = -1,
3508 j, j1, k, k0, k_check, leftright, m2, m5, s2, s5,
3509 spec_case, try_quick;
3511 --- pr/src/pthreads/ptio.c.orig 2015-10-16 13:22:19 UTC
3512 +++ pr/src/pthreads/ptio.c
3513 @@ -4934,6 +4934,7 @@ PR_IMPLEMENT(PRInt32) PR_Select(
3515 if (timeout == PR_INTERVAL_NO_TIMEOUT) {
3517 + start = 0; /* Not needed, but shuts down a warning */
3519 tv.tv_sec = (PRInt32)PR_IntervalToSeconds(timeout);
3520 tv.tv_usec = (PRInt32)PR_IntervalToMicroseconds(
3521 --- pr/src/pthreads/ptsynch.c.orig 2015-10-16 13:22:19 UTC
3522 +++ pr/src/pthreads/ptsynch.c
3523 @@ -30,7 +30,7 @@ static pthread_t pt_zero_tid; /* a null
3524 #endif /* defined(_PR_DCETHREADS) */
3525 #endif /* defined(DEBUG) */
3527 -#if defined(FREEBSD)
3528 +#if defined(FREEBSD) && (defined(DEBUG) || defined(FORCE_PR_ASSERT))
3530 * On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
3531 * Newer versions return EBUSY. We still need to support both.
3534 [FILE:1620:dragonfly/patch-nsprpub_configure]
3535 --- configure.intermediate 2015-11-29 10:31:49 UTC
3537 @@ -6661,6 +6661,27 @@ tools are selected during the Xcode/Deve
3542 + if test -z "$USE_NSPR_THREADS"; then
3545 + $as_echo "#define XP_UNIX 1" >>confdefs.h
3547 + $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
3549 + $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
3551 + CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
3555 + MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
3557 + DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
3558 + MDCPUCFG_H=_dragonfly.cfg
3559 + PR_MD_CSRCS=freebsd.c
3563 if test -z "$USE_NSPR_THREADS"; then
3565 @@ -8284,7 +8305,7 @@ $as_echo_n "checking whether ${CC-cc} ac
3566 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3567 ac_cv_have_dash_pthread=yes
3568 case "$target_os" in
3570 + freebsd*|dragonfly*)
3571 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3574 @@ -8322,7 +8343,7 @@ $as_echo "$ac_cv_have_dash_pthreads" >&6
3579 + *-freebsd*|*-dragonfly*)
3580 $as_echo "#define _REENTRANT 1" >>confdefs.h
3582 $as_echo "#define _THREAD_SAFE 1" >>confdefs.h
3583 @@ -8410,7 +8431,7 @@ case "$target" in
3588 +*-freebsd*|*dragonfly*)
3589 if test -n "$USE_NSPR_THREADS"; then
3590 $as_echo "#define _PR_LOCAL_THREADS_ONLY 1" >>confdefs.h
3594 [FILE:6239:dragonfly/patch-nsprpub_pr_include_md___dragonfly.cfg]
3595 --- pr/include/md/_dragonfly.cfg.orig 2013-06-06 16:24:16.620788000 +0000
3596 +++ pr/include/md/_dragonfly.cfg
3598 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3599 +/* This Source Code Form is subject to the terms of the Mozilla Public
3600 + * License, v. 2.0. If a copy of the MPL was not distributed with this
3601 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
3603 +#ifndef nspr_cpucfg___
3604 +#define nspr_cpucfg___
3610 +#define PR_AF_INET6 28 /* same as AF_INET6 */
3612 +#ifndef HAVE_LONG_LONG
3613 +#define HAVE_LONG_LONG
3616 +#if defined(__i386__)
3618 +#define IS_LITTLE_ENDIAN 1
3619 +#undef IS_BIG_ENDIAN
3620 +#undef HAVE_ALIGNED_DOUBLES
3621 +#undef HAVE_ALIGNED_LONGLONGS
3623 +#define PR_BYTES_PER_BYTE 1
3624 +#define PR_BYTES_PER_SHORT 2
3625 +#define PR_BYTES_PER_INT 4
3626 +#define PR_BYTES_PER_INT64 8
3627 +#define PR_BYTES_PER_LONG 4
3628 +#define PR_BYTES_PER_FLOAT 4
3629 +#define PR_BYTES_PER_DOUBLE 8
3630 +#define PR_BYTES_PER_WORD 4
3631 +#define PR_BYTES_PER_DWORD 8
3632 +#define PR_BYTES_PER_WORD_LOG2 2
3633 +#define PR_BYTES_PER_DWORD_LOG2 3
3635 +#define PR_BITS_PER_BYTE 8
3636 +#define PR_BITS_PER_SHORT 16
3637 +#define PR_BITS_PER_INT 32
3638 +#define PR_BITS_PER_INT64 64
3639 +#define PR_BITS_PER_LONG 32
3640 +#define PR_BITS_PER_FLOAT 32
3641 +#define PR_BITS_PER_DOUBLE 64
3642 +#define PR_BITS_PER_WORD 32
3644 +#define PR_BITS_PER_BYTE_LOG2 3
3645 +#define PR_BITS_PER_SHORT_LOG2 4
3646 +#define PR_BITS_PER_INT_LOG2 5
3647 +#define PR_BITS_PER_INT64_LOG2 6
3648 +#define PR_BITS_PER_LONG_LOG2 5
3649 +#define PR_BITS_PER_FLOAT_LOG2 5
3650 +#define PR_BITS_PER_DOUBLE_LOG2 6
3651 +#define PR_BITS_PER_WORD_LOG2 5
3653 +#define PR_ALIGN_OF_SHORT 2
3654 +#define PR_ALIGN_OF_INT 4
3655 +#define PR_ALIGN_OF_LONG 4
3656 +#define PR_ALIGN_OF_INT64 4
3657 +#define PR_ALIGN_OF_FLOAT 4
3658 +#define PR_ALIGN_OF_DOUBLE 4
3659 +#define PR_ALIGN_OF_POINTER 4
3661 +#elif defined(__alpha__)
3663 +#define IS_LITTLE_ENDIAN 1
3664 +#undef IS_BIG_ENDIAN
3665 +#define HAVE_ALIGNED_DOUBLES
3666 +#define HAVE_ALIGNED_LONGLONGS
3669 +#define PR_BYTES_PER_BYTE 1
3670 +#define PR_BYTES_PER_SHORT 2
3671 +#define PR_BYTES_PER_INT 4
3672 +#define PR_BYTES_PER_INT64 8
3673 +#define PR_BYTES_PER_LONG 8
3674 +#define PR_BYTES_PER_FLOAT 4
3675 +#define PR_BYTES_PER_DOUBLE 8
3676 +#define PR_BYTES_PER_WORD 8
3677 +#define PR_BYTES_PER_DWORD 8
3678 +#define PR_BYTES_PER_WORD_LOG2 3
3679 +#define PR_BYTES_PER_DWORD_LOG2 3
3681 +#define PR_BITS_PER_BYTE 8
3682 +#define PR_BITS_PER_SHORT 16
3683 +#define PR_BITS_PER_INT 32
3684 +#define PR_BITS_PER_INT64 64
3685 +#define PR_BITS_PER_LONG 64
3686 +#define PR_BITS_PER_FLOAT 32
3687 +#define PR_BITS_PER_DOUBLE 64
3688 +#define PR_BITS_PER_WORD 64
3690 +#define PR_BITS_PER_BYTE_LOG2 3
3691 +#define PR_BITS_PER_SHORT_LOG2 4
3692 +#define PR_BITS_PER_INT_LOG2 5
3693 +#define PR_BITS_PER_INT64_LOG2 6
3694 +#define PR_BITS_PER_LONG_LOG2 6
3695 +#define PR_BITS_PER_FLOAT_LOG2 5
3696 +#define PR_BITS_PER_DOUBLE_LOG2 6
3697 +#define PR_BITS_PER_WORD_LOG2 6
3699 +#define PR_ALIGN_OF_SHORT 2
3700 +#define PR_ALIGN_OF_INT 4
3701 +#define PR_ALIGN_OF_LONG 8
3702 +#define PR_ALIGN_OF_INT64 8
3703 +#define PR_ALIGN_OF_FLOAT 4
3704 +#define PR_ALIGN_OF_DOUBLE 8
3705 +#define PR_ALIGN_OF_POINTER 8
3707 +#elif defined(__amd64__)
3709 +#define IS_LITTLE_ENDIAN 1
3710 +#undef IS_BIG_ENDIAN
3711 +#define HAVE_ALIGNED_DOUBLES
3712 +#define HAVE_ALIGNED_LONGLONGS
3715 +#define PR_BYTES_PER_BYTE 1
3716 +#define PR_BYTES_PER_SHORT 2
3717 +#define PR_BYTES_PER_INT 4
3718 +#define PR_BYTES_PER_INT64 8
3719 +#define PR_BYTES_PER_LONG 8
3720 +#define PR_BYTES_PER_FLOAT 4
3721 +#define PR_BYTES_PER_DOUBLE 8
3722 +#define PR_BYTES_PER_WORD 8
3723 +#define PR_BYTES_PER_DWORD 8
3724 +#define PR_BYTES_PER_WORD_LOG2 3
3725 +#define PR_BYTES_PER_DWORD_LOG2 3
3727 +#define PR_BITS_PER_BYTE 8
3728 +#define PR_BITS_PER_SHORT 16
3729 +#define PR_BITS_PER_INT 32
3730 +#define PR_BITS_PER_INT64 64
3731 +#define PR_BITS_PER_LONG 64
3732 +#define PR_BITS_PER_FLOAT 32
3733 +#define PR_BITS_PER_DOUBLE 64
3734 +#define PR_BITS_PER_WORD 64
3736 +#define PR_BITS_PER_BYTE_LOG2 3
3737 +#define PR_BITS_PER_SHORT_LOG2 4
3738 +#define PR_BITS_PER_INT_LOG2 5
3739 +#define PR_BITS_PER_INT64_LOG2 6
3740 +#define PR_BITS_PER_LONG_LOG2 6
3741 +#define PR_BITS_PER_FLOAT_LOG2 5
3742 +#define PR_BITS_PER_DOUBLE_LOG2 6
3743 +#define PR_BITS_PER_WORD_LOG2 6
3745 +#define PR_ALIGN_OF_SHORT 2
3746 +#define PR_ALIGN_OF_INT 4
3747 +#define PR_ALIGN_OF_LONG 8
3748 +#define PR_ALIGN_OF_INT64 8
3749 +#define PR_ALIGN_OF_FLOAT 4
3750 +#define PR_ALIGN_OF_DOUBLE 8
3751 +#define PR_ALIGN_OF_POINTER 8
3752 +#define PR_ALIGN_OF_WORD 8
3756 +#error "Unknown CPU architecture"
3760 +#ifndef NO_NSPR_10_SUPPORT
3762 +#define BYTES_PER_BYTE PR_BYTES_PER_BYTE
3763 +#define BYTES_PER_SHORT PR_BYTES_PER_SHORT
3764 +#define BYTES_PER_INT PR_BYTES_PER_INT
3765 +#define BYTES_PER_INT64 PR_BYTES_PER_INT64
3766 +#define BYTES_PER_LONG PR_BYTES_PER_LONG
3767 +#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT
3768 +#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE
3769 +#define BYTES_PER_WORD PR_BYTES_PER_WORD
3770 +#define BYTES_PER_DWORD PR_BYTES_PER_DWORD
3772 +#define BITS_PER_BYTE PR_BITS_PER_BYTE
3773 +#define BITS_PER_SHORT PR_BITS_PER_SHORT
3774 +#define BITS_PER_INT PR_BITS_PER_INT
3775 +#define BITS_PER_INT64 PR_BITS_PER_INT64
3776 +#define BITS_PER_LONG PR_BITS_PER_LONG
3777 +#define BITS_PER_FLOAT PR_BITS_PER_FLOAT
3778 +#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE
3779 +#define BITS_PER_WORD PR_BITS_PER_WORD
3781 +#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2
3782 +#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2
3783 +#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2
3784 +#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2
3785 +#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2
3786 +#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2
3787 +#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2
3788 +#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2
3790 +#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT
3791 +#define ALIGN_OF_INT PR_ALIGN_OF_INT
3792 +#define ALIGN_OF_LONG PR_ALIGN_OF_LONG
3793 +#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64
3794 +#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT
3795 +#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE
3796 +#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER
3797 +#define ALIGN_OF_WORD PR_ALIGN_OF_WORD
3799 +#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2
3800 +#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2
3801 +#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2
3803 +#endif /* NO_NSPR_10_SUPPORT */
3805 +#endif /* nspr_cpucfg___ */
3808 [FILE:6235:dragonfly/patch-nsprpub_pr_include_md___dragonfly.h]
3809 --- pr/include/md/_dragonfly.h.orig 2013-06-06 18:49:02.829118000 +0000
3810 +++ pr/include/md/_dragonfly.h
3812 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3813 +/* This Source Code Form is subject to the terms of the Mozilla Public
3814 + * License, v. 2.0. If a copy of the MPL was not distributed with this
3815 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
3817 +#ifndef nspr_dragonfly_defs_h___
3818 +#define nspr_dragonfly_defs_h___
3820 +#include "prthread.h"
3823 +#if __FreeBSD__ >= 2
3824 +#include <osreldate.h> /* for __FreeBSD_version */
3826 +#include <sys/syscall.h>
3829 +#define PR_LINKER_ARCH "dragonfly"
3830 +#define _PR_SI_SYSNAME "DRAGONFLY"
3831 +#if defined(__i386__)
3832 +#define _PR_SI_ARCHITECTURE "x86"
3833 +#elif defined(__amd64__)
3834 +#define _PR_SI_ARCHITECTURE "amd64"
3836 +#error "Unknown CPU architecture"
3839 +#define PR_DLL_SUFFIX ".so"
3841 +#define _PR_VMBASE 0x30000000
3842 +#define _PR_STACK_VMBASE 0x50000000
3843 +#define _MD_DEFAULT_STACK_SIZE 65536L
3844 +#define _MD_MMAP_FLAGS MAP_PRIVATE
3846 +#undef HAVE_STACK_GROWING_UP
3849 +#define _PR_HAVE_SOCKADDR_LEN
3850 +#define _PR_STAT_HAS_ST_ATIMESPEC
3851 +#define _PR_HAVE_LARGE_OFF_T
3853 +#define _PR_HAVE_GETPROTO_R
3854 +#define _PR_HAVE_5_ARG_GETPROTO_R
3855 +#define _PR_HAVE_GETHOST_R
3856 +#define _PR_HAVE_GETHOST_R_INT
3858 +#define _PR_POLL_AVAILABLE
3860 +#define _PR_HAVE_SYSV_SEMAPHORES
3861 +#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
3864 +#define _PR_HAVE_INET_NTOP
3865 +#define _PR_HAVE_GETHOSTBYNAME2
3866 +#define _PR_HAVE_GETADDRINFO
3867 +#define _PR_INET6_PROBE
3868 +#define _PR_IPV6_V6ONLY_PROBE
3872 +#ifndef _PR_PTHREADS
3873 +#include <setjmp.h>
3875 +#define PR_CONTEXT_TYPE sigjmp_buf
3877 +#define CONTEXT(_th) ((_th)->md.context)
3879 +#define _MD_GET_SP(_th) (_th)->md.context[0]._sjb[2]
3880 +#define PR_NUM_GCREGS _JBLEN
3883 +** Initialize a thread context to run "_main()" when started
3885 +#define _MD_INIT_CONTEXT(_thread, _sp, _main, status) \
3887 + *status = PR_TRUE; \
3888 + if (sigsetjmp(CONTEXT(_thread), 1)) { \
3891 + _MD_GET_SP(_thread) = (unsigned char*) ((_sp) - 64); \
3894 +#define _MD_SWITCH_CONTEXT(_thread) \
3895 + if (!sigsetjmp(CONTEXT(_thread), 1)) { \
3896 + (_thread)->md.errcode = errno; \
3901 +** Restore a thread context, saved by _MD_SWITCH_CONTEXT
3903 +#define _MD_RESTORE_CONTEXT(_thread) \
3905 + errno = (_thread)->md.errcode; \
3906 + _MD_SET_CURRENT_THREAD(_thread); \
3907 + siglongjmp(CONTEXT(_thread), 1); \
3910 +/* Machine-dependent (MD) data structures */
3913 + PR_CONTEXT_TYPE context;
3918 +struct _MDThreadStack {
3926 +struct _MDSemaphore {
3934 +struct _MDSegment {
3939 + * md-specific cpu structure field
3941 +#define _PR_MD_MAX_OSFD FD_SETSIZE
3943 +struct _MDCPU_Unix {
3945 + PRUint32 ioq_timeout;
3946 + PRInt32 ioq_max_osfd;
3947 + PRInt32 ioq_osfd_cnt;
3948 +#ifndef _PR_USE_POLL
3949 + fd_set fd_read_set, fd_write_set, fd_exception_set;
3950 + PRInt16 fd_read_cnt[_PR_MD_MAX_OSFD],fd_write_cnt[_PR_MD_MAX_OSFD],
3951 + fd_exception_cnt[_PR_MD_MAX_OSFD];
3953 + struct pollfd *ioq_pollfds;
3954 + int ioq_pollfds_size;
3955 +#endif /* _PR_USE_POLL */
3958 +#define _PR_IOQ(_cpu) ((_cpu)->md.md_unix.ioQ)
3959 +#define _PR_ADD_TO_IOQ(_pq, _cpu) PR_APPEND_LINK(&_pq.links, &_PR_IOQ(_cpu))
3960 +#define _PR_FD_READ_SET(_cpu) ((_cpu)->md.md_unix.fd_read_set)
3961 +#define _PR_FD_READ_CNT(_cpu) ((_cpu)->md.md_unix.fd_read_cnt)
3962 +#define _PR_FD_WRITE_SET(_cpu) ((_cpu)->md.md_unix.fd_write_set)
3963 +#define _PR_FD_WRITE_CNT(_cpu) ((_cpu)->md.md_unix.fd_write_cnt)
3964 +#define _PR_FD_EXCEPTION_SET(_cpu) ((_cpu)->md.md_unix.fd_exception_set)
3965 +#define _PR_FD_EXCEPTION_CNT(_cpu) ((_cpu)->md.md_unix.fd_exception_cnt)
3966 +#define _PR_IOQ_TIMEOUT(_cpu) ((_cpu)->md.md_unix.ioq_timeout)
3967 +#define _PR_IOQ_MAX_OSFD(_cpu) ((_cpu)->md.md_unix.ioq_max_osfd)
3968 +#define _PR_IOQ_OSFD_CNT(_cpu) ((_cpu)->md.md_unix.ioq_osfd_cnt)
3969 +#define _PR_IOQ_POLLFDS(_cpu) ((_cpu)->md.md_unix.ioq_pollfds)
3970 +#define _PR_IOQ_POLLFDS_SIZE(_cpu) ((_cpu)->md.md_unix.ioq_pollfds_size)
3972 +#define _PR_IOQ_MIN_POLLFDS_SIZE(_cpu) 32
3975 + struct _MDCPU_Unix md_unix;
3978 +#define _MD_INIT_LOCKS()
3979 +#define _MD_NEW_LOCK(lock) PR_SUCCESS
3980 +#define _MD_FREE_LOCK(lock)
3981 +#define _MD_LOCK(lock)
3982 +#define _MD_UNLOCK(lock)
3983 +#define _MD_INIT_IO()
3984 +#define _MD_IOQ_LOCK()
3985 +#define _MD_IOQ_UNLOCK()
3987 +extern PRStatus _MD_InitializeThread(PRThread *thread);
3989 +#define _MD_INIT_RUNNING_CPU(cpu) _MD_unix_init_running_cpu(cpu)
3990 +#define _MD_INIT_THREAD _MD_InitializeThread
3991 +#define _MD_EXIT_THREAD(thread)
3992 +#define _MD_SUSPEND_THREAD(thread) _MD_suspend_thread
3993 +#define _MD_RESUME_THREAD(thread) _MD_resume_thread
3994 +#define _MD_CLEAN_THREAD(_thread)
3996 +extern PRStatus _MD_CREATE_THREAD(
3998 + void (*start) (void *),
3999 + PRThreadPriority priority,
4000 + PRThreadScope scope,
4001 + PRThreadState state,
4002 + PRUint32 stackSize);
4003 +extern void _MD_SET_PRIORITY(struct _MDThread *thread, PRUintn newPri);
4004 +extern PRStatus _MD_WAIT(PRThread *, PRIntervalTime timeout);
4005 +extern PRStatus _MD_WAKEUP_WAITER(PRThread *);
4006 +extern void _MD_YIELD(void);
4008 +#endif /* ! _PR_PTHREADS */
4010 +extern void _MD_EarlyInit(void);
4012 +#define _MD_EARLY_INIT _MD_EarlyInit
4013 +#define _MD_FINAL_INIT _PR_UnixInit
4014 +#define _MD_INTERVAL_USE_GTOD
4017 + * We wrapped the select() call. _MD_SELECT refers to the built-in,
4018 + * unwrapped version.
4020 +#define _MD_SELECT(nfds,r,w,e,tv) syscall(SYS_select,nfds,r,w,e,tv)
4022 +#if defined(_PR_POLL_AVAILABLE)
4024 +#define _MD_POLL(fds,nfds,timeout) syscall(SYS_poll,fds,nfds,timeout)
4027 +/* freebsd has INADDR_LOOPBACK defined, but in /usr/include/rpc/types.h, and I didn't
4028 + want to be including that.. */
4029 +#ifndef INADDR_LOOPBACK
4030 +#define INADDR_LOOPBACK (u_long)0x7F000001
4034 +#include <sys/uio.h>
4036 +#endif /* nspr_freebsd_defs_h___ */
4039 [FILE:895:dragonfly/patch-nsprpub_pr_include_md__freebsd.h]
4040 --- pr/include/md/_freebsd.h.intermediate 2014-06-20 12:34:59.566379000 +0000
4041 +++ pr/include/md/_freebsd.h
4043 #define _PR_HAVE_GETHOST_R
4044 #define _PR_HAVE_GETHOST_R_INT
4046 -#if __FreeBSD_version >= 400008
4047 +#if defined(__DragonFly__) || __FreeBSD_version >= 400008
4049 * libc_r before this version of FreeBSD doesn't have poll().
4050 * Although libc has poll(), it is not thread-safe so we can't
4052 #define _PR_POLL_AVAILABLE
4055 -#if __FreeBSD_version >= 300000
4056 +#if defined(__DragonFly__) || __FreeBSD_version >= 300000
4057 #define _PR_POLL_AVAILABLE
4058 #define _PR_USE_POLL
4061 #define _PR_HAVE_SYSV_SEMAPHORES
4062 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
4064 -#if __FreeBSD_version >= 400014
4065 +#if defined(__DragonFly__) || __FreeBSD_version >= 400014
4067 #define _PR_HAVE_INET_NTOP
4068 #define _PR_HAVE_GETHOSTBYNAME2
4071 [FILE:1399:dragonfly/patch-nsprpub_pr_include_md__pth.h]
4072 --- pr/include/md/_pth.h.orig 2014-06-05 21:42:08.000000000 +0000
4073 +++ pr/include/md/_pth.h
4075 #define _PT_PTHREAD_COPY_THR_HANDLE(st, dt) (dt) = (st)
4076 #elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \
4077 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4078 - || defined(HPUX) || defined(FREEBSD) \
4079 + || defined(HPUX) || defined(FREEBSD) || defined(__DragonFly__) \
4080 || defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
4081 || defined(NTO) || defined(DARWIN) \
4082 || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN)
4084 #endif /* defined(_PR_DCETHREADS) */
4086 #elif defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4087 - || defined(FREEBSD) || defined(SYMBIAN)
4088 + || defined(FREEBSD) || defined(SYMBIAN) || defined(__DragonFly__)
4089 #define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
4090 #define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
4092 @@ -260,6 +260,7 @@ extern int (*_PT_aix_yield_fcn)();
4093 #elif defined(HPUX) || defined(SOLARIS) \
4094 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4095 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
4096 + || defined(__DragonFly__) \
4097 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
4098 || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN)
4099 #define _PT_PTHREAD_YIELD() sched_yield()
4102 [FILE:291:dragonfly/patch-nsprpub_pr_include_md_prosdep.h]
4103 --- pr/include/md/prosdep.h.orig 2014-06-05 21:42:08.000000000 +0000
4104 +++ pr/include/md/prosdep.h
4105 @@ -43,6 +43,9 @@ PR_BEGIN_EXTERN_C
4106 #elif defined(OPENBSD)
4107 #include "md/_openbsd.h"
4109 +#elif defined(__DragonFly__)
4110 +#include "md/_dragonfly.h"
4113 #include "md/_bsdi.h"
4117 [FILE:494:dragonfly/patch-nsprpub_pr_src_md_unix_uxrng.c]
4118 --- pr/src/md/unix/uxrng.c.orig 2014-06-05 21:42:08.000000000 +0000
4119 +++ pr/src/md/unix/uxrng.c
4120 @@ -86,7 +86,7 @@ GetHighResClock(void *buf, size_t maxbyt
4122 #elif (defined(LINUX) || defined(FREEBSD) || defined(__FreeBSD_kernel__) \
4123 || defined(NETBSD) || defined(__NetBSD_kernel__) || defined(OPENBSD) \
4124 - || defined(SYMBIAN) || defined(__GNU__))
4125 + || defined(SYMBIAN) || defined(__GNU__)) || defined(__DragonFly__)
4126 #include <sys/types.h>
4127 #include <sys/stat.h>
4131 [FILE:723:dragonfly/patch-nsprpub_pr_src_misc_prnetdb.c]
4132 --- pr/src/misc/prnetdb.c.orig 2014-06-20 12:34:59.566379000 +0000
4133 +++ pr/src/misc/prnetdb.c
4134 @@ -78,6 +78,11 @@ PRLock *_pr_dnsLock = NULL;
4135 #define _PR_HAVE_GETPROTO_R_INT
4138 +#if defined(DRAGONFLY)
4139 +#define _PR_HAVE_GETPROTO_R
4140 +#define _PR_HAVE_5_ARG_GETPROTO_R
4143 /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
4144 #if (defined(__GLIBC__) && __GLIBC__ >= 2 && !defined(XP_BEOS))
4145 #define _PR_HAVE_GETPROTO_R
4146 @@ -295,7 +300,7 @@ _pr_QueryNetIfs(void)
4149 #elif (defined(DARWIN) && defined(HAVE_GETIFADDRS)) || defined(FREEBSD) \
4150 - || defined(NETBSD) || defined(OPENBSD)
4151 + || defined(NETBSD) || defined(OPENBSD) || defined(DRAGONFLY)
4154 * Use the BSD getifaddrs function.
4157 [FILE:1005:dragonfly/patch-nsprpub_pr_src_pthreads_ptio.c]
4158 --- pr/src/pthreads/ptio.c.orig 2014-06-20 12:34:59.616376000 +0000
4159 +++ pr/src/pthreads/ptio.c
4160 @@ -180,7 +180,8 @@ static PRBool _pr_ipv6_v6only_on_by_defa
4161 || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
4162 || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
4163 || defined(BSDI) || defined(NTO) || defined(DARWIN) \
4164 - || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN)
4165 + || defined(UNIXWARE) || defined(RISCOS) || defined(SYMBIAN) \
4166 + || defined(__DragonFly__)
4167 #define _PRSelectFdSetArg_t fd_set *
4169 #error "Cannot determine architecture"
4170 @@ -3256,7 +3257,7 @@ static PRIOMethods _pr_socketpollfd_meth
4171 || defined(AIX) || defined(FREEBSD) || defined(NETBSD) \
4172 || defined(OPENBSD) || defined(BSDI) || defined(NTO) \
4173 || defined(DARWIN) || defined(UNIXWARE) || defined(RISCOS) \
4174 - || defined(SYMBIAN)
4175 + || defined(SYMBIAN) || defined(__DragonFly__)
4176 #define _PR_FCNTL_FLAGS O_NONBLOCK
4178 #error "Can't determine architecture"
4181 [FILE:533:dragonfly/patch-nsprpub_pr_src_pthreads_ptsynch.c]
4182 --- pr/src/pthreads/ptsynch.c.orig 2014-06-20 12:34:59.616376000 +0000
4183 +++ pr/src/pthreads/ptsynch.c
4184 @@ -919,7 +919,7 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphor
4186 #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
4187 || defined(FREEBSD) || defined(OPENBSD) || defined(BSDI) \
4188 - || defined(DARWIN) || defined(SYMBIAN)
4189 + || defined(DARWIN) || defined(SYMBIAN) || defined(__DragonFly__)
4190 /* union semun is defined by including <sys/sem.h> */
4192 /* according to X/OPEN we have to define it ourselves */
4195 [FILE:700:dragonfly/patch-pr_tests_Makefile.in]
4196 --- pr/tests/Makefile.in.intermediate 2016-01-08 16:56:54.000000000 +0200
4197 +++ pr/tests/Makefile.in
4198 @@ -342,6 +342,12 @@ ifeq ($(OS_ARCH), UNIXWARE)
4199 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
4202 +ifeq ($(OS_ARCH),DragonFly)
4203 +ifeq ($(USE_PTHREADS),1)
4208 ifeq ($(OS_ARCH),FreeBSD)
4209 ifeq ($(USE_PTHREADS),1)
4211 @@ -370,7 +376,7 @@ LIBPTHREAD = -lpthread
4212 ifeq ($(OS_ARCH),AIX)
4213 LIBPTHREAD = -lpthreads
4215 -ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS QNX Darwin OpenUNIX,$(OS_ARCH)))
4216 +ifeq (,$(filter-out DragonFly FreeBSD OpenBSD BSD_OS QNX Darwin OpenUNIX,$(OS_ARCH)))
4219 ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)