delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2002/05/22/07:07:25

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT cygwin DOT com
Delivered-To: mailing list cygwin-developers AT cygwin DOT com
Date: Wed, 22 May 2002 07:14:40 -0400
From: Jason Tishler <jason AT tishler DOT net>
Subject: Re: Should sys/types.h include sys/sysmacros.h?
In-reply-to: <GBEGLOMMCLDACBPKDIHFCEEJCIAA.gsw@agere.com>
To: "Gerald S. Williams" <gsw AT agere DOT com>
Cc: cygwin-developers AT cygwin DOT com
Mail-followup-to: "Gerald S. Williams" <gsw AT agere DOT com>,
cygwin-developers AT cygwin DOT com
Message-id: <20020522111439.GA2124@tishler.net>
MIME-version: 1.0
User-Agent: Mutt/1.3.24i
References: <20020501180344 DOT GI3160 AT tishler DOT net>
<GBEGLOMMCLDACBPKDIHFCEEJCIAA DOT gsw AT agere DOT com>

Jerry,

On Tue, May 21, 2002 at 04:46:40PM -0400, Gerald S. Williams wrote:
> Jason Tishler wrote:
> > Actually, I just determined that sys/types.h includes cygwin/types.h.
> > So, should I include sys/sysmacros.h in cygwin/types.h instead?
> 
> But cygwin/types.h includes sys/sysmacros.h already.

AFAICT, cygwin/types.h did *not* include sys/sysmacros.h until the
following:

    http://cygwin.com/ml/cygwin-cvs/2002-q2/msg00048.html

Am I missing something?

> I think the problem is that sys/types.h isn't always including
> cygwin/types.h. A closer look reveals that it doesn't do this
> if _POSIX_THREADS is defined.
> 
> I don't know why it would only include cygwin/types.h if
> _POSIX_THREADS isn't defined--perhaps that should be changed?

I don't know the answer to the above.  Maybe someone else does?  Rob?

> I also noticed that cygwin/types.h is including this header
> file within an extern "C" statement under C++. I would have
> thought that generally each header file should have its own
> extern "C" if it's required, in which case this shouldn't
> be done (extern "C" isn't a valid ANSI C construct). Perhaps
> this:
> 
> [snip]
> 
> should be changed to this?
> 
>  #ifndef _CYGWIN_TYPES_H
>  #define _CYGWIN_TYPES_H
> 
>  #include <sys/sysmacros.h>
> 
>  #ifdef __cplusplus
>  extern "C"
>  {
>  #endif
> 
>  ...
> 
>  #ifdef __cplusplus
>  }
>  #endif
> 
>  #endif /* _CYGWIN_TYPES_H */

If the above is deemed appropriate, then I will submit a patch to
correct this.

Jason

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019