You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Tony Wu <wu...@gmail.com> on 2009/12/22 15:15:19 UTC

request to commit a fix for VS2008 compiler error

Hi,

This is a redefination error because VS2008 defines the IFTYPE too.
simply %s/IFTYPE/INTERFACTTYPE/g on helpers.c could fix it.

Index: working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
===================================================================
--- working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
(revision 893171)
+++ working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
(working copy)
@@ -62,7 +62,7 @@
 I_32 getPlatformAttribute (JNIEnv * env, char *path, DWORD attribute);
 typedef enum {
        OPERSTAT,
-       IFTYPE,
+       INTERFACETYPE,
        FLAGS,
        MTU
 }FLAGTYPE;
@@ -734,7 +734,7 @@
                                        case OPERSTAT:
                                                isSet = ((AdapterAddresses->Oper
Status & flag) == flag);
                                                break;
-                                       case IFTYPE:
+                                       case INTERFACETYPE:
                                                if(flag == IF_TYPE_PPP && isIPv6
)
                                                        isSet = ((AdapterAddress
es->IfType & IF_TYPE_TUNNEL) == IF_TYPE_TUNNEL);
                                                else
@@ -769,12 +769,12 @@

 jboolean getPlatformIsLoopback(JNIEnv * env, jstring ifname, jint jindex)
 {
-       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_SO
FTWARE_LOOPBACK);
+       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
TYPE_SOFTWARE_LOOPBACK);
 }

 jboolean getPlatformIsPoint2Point(JNIEnv * env, jstring ifname, jint jindex)
 {
-       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_PP
P);
+       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
TYPE_PPP);
 }

-- 
Tony Wu
China Software Development Lab, IBM

Re: request to commit a fix for VS2008 compiler error

Posted by Tony Wu <wu...@gmail.com>.
the compiler error looked like below, which was posted by Tim in the
win32 testing thread.

>      [exec]     cl -c -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -GS -FIsehmap.h -D_X86_=1  -DWIN32 -D_WIN32 -W3 -D_WIN95 -D_WIN32_WINDOWS=0x0400 /D_WIN32_DCOM -D_WIN32_IE=0x0500 -DWINVER=0x0400 -Zi -Od -WX -GF -Gs -MD -Zm400   -D_CRT_SECURE_NO_DEPRECATE  -D_CRT_SECURE_NO_WARNINGS  -D_SCL_SECURE_NO_DEPRECATE  -D_DLL -D_
> MT -D_WINSOCKAPI_  /ID:\java6\working_classlib\deploy\include /ID:\java6\working_classlib\deploy\jdk\include /I. /I..\shared\ -Fohelpers.obj helpers.c
>      [exec] helpers.c
>      [exec] helpers.c(65) : error C2365: 'IFTYPE' : redefinition; previous definition was 'typedef'
>      [exec]         C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ipifcons.h(238) : see declaration of 'IFTYPE'
>      [exec] helpers.c(65) : error C2086: 'IFTYPE' : redefinition
>      [exec]         helpers.c(65) : see declaration of 'IFTYPE'
>      [exec] helpers.c(737) : error C2275: 'IFTYPE' : illegal use of this type as an expression
>      [exec]         C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ipifcons.h(238) : see declaration of 'IFTYPE'
>      [exec] helpers.c(737) : error C2046: illegal case
>      [exec] helpers.c(772) : error C2275: 'IFTYPE' : illegal use of this type as an expression
>      [exec]         C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ipifcons.h(238) : see declaration of 'IFTYPE'
>      [exec] helpers.c(772) : error C2198: 'getPlatformNetworkInterfaceAttribute' : too few arguments for call
>      [exec] helpers.c(777) : error C2275: 'IFTYPE' : illegal use of this type as an expression
>      [exec]         C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\ipifcons.h(238) : see declaration of 'IFTYPE'
>      [exec] helpers.c(777) : error C2198: 'getPlatformNetworkInterfaceAttribute' : too few arguments for call
>      [exec] NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2'
>      [exec] Stop.



On Tue, Dec 22, 2009 at 10:15 PM, Tony Wu <wu...@gmail.com> wrote:
> Hi,
>
> This is a redefination error because VS2008 defines the IFTYPE too.
> simply %s/IFTYPE/INTERFACTTYPE/g on helpers.c could fix it.
>
> Index: working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
> ===================================================================
> --- working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
> (revision 893171)
> +++ working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
> (working copy)
> @@ -62,7 +62,7 @@
>  I_32 getPlatformAttribute (JNIEnv * env, char *path, DWORD attribute);
>  typedef enum {
>        OPERSTAT,
> -       IFTYPE,
> +       INTERFACETYPE,
>        FLAGS,
>        MTU
>  }FLAGTYPE;
> @@ -734,7 +734,7 @@
>                                        case OPERSTAT:
>                                                isSet = ((AdapterAddresses->Oper
> Status & flag) == flag);
>                                                break;
> -                                       case IFTYPE:
> +                                       case INTERFACETYPE:
>                                                if(flag == IF_TYPE_PPP && isIPv6
> )
>                                                        isSet = ((AdapterAddress
> es->IfType & IF_TYPE_TUNNEL) == IF_TYPE_TUNNEL);
>                                                else
> @@ -769,12 +769,12 @@
>
>  jboolean getPlatformIsLoopback(JNIEnv * env, jstring ifname, jint jindex)
>  {
> -       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_SO
> FTWARE_LOOPBACK);
> +       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
> TYPE_SOFTWARE_LOOPBACK);
>  }
>
>  jboolean getPlatformIsPoint2Point(JNIEnv * env, jstring ifname, jint jindex)
>  {
> -       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_PP
> P);
> +       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
> TYPE_PPP);
>  }
>
> --
> Tony Wu
> China Software Development Lab, IBM
>



-- 
Tony Wu
China Software Development Lab, IBM

Re: request to commit a fix for VS2008 compiler error

Posted by Tony Wu <wu...@gmail.com>.
Committed revision 893423. Thanks Nathan.

On Wed, Dec 23, 2009 at 1:39 PM, Nathan Beyer <nd...@apache.org> wrote:
> This change seems to work fine for me, so +1.
>
> On Tue, Dec 22, 2009 at 8:27 PM, Nathan Beyer <nd...@apache.org> wrote:
>> On Tue, Dec 22, 2009 at 7:25 PM, Tony Wu <wu...@gmail.com> wrote:
>>> there is no IFTYPE on trunk so it's not necessary to apply it there.
>>
>> Okay, i'm going to test it out quick.
>>
>>>
>>> On Wed, Dec 23, 2009 at 2:07 AM, Nathan Beyer <nd...@apache.org> wrote:
>>>> Would this change be applied to the trunk as well as the branch? If
>>>> so, I'd rather see the code committed there and then the approval be
>>>> for a merge.
>>>>
>>>> -Nathan
>>>>
>>>> On Tue, Dec 22, 2009 at 8:15 AM, Tony Wu <wu...@gmail.com> wrote:
>>>>> Hi,
>>>>>
>>>>> This is a redefination error because VS2008 defines the IFTYPE too.
>>>>> simply %s/IFTYPE/INTERFACTTYPE/g on helpers.c could fix it.
>>>>>
>>>>> Index: working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
>>>>> ===================================================================
>>>>> --- working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
>>>>> (revision 893171)
>>>>> +++ working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
>>>>> (working copy)
>>>>> @@ -62,7 +62,7 @@
>>>>>  I_32 getPlatformAttribute (JNIEnv * env, char *path, DWORD attribute);
>>>>>  typedef enum {
>>>>>        OPERSTAT,
>>>>> -       IFTYPE,
>>>>> +       INTERFACETYPE,
>>>>>        FLAGS,
>>>>>        MTU
>>>>>  }FLAGTYPE;
>>>>> @@ -734,7 +734,7 @@
>>>>>                                        case OPERSTAT:
>>>>>                                                isSet = ((AdapterAddresses->Oper
>>>>> Status & flag) == flag);
>>>>>                                                break;
>>>>> -                                       case IFTYPE:
>>>>> +                                       case INTERFACETYPE:
>>>>>                                                if(flag == IF_TYPE_PPP && isIPv6
>>>>> )
>>>>>                                                        isSet = ((AdapterAddress
>>>>> es->IfType & IF_TYPE_TUNNEL) == IF_TYPE_TUNNEL);
>>>>>                                                else
>>>>> @@ -769,12 +769,12 @@
>>>>>
>>>>>  jboolean getPlatformIsLoopback(JNIEnv * env, jstring ifname, jint jindex)
>>>>>  {
>>>>> -       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_SO
>>>>> FTWARE_LOOPBACK);
>>>>> +       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
>>>>> TYPE_SOFTWARE_LOOPBACK);
>>>>>  }
>>>>>
>>>>>  jboolean getPlatformIsPoint2Point(JNIEnv * env, jstring ifname, jint jindex)
>>>>>  {
>>>>> -       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_PP
>>>>> P);
>>>>> +       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
>>>>> TYPE_PPP);
>>>>>  }
>>>>>
>>>>> --
>>>>> Tony Wu
>>>>> China Software Development Lab, IBM
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Tony Wu
>>> China Software Development Lab, IBM
>>>
>>
>



-- 
Tony Wu
China Software Development Lab, IBM

Re: request to commit a fix for VS2008 compiler error

Posted by Nathan Beyer <nd...@apache.org>.
This change seems to work fine for me, so +1.

On Tue, Dec 22, 2009 at 8:27 PM, Nathan Beyer <nd...@apache.org> wrote:
> On Tue, Dec 22, 2009 at 7:25 PM, Tony Wu <wu...@gmail.com> wrote:
>> there is no IFTYPE on trunk so it's not necessary to apply it there.
>
> Okay, i'm going to test it out quick.
>
>>
>> On Wed, Dec 23, 2009 at 2:07 AM, Nathan Beyer <nd...@apache.org> wrote:
>>> Would this change be applied to the trunk as well as the branch? If
>>> so, I'd rather see the code committed there and then the approval be
>>> for a merge.
>>>
>>> -Nathan
>>>
>>> On Tue, Dec 22, 2009 at 8:15 AM, Tony Wu <wu...@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> This is a redefination error because VS2008 defines the IFTYPE too.
>>>> simply %s/IFTYPE/INTERFACTTYPE/g on helpers.c could fix it.
>>>>
>>>> Index: working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
>>>> ===================================================================
>>>> --- working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
>>>> (revision 893171)
>>>> +++ working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
>>>> (working copy)
>>>> @@ -62,7 +62,7 @@
>>>>  I_32 getPlatformAttribute (JNIEnv * env, char *path, DWORD attribute);
>>>>  typedef enum {
>>>>        OPERSTAT,
>>>> -       IFTYPE,
>>>> +       INTERFACETYPE,
>>>>        FLAGS,
>>>>        MTU
>>>>  }FLAGTYPE;
>>>> @@ -734,7 +734,7 @@
>>>>                                        case OPERSTAT:
>>>>                                                isSet = ((AdapterAddresses->Oper
>>>> Status & flag) == flag);
>>>>                                                break;
>>>> -                                       case IFTYPE:
>>>> +                                       case INTERFACETYPE:
>>>>                                                if(flag == IF_TYPE_PPP && isIPv6
>>>> )
>>>>                                                        isSet = ((AdapterAddress
>>>> es->IfType & IF_TYPE_TUNNEL) == IF_TYPE_TUNNEL);
>>>>                                                else
>>>> @@ -769,12 +769,12 @@
>>>>
>>>>  jboolean getPlatformIsLoopback(JNIEnv * env, jstring ifname, jint jindex)
>>>>  {
>>>> -       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_SO
>>>> FTWARE_LOOPBACK);
>>>> +       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
>>>> TYPE_SOFTWARE_LOOPBACK);
>>>>  }
>>>>
>>>>  jboolean getPlatformIsPoint2Point(JNIEnv * env, jstring ifname, jint jindex)
>>>>  {
>>>> -       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_PP
>>>> P);
>>>> +       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
>>>> TYPE_PPP);
>>>>  }
>>>>
>>>> --
>>>> Tony Wu
>>>> China Software Development Lab, IBM
>>>>
>>>
>>
>>
>>
>> --
>> Tony Wu
>> China Software Development Lab, IBM
>>
>

Re: request to commit a fix for VS2008 compiler error

Posted by Nathan Beyer <nd...@apache.org>.
On Tue, Dec 22, 2009 at 7:25 PM, Tony Wu <wu...@gmail.com> wrote:
> there is no IFTYPE on trunk so it's not necessary to apply it there.

Okay, i'm going to test it out quick.

>
> On Wed, Dec 23, 2009 at 2:07 AM, Nathan Beyer <nd...@apache.org> wrote:
>> Would this change be applied to the trunk as well as the branch? If
>> so, I'd rather see the code committed there and then the approval be
>> for a merge.
>>
>> -Nathan
>>
>> On Tue, Dec 22, 2009 at 8:15 AM, Tony Wu <wu...@gmail.com> wrote:
>>> Hi,
>>>
>>> This is a redefination error because VS2008 defines the IFTYPE too.
>>> simply %s/IFTYPE/INTERFACTTYPE/g on helpers.c could fix it.
>>>
>>> Index: working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
>>> ===================================================================
>>> --- working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
>>> (revision 893171)
>>> +++ working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
>>> (working copy)
>>> @@ -62,7 +62,7 @@
>>>  I_32 getPlatformAttribute (JNIEnv * env, char *path, DWORD attribute);
>>>  typedef enum {
>>>        OPERSTAT,
>>> -       IFTYPE,
>>> +       INTERFACETYPE,
>>>        FLAGS,
>>>        MTU
>>>  }FLAGTYPE;
>>> @@ -734,7 +734,7 @@
>>>                                        case OPERSTAT:
>>>                                                isSet = ((AdapterAddresses->Oper
>>> Status & flag) == flag);
>>>                                                break;
>>> -                                       case IFTYPE:
>>> +                                       case INTERFACETYPE:
>>>                                                if(flag == IF_TYPE_PPP && isIPv6
>>> )
>>>                                                        isSet = ((AdapterAddress
>>> es->IfType & IF_TYPE_TUNNEL) == IF_TYPE_TUNNEL);
>>>                                                else
>>> @@ -769,12 +769,12 @@
>>>
>>>  jboolean getPlatformIsLoopback(JNIEnv * env, jstring ifname, jint jindex)
>>>  {
>>> -       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_SO
>>> FTWARE_LOOPBACK);
>>> +       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
>>> TYPE_SOFTWARE_LOOPBACK);
>>>  }
>>>
>>>  jboolean getPlatformIsPoint2Point(JNIEnv * env, jstring ifname, jint jindex)
>>>  {
>>> -       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_PP
>>> P);
>>> +       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
>>> TYPE_PPP);
>>>  }
>>>
>>> --
>>> Tony Wu
>>> China Software Development Lab, IBM
>>>
>>
>
>
>
> --
> Tony Wu
> China Software Development Lab, IBM
>

Re: request to commit a fix for VS2008 compiler error

Posted by Tony Wu <wu...@gmail.com>.
there is no IFTYPE on trunk so it's not necessary to apply it there.

On Wed, Dec 23, 2009 at 2:07 AM, Nathan Beyer <nd...@apache.org> wrote:
> Would this change be applied to the trunk as well as the branch? If
> so, I'd rather see the code committed there and then the approval be
> for a merge.
>
> -Nathan
>
> On Tue, Dec 22, 2009 at 8:15 AM, Tony Wu <wu...@gmail.com> wrote:
>> Hi,
>>
>> This is a redefination error because VS2008 defines the IFTYPE too.
>> simply %s/IFTYPE/INTERFACTTYPE/g on helpers.c could fix it.
>>
>> Index: working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
>> ===================================================================
>> --- working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
>> (revision 893171)
>> +++ working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
>> (working copy)
>> @@ -62,7 +62,7 @@
>>  I_32 getPlatformAttribute (JNIEnv * env, char *path, DWORD attribute);
>>  typedef enum {
>>        OPERSTAT,
>> -       IFTYPE,
>> +       INTERFACETYPE,
>>        FLAGS,
>>        MTU
>>  }FLAGTYPE;
>> @@ -734,7 +734,7 @@
>>                                        case OPERSTAT:
>>                                                isSet = ((AdapterAddresses->Oper
>> Status & flag) == flag);
>>                                                break;
>> -                                       case IFTYPE:
>> +                                       case INTERFACETYPE:
>>                                                if(flag == IF_TYPE_PPP && isIPv6
>> )
>>                                                        isSet = ((AdapterAddress
>> es->IfType & IF_TYPE_TUNNEL) == IF_TYPE_TUNNEL);
>>                                                else
>> @@ -769,12 +769,12 @@
>>
>>  jboolean getPlatformIsLoopback(JNIEnv * env, jstring ifname, jint jindex)
>>  {
>> -       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_SO
>> FTWARE_LOOPBACK);
>> +       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
>> TYPE_SOFTWARE_LOOPBACK);
>>  }
>>
>>  jboolean getPlatformIsPoint2Point(JNIEnv * env, jstring ifname, jint jindex)
>>  {
>> -       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_PP
>> P);
>> +       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
>> TYPE_PPP);
>>  }
>>
>> --
>> Tony Wu
>> China Software Development Lab, IBM
>>
>



-- 
Tony Wu
China Software Development Lab, IBM

Re: request to commit a fix for VS2008 compiler error

Posted by Nathan Beyer <nd...@apache.org>.
Would this change be applied to the trunk as well as the branch? If
so, I'd rather see the code committed there and then the approval be
for a merge.

-Nathan

On Tue, Dec 22, 2009 at 8:15 AM, Tony Wu <wu...@gmail.com> wrote:
> Hi,
>
> This is a redefination error because VS2008 defines the IFTYPE too.
> simply %s/IFTYPE/INTERFACTTYPE/g on helpers.c could fix it.
>
> Index: working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
> ===================================================================
> --- working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
> (revision 893171)
> +++ working_classlib/modules/luni/src/main/native/luni/windows/helpers.c
> (working copy)
> @@ -62,7 +62,7 @@
>  I_32 getPlatformAttribute (JNIEnv * env, char *path, DWORD attribute);
>  typedef enum {
>        OPERSTAT,
> -       IFTYPE,
> +       INTERFACETYPE,
>        FLAGS,
>        MTU
>  }FLAGTYPE;
> @@ -734,7 +734,7 @@
>                                        case OPERSTAT:
>                                                isSet = ((AdapterAddresses->Oper
> Status & flag) == flag);
>                                                break;
> -                                       case IFTYPE:
> +                                       case INTERFACETYPE:
>                                                if(flag == IF_TYPE_PPP && isIPv6
> )
>                                                        isSet = ((AdapterAddress
> es->IfType & IF_TYPE_TUNNEL) == IF_TYPE_TUNNEL);
>                                                else
> @@ -769,12 +769,12 @@
>
>  jboolean getPlatformIsLoopback(JNIEnv * env, jstring ifname, jint jindex)
>  {
> -       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_SO
> FTWARE_LOOPBACK);
> +       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
> TYPE_SOFTWARE_LOOPBACK);
>  }
>
>  jboolean getPlatformIsPoint2Point(JNIEnv * env, jstring ifname, jint jindex)
>  {
> -       return getPlatformNetworkInterfaceAttribute(env,IFTYPE,jindex,IF_TYPE_PP
> P);
> +       return getPlatformNetworkInterfaceAttribute(env,INTERFACETYPE,jindex,IF_
> TYPE_PPP);
>  }
>
> --
> Tony Wu
> China Software Development Lab, IBM
>