Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC]: Move __CYGWIN__ hack to config/<arch>/xm-cygwin.h
@ 2001-03-01 18:21 J.T. Conklin
  2001-03-01 18:41 ` Christopher Faylor
  0 siblings, 1 reply; 2+ messages in thread
From: J.T. Conklin @ 2001-03-01 18:21 UTC (permalink / raw)
  To: gdb-patches

I found some code in defs.h that defines __CYGWIN__ if __CYGWIN32__ is
defined (if it is not already defined).  While I admit that defs.h has
it's fair share of hacks they are more general (for the most part, they
add definitions missing from older UN*X systems (SEEK_SET, STDIN_FILENO,
etc.).  IMO, this code belongs in a cygwin host header file.

The enclosed patch moves it from defs.h to config/i386/xm-cygwin.h and
config/powerpc/xm-cygwin.h.  It seems to me there is enough duplication
in those two headers that a common config/xm-cygwin.h header is justified,
but I'll leave that to cygwin hackers to deal with.

Thoughts?

        --jtc

2001-03-01  J.T. Conklin  <jtc@redback.com>

	* defs.h (__CYGWIN__): Moved conditional which defines __CYGWIN__
 	if __CYGWIN32__ is set from here.
	* config/i386/xm-cygwin.h: To here.
	* config/powerpc/xm-cygwin.h: To here.
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.38
diff -c -r1.38 defs.h
*** defs.h	2001/02/08 06:49:19	1.38
--- defs.h	2001/03/02 02:07:01
***************
*** 1259,1272 ****
  #define MERGEPID(PID, TID) (PID)
  #endif
  
- /* If under Cygwin, provide backwards compatibility with older
-    Cygwin compilers that don't define the current cpp define. */
- #ifdef __CYGWIN32__
- #ifndef __CYGWIN__
- #define __CYGWIN__
- #endif
- #endif
- 
  /* Define well known filenos if the system does not define them.  */
  #ifndef STDIN_FILENO
  #define STDIN_FILENO   0

-- 
J.T. Conklin
RedBack Networks


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

* Re: [RFC]: Move __CYGWIN__ hack to config/<arch>/xm-cygwin.h
  2001-03-01 18:21 [RFC]: Move __CYGWIN__ hack to config/<arch>/xm-cygwin.h J.T. Conklin
@ 2001-03-01 18:41 ` Christopher Faylor
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Faylor @ 2001-03-01 18:41 UTC (permalink / raw)
  To: gdb-patches

On Thu, Mar 01, 2001 at 06:21:32PM -0800, J.T. Conklin wrote:
>I found some code in defs.h that defines __CYGWIN__ if __CYGWIN32__ is
>defined (if it is not already defined).  While I admit that defs.h has
>it's fair share of hacks they are more general (for the most part, they
>add definitions missing from older UN*X systems (SEEK_SET, STDIN_FILENO,
>etc.).  IMO, this code belongs in a cygwin host header file.
>
>The enclosed patch moves it from defs.h to config/i386/xm-cygwin.h and
>config/powerpc/xm-cygwin.h.  It seems to me there is enough duplication
>in those two headers that a common config/xm-cygwin.h header is justified,
>but I'll leave that to cygwin hackers to deal with.

The Cygwin powerpc port is dead anyway (Andrew feel free to nuke it), so
that's not much of an issue.  I have no problems with moving this to the
cygwin header file.  It should work fine there.

I wonder if we even need the ifdef at all anymore but it's "only" been
two years or so since Cygwin32 was renamed to Cygwin.  Maybe that's
still too early.

Anyway, please do check this in.  I agree that it doesn't belong in
defs.h.

Thanks,
cgf

>
>2001-03-01  J.T. Conklin  <jtc@redback.com>
>
>	* defs.h (__CYGWIN__): Moved conditional which defines __CYGWIN__
> 	if __CYGWIN32__ is set from here.
>	* config/i386/xm-cygwin.h: To here.
>	* config/powerpc/xm-cygwin.h: To here.
>Index: defs.h
>===================================================================
>RCS file: /cvs/src/src/gdb/defs.h,v
>retrieving revision 1.38
>diff -c -r1.38 defs.h
>*** defs.h	2001/02/08 06:49:19	1.38
>--- defs.h	2001/03/02 02:07:01
>***************
>*** 1259,1272 ****
>  #define MERGEPID(PID, TID) (PID)
>  #endif
>  
>- /* If under Cygwin, provide backwards compatibility with older
>-    Cygwin compilers that don't define the current cpp define. */
>- #ifdef __CYGWIN32__
>- #ifndef __CYGWIN__
>- #define __CYGWIN__
>- #endif
>- #endif
>- 
>  /* Define well known filenos if the system does not define them.  */
>  #ifndef STDIN_FILENO
>  #define STDIN_FILENO   0
>
>-- 
>J.T. Conklin
>RedBack Networks


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

end of thread, other threads:[~2001-03-01 18:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-01 18:21 [RFC]: Move __CYGWIN__ hack to config/<arch>/xm-cygwin.h J.T. Conklin
2001-03-01 18:41 ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox