Closed Bug 219061 Opened 21 years ago Closed 19 years ago

struct addrinfo defined twice

Categories

(NSPR :: NSPR, defect)

DEC
OSF/1
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jim.brown, Assigned: wtc)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:1.5b) Gecko/20030910
Build Identifier: Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:1.5b) Gecko/20030910

The recent checkins to NSPR cause it to no longer compile on Tru64 V5.1B due to
a multiple declaration of struct addrinfo (once in /usr/include/netdb.h and once
in mozilla/nsprpub/pr/include/md/_osf1.h).  The two structures appear to be
identical.  This broke compiles sometime after 030910 (last good trunk build I
was able to make).

My workaround for this problem is putting #ifndef _OSF_SOURCE/#endif around the
struct declaration in _osf1.h (the opposite of what is in /usr/include/netdb.h).
I have a build going right now and will report on any further problems.
Trunk source was pulled/updated Fri Sep 12 14:40:57 EDT 2003.

diff -r3.12.4.3 _osf1.h
72a73
> #ifndef _OSF_SOURCE
82a84
> #endif


Reproducible: Always

Steps to Reproduce:
Thank you for the bug report.  We knew this would be a
problem on OSF1.  I will attach a patch for you to try
soon.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attached patch Proposed patchSplinter Review
Jim, could you test this patch?

After you have applied this patch, you don't
need to rebuild all of Mozilla.  You just need
to rebuild NSPR.  Do that as follows.

1. cd into the "nsprpub" directory in your build tree.

2. say "gmake clean".

3. say "gmake".

Please let me know if this patch works.  Thanks.
Attachment #131619 - Flags: review?(darin)
This patch resolves the reported problem for me (NSPR builds cleanly).
Comment on attachment 131619 [details] [diff] [review]
Proposed patch

Thanks.  I've checked in this patch on the NSPR trunk (NSPR 4.5)
and NSPRPUB_PRE_4_2_CLIENT_BRANCH (Mozilla 1.6 alpha).

This bug can be marked fixed at this point.  Here are some
pointers for future work.

1. NSPR should use the IPv6 socket extension on Tru64 Unix
version 5.1A or later.	Although some older Tru64 Unix releases
(versions 5.1 and 5.0A) have IPv6, the implementation there is
incomplete or buggy, and the IPv6 feature test in NSPR's
configure script should exclude those Tru64 Unix releases.

2. To get the os version string use sysconfig:

   # sysconfig -q generic version_release
   version_release = V5.1B (Rev. 2650)

or use the sizer(8) command:

   OS_VERSION=`/usr/sbin/sizer -v | awk '{print $4}'`

The sizer command uses the getsysinfo(3) system call to get
the OS Version string...

  #include <sys/sysinfo.h>
  #include <machine/hal_sysinfo.h>

  getsysinfo (op, buffer, nbytes, start, arg, flag)
	  unsigned long op;
	  caddr_t buffer;
	  unsigned long nbytes;
	  int *start;
	  void *arg;
	  unsigned long *flag;
.
.
.
/*
 * Get and display the version string.
 */
 void
getversionstring( void )
{
	char vstring[128];

#define GSI_VERSIONSTRING 62	/* get version string */
	if (getsysinfo (GSI_VERSIONSTRING, vstring, sizeof(vstring), 0, 0) < 0)
		perror ("GSI_VERSIONSTRING");
	else
		fprintf (stdout, "%s", vstring);
}

3. The AI_V4MAPPED, AI_ALL, and AI_ADDRCONFIG flags are
supported by getaddrinfo() in both v5.1A and 5.1B, but
5.1B has more  bug fixes and behaves better.
Comment on attachment 131619 [details] [diff] [review]
Proposed patch

r=darin
Attachment #131619 - Flags: review?(darin) → review+
Target Milestone: --- → 4.6
The fix is in NSPR 4.5.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Target Milestone: 4.6 → 4.5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: