Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com From: "Gerald S. Williams" To: "Jason Tishler" , Subject: RE: Should sys/types.h include sys/sysmacros.h? Date: Tue, 21 May 2002 16:46:40 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <20020501180344.GI3160@tishler.net> 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. 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 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: #ifdef __cplusplus extern "C" { #endif #ifndef _CYGWIN_TYPES_H #define _CYGWIN_TYPES_H #include ... #endif /* _CYGWIN_TYPES_H */ #ifdef __cplusplus } #endif should be changed to this? #ifndef _CYGWIN_TYPES_H #define _CYGWIN_TYPES_H #include #ifdef __cplusplus extern "C" { #endif ... #ifdef __cplusplus } #endif #endif /* _CYGWIN_TYPES_H */ -Jerry