public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: jdwp build failure
@ 2007-02-22  8:12 Danny Smith
  2007-02-22  8:21 ` Marco Trudel
  0 siblings, 1 reply; 4+ messages in thread
From: Danny Smith @ 2007-02-22  8:12 UTC (permalink / raw)
  To: java-patches; +Cc: gnustuff

Hello Mohan

Another comment from unsubscribed lurker.
Mohan wrote at 
http://gcc.gnu.org/ml/java-patches/2007-q1/msg0


> Hi All,

>>Mohan> I haven't looked into this much, but if the Linux folks aren't
>>Mohan> having a problem with this, I'm suspecting a Win32 macro
>>Mohan> which is colliding with OUT. Just a guess, though.
>
>>It would be nice to know where this conflict comes from.
>>Sometimes a '#undef OUT' in win32.h can help...
>>But if we have to we can rename the field.
>
>I had already tried that, but it didn't work. I had even put an
>#undef OUT in the offending .cc file with no luck. Still, if it
>only happens on Win32, it has to be a macro, right?.
>I've only made half-hearted attempts here.  Marco? Otherwise, I'll
>try to look at it sometime tomorrow.
>

#undef OUT 
should work if done _after_ including <windows.h>

maybe here

Index: natVMVirtualMachine.cc
===================================================================
--- natVMVirtualMachine.cc	(revision 122101)
+++ natVMVirtualMachine.cc	(working copy)
@@ -56,6 +56,8 @@
 #include <gnu/gcj/jvmti/Breakpoint.h>
 #include <gnu/gcj/jvmti/BreakpointManager.h>
 
+#undef OUT
+
 using namespace java::lang;
 using namespace gnu::classpath::jdwp::event;
 using namespace gnu::classpath::jdwp::util;

OUT is a macro in windef.h, which gets included by windows.h
With newer versons of mingw's w32api, we have this in windef.h

/* Pseudo modifiers for parameters 
   We don't use these unnecessary defines in the w32api headers. Define
   them by default since that is what people expect, but allow users
   to avoid the pollution.  */
#ifndef _NO_W32_PSEUDO_MODIFIERS
#define IN
#define OUT
#ifndef OPTIONAL
#define OPTIONAL
#endif
#endif

so you could just #define _NO_W32_PSEUDO_MODIFIERS before including
anything and 
humbly-pie request that win32 developers upgrade to newer w32api 

Danny

>-- Mohan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: jdwp build failure
  2007-02-22  8:12 jdwp build failure Danny Smith
@ 2007-02-22  8:21 ` Marco Trudel
  2007-02-22 14:18   ` Patch [MinGW] FYI: #undef OUT (was Re: jdwp build failure) Mohan Embar
  0 siblings, 1 reply; 4+ messages in thread
From: Marco Trudel @ 2007-02-22  8:21 UTC (permalink / raw)
  To: Danny Smith; +Cc: java-patches, gnustuff

Danny Smith wrote:
> Hello Mohan
> 
> Another comment from unsubscribed lurker.
> Mohan wrote at 
> http://gcc.gnu.org/ml/java-patches/2007-q1/msg0
> 
> 
>> Hi All,
> 
>>> Mohan> I haven't looked into this much, but if the Linux folks aren't
>>> Mohan> having a problem with this, I'm suspecting a Win32 macro
>>> Mohan> which is colliding with OUT. Just a guess, though.
>>> It would be nice to know where this conflict comes from.
>>> Sometimes a '#undef OUT' in win32.h can help...
>>> But if we have to we can rename the field.
>> I had already tried that, but it didn't work. I had even put an
>> #undef OUT in the offending .cc file with no luck. Still, if it
>> only happens on Win32, it has to be a macro, right?.
>> I've only made half-hearted attempts here.  Marco? Otherwise, I'll
>> try to look at it sometime tomorrow.
>>
> 
> #undef OUT 
> should work if done _after_ including <windows.h>
> 
> maybe here
> 
> Index: natVMVirtualMachine.cc
> ===================================================================
> --- natVMVirtualMachine.cc	(revision 122101)
> +++ natVMVirtualMachine.cc	(working copy)
> @@ -56,6 +56,8 @@
>  #include <gnu/gcj/jvmti/Breakpoint.h>
>  #include <gnu/gcj/jvmti/BreakpointManager.h>
>  
> +#undef OUT
> +
>  using namespace java::lang;
>  using namespace gnu::classpath::jdwp::event;
>  using namespace gnu::classpath::jdwp::util;
> 
> OUT is a macro in windef.h, which gets included by windows.h
> With newer versons of mingw's w32api, we have this in windef.h

In old versions we have it in windef.h and in new too? I have it in 
windef.h...


> /* Pseudo modifiers for parameters 
>    We don't use these unnecessary defines in the w32api headers. Define
>    them by default since that is what people expect, but allow users
>    to avoid the pollution.  */
> #ifndef _NO_W32_PSEUDO_MODIFIERS
> #define IN
> #define OUT
> #ifndef OPTIONAL
> #define OPTIONAL
> #endif
> #endif
> 
> so you could just #define _NO_W32_PSEUDO_MODIFIERS before including
> anything and 
> humbly-pie request that win32 developers upgrade to newer w32api 

Since the build should work without having to change anything manually 
and commit an "#define _NO_W32_PSEUDO_MODIFIERS" into the code seems 
inappropriate, I think we should just rename the "OUT". Also "OUT" is a 
common widespread word and might lead to conflicts in future too.


Marco

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Patch [MinGW] FYI: #undef OUT (was Re: jdwp build failure)
  2007-02-22  8:21 ` Marco Trudel
@ 2007-02-22 14:18   ` Mohan Embar
  2007-02-22 14:25     ` Marco Trudel
  0 siblings, 1 reply; 4+ messages in thread
From: Mohan Embar @ 2007-02-22 14:18 UTC (permalink / raw)
  To: java-patches; +Cc: Danny Smith, Marco Trudel

Hi All,

-->Mohan wrote:
>>> I had already tried that, but it didn't work. I had even put an
>>> #undef OUT in the offending .cc file with no luck. Still, if it
>>> only happens on Win32, it has to be a macro, right?.
>>> I've only made half-hearted attempts here.

Ouch. I guess I hadn't put the #undef OUT in the right place. Thanks
for catching this, Marco. And thanks for your insight, Danny.

-->Marco wrote:
>Also "OUT" is a common widespread word and might lead to conflicts in
>future too.

Yes, but we're doing this for other such macros in win32-thread.h already.

I've committed the following patch, which seems to unbreak the build.
Sorry I've been so distracted lately.

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/

2007-02-22  Mohan Embar  <gnustuff@thisiscool.com>

	* include/win32-threads.h: Added #undef OUT.

Index: include/win32-threads.h
===================================================================
--- include/win32-threads.h	(revision 122226)
+++ include/win32-threads.h	(working copy)
@@ -227,5 +227,6 @@
 #undef STRICT
 #undef VOID
 #undef TEXT
+#undef OUT
 
 #endif /* __JV_WIN32_THREADS__ */



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Patch [MinGW] FYI: #undef OUT (was Re: jdwp build failure)
  2007-02-22 14:18   ` Patch [MinGW] FYI: #undef OUT (was Re: jdwp build failure) Mohan Embar
@ 2007-02-22 14:25     ` Marco Trudel
  0 siblings, 0 replies; 4+ messages in thread
From: Marco Trudel @ 2007-02-22 14:25 UTC (permalink / raw)
  To: gnustuff; +Cc: java-patches

Mohan Embar wrote:
> Hi All,
> 
> -->Mohan wrote:
>>>> I had already tried that, but it didn't work. I had even put an
>>>> #undef OUT in the offending .cc file with no luck. Still, if it
>>>> only happens on Win32, it has to be a macro, right?.
>>>> I've only made half-hearted attempts here.
> 
> Ouch. I guess I hadn't put the #undef OUT in the right place. Thanks
> for catching this, Marco. And thanks for your insight, Danny.
> 
> -->Marco wrote:
>> Also "OUT" is a common widespread word and might lead to conflicts in
>> future too.
> 
> Yes, but we're doing this for other such macros in win32-thread.h already.
> 
> I've committed the following patch, which seems to unbreak the build.

Thanks :-)


> Sorry I've been so distracted lately.

No problem...


Marco

> -- Mohan
> http://www.thisiscool.com/
> http://www.animalsong.org/
> 
> 2007-02-22  Mohan Embar  <gnustuff@thisiscool.com>
> 
> 	* include/win32-threads.h: Added #undef OUT.
> 
> Index: include/win32-threads.h
> ===================================================================
> --- include/win32-threads.h	(revision 122226)
> +++ include/win32-threads.h	(working copy)
> @@ -227,5 +227,6 @@
>  #undef STRICT
>  #undef VOID
>  #undef TEXT
> +#undef OUT
>  
>  #endif /* __JV_WIN32_THREADS__ */
> 
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-02-22 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-22  8:12 jdwp build failure Danny Smith
2007-02-22  8:21 ` Marco Trudel
2007-02-22 14:18   ` Patch [MinGW] FYI: #undef OUT (was Re: jdwp build failure) Mohan Embar
2007-02-22 14:25     ` Marco Trudel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).