Closed Bug 358023 Opened 18 years ago Closed 18 years ago

Mingw build error in nsNotifyAddrListener.cpp

Categories

(Core :: Networking, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: martijn.martijn, Assigned: cls)

References

Details

Attachments

(3 files, 1 obsolete file)

I get a build error in current trunk builds:
\"1.9a1\" -DMOZILLA_REGION_VERSION=\"1.9a1\" -DMOZILLA_SKIN_VERSION=\"1.8\"  -D_
MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT /cygdrive/c/mozilla/mozilla/netwerk/system/wi
n32/nsNotifyAddrListener.cpp
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:58: error: `PIP
_ADAPTER_ADDRESSES' has not been declared
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:59: error: ISO
C++ forbids declaration of `parameter' with no type
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp: In member func
tion `DWORD nsNotifyAddrListener::CheckAdaptersAddresses()':
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:388: error: `GA
A_FLAG_SKIP_FRIENDLY_NAME' was not declared in this scope
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:388: error: `GA
A_FLAG_SKIP_ANYCAST' was not declared in this scope
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:389: error: `GA
A_FLAG_SKIP_MULTICAST' was not declared in this scope
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:389: error: `GA
A_FLAG_SKIP_DNS_SERVER' was not declared in this scope
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:396: warning: c
onverting to non-pointer type `int' from NULL
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:398: error: `PI
P_ADAPTER_ADDRESSES' was not declared in this scope
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:398: error: exp
ected `;' before "addresses"
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:399: error: `ad
dresses' was not declared in this scope
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:402: error: exp
ected `;' before "ptr"
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:405: error: `pt
r' was not declared in this scope
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:406: error: `If
OperStatusUp' was not declared in this scope
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:407: error: `IF
_TYPE_SOFTWARE_LOOPBACK' was not declared in this scope
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:406: warning: u
nused variable 'IfOperStatusUp'
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:407: warning: u
nused variable 'IF_TYPE_SOFTWARE_LOOPBACK'
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:387: warning: u
nused variable 'flags'
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:388: warning: u
nused variable 'GAA_FLAG_SKIP_FRIENDLY_NAME'
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:388: warning: u
nused variable 'GAA_FLAG_SKIP_ANYCAST'
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:389: warning: u
nused variable 'GAA_FLAG_SKIP_MULTICAST'
c:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:389: warning: u
nused variable 'GAA_FLAG_SKIP_DNS_SERVER'
make[6]: *** [nsNotifyAddrListener.o] Error 1
make[6]: Leaving directory `/cygdrive/c/mozilla/mozilla/netwerk/system/win32'
make[5]: *** [libs] Error 2
make[5]: Leaving directory `/cygdrive/c/mozilla/mozilla/netwerk/system'
make[4]: *** [libs] Error 2
make[4]: Leaving directory `/cygdrive/c/mozilla/mozilla/netwerk'
make[3]: *** [libs_tier_necko] Error 2
make[3]: Leaving directory `/cygdrive/c/mozilla/mozilla'
make[2]: *** [tier_necko] Error 2
make[2]: Leaving directory `/cygdrive/c/mozilla/mozilla'
make[1]: *** [alldep] Error 2
make[1]: Leaving directory `/cygdrive/c/mozilla/mozilla'
make: *** [alldep] Error 2

I think this build error happens because of the patch from bug 354984.
My MingW build has been dead for a while due to other problems, but I can confirm that this problem is now happening with gcc 3.4.5 under MingW/cygwin
Blocks: mingw
I found that GAA_* are defined in iphlpapi.h under MinGW

#include <iphlpapi.h>

The PIP_* problems seemed to be due to my system not having WIN32_WINNT or WINSOCK2_H set correctly so the #if in iptypes.h was resolving as false. I didn't research this fully and just commented out the #if.
I confirm exactly this happened today for me too. I thought maybe the MinGW build problems, which indeed have been present for a while, were solved with the proposed patch for bug 361340. But no, it was not.
(In reply to comment #2)
> I found that GAA_* are defined in iphlpapi.h under MinGW
> 
> #include <iphlpapi.h>
> 
> The PIP_* problems seemed to be due to my system not having WIN32_WINNT or
> WINSOCK2_H set correctly so the #if in iptypes.h was resolving as false. I
> didn't research this fully and just commented out the #if.

Yeah, #include <iphlpapi.h> helps. Adding #define _WIN32_WINNT 0x0501 to iphlpapi.h and iptypes.h also helps.
And I need to add #define IF_TYPE_SOFTWARE_LOOPBACK 24 ( http://msdn2.microsoft.com/en-us/library/aa366320.aspx ) in nsNotifyAddListener.cpp to get it to compile again.
It seems like we sort of know where things go wrong. Now someone knowledgeable needs to make a good patch. Maybe Chris Seawood can help?
Attached patch v1.0Splinter Review
This patch sets the default WINVER to 501 (XP?) for gcc (assumed w32api) builds.  I don't quite understand the purpose of that configure option given that we don't seem to disable features if building for a lower win32 version but I updated it to know about 501.
Attachment #246655 - Flags: review?(benjamin)
Attachment #246655 - Flags: review?(benjamin) → review+
Thanks for the patch, Chris, but for some reason, I'm still getting a build error with my mingw build after applying the patch.
Maybe there is something wrong with my mingw setup?
You need to run autoconf-2.13 after applying the patch.
Checking in configure;
/cvsroot/mozilla/configure,v  <--  configure
new revision: 1.1751; previous revision: 1.1750
done
Checking in configure.in;
/cvsroot/mozilla/configure.in,v  <--  configure.in
new revision: 1.1742; previous revision: 1.1741
done
Checking in netwerk/system/win32/nsNotifyAddrListener.cpp;
/cvsroot/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp,v  <--  nsNotifyAddrListener.cpp
new revision: 1.8; previous revision: 1.7
done
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Thanks guys for your all your help, but it seems that the #define mentioned in comment #4 is not there. This is what I got now:

Building deps for /cygdrive/d/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrL
istener.cpp
/cygdrive/d/mozilla/mozilla/build/cygwin-wrapper g++ -mno-cygwin -o nsNotifyAddr
Listener.o -c  -DMOZILLA_INTERNAL_API -DOSTYPE=\"WINNT5.1\" -DOSARCH=\"WINNT\" -
DBUILD_ID=2006112808 -DIMPL_NS_NET  -I../../../dist/include/xpcom -I../../../dis
t/include/string -I../../../dist/include/pref -I../../../dist/include   -I../../
../dist/include/necko -I../../../dist/include/nspr  -DMOZ_PNG_READ -DPNG_NO_MMX_
CODE -DMOZ_PNG_WRITE  -I../../../dist/sdk/include       -fno-rtti -fno-exception
s -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -
Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -mms-bitfie
lds -pipe  -DNDEBUG -DTRIMMED -O   -DWINVER=0x501 -D_WIN32_WINNT=0x501 -DX_DISPL
AY_MISSING=1 -DMOZILLA_VERSION=\"1.9a1\" -DMOZILLA_VERSION_U=1.9a1 -DHAVE_SNPRIN
TF=1 -D_WINDOWS=1 -D_WIN32=1 -DWIN32=1 -DXP_WIN=1 -DXP_WIN32=1 -DHW_THREADS=1 -D
STDC_HEADERS=1 -DWIN32_LEAN_AND_MEAN=1 -DNO_X11=1 -D_X86_=1 -DD_INO=d_ino -DSTDC
_HEADERS=1 -DHAVE_DIRENT_H=1 -DHAVE_GETOPT_H=1 -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SION=\"1.9a1\" -DMOZILLA_SKIN_VERSION=\"1.8
\"  -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT /cygdrive/d/mozilla/mozilla/netwerk/sy
stem/win32/nsNotifyAddrListener.cpp
d:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp: In member func
tion `DWORD nsNotifyAddrListener::CheckAdaptersAddresses()':
d:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:408: error: `IF
_TYPE_SOFTWARE_LOOPBACK' was not declared in this scope
d:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:408: warning: u
nused variable 'IF_TYPE_SOFTWARE_LOOPBACK'
d:/mozilla/mozilla/netwerk/system/win32/nsNotifyAddrListener.cpp:388: warning: u
nused variable 'flags'
make[6]: *** [nsNotifyAddrListener.o] Error 1
make[6]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw/netwerk/sys
tem/win32'
make[5]: *** [libs] Error 2
make[5]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw/netwerk/sys
tem'
make[4]: *** [libs] Error 2
make[4]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw/netwerk'
make[3]: *** [libs_tier_necko] Error 2
make[3]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw'
make[2]: *** [tier_necko] Error 2
make[2]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw'
make[1]: *** [alldep] Error 2
make[1]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw'
make: *** [alldep] Error 2
Attached patch adding loopback (obsolete) — Splinter Review
Yeah, I get that too, after I have run autoconf (thanks for that tip, Chris).
This solves it for me, but I'm not sure if this is correct. Maybe this is something that should be fixed in mingw?
You'll need to upgrade to w32api 3.8.
Assignee: nobody → cls
Attachment #246773 - Attachment is obsolete: true
Status: RESOLVED → ASSIGNED
Attachment #246806 - Flags: review?(benjamin)
Resolution: FIXED → ---
Attachment #246806 - Flags: review?(benjamin) → review+
Checking in configure;
/cvsroot/mozilla/configure,v  <--  configure
new revision: 1.1755; previous revision: 1.1754
done
Checking in configure.in;
/cvsroot/mozilla/configure.in,v  <--  configure.in
new revision: 1.1746; previous revision: 1.1745
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
Depends on: 363393
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: