From: Ramsay Jones Date: Wed, 02 Aug 2006 18:47:51 GMT Subject: RE: [PATCH 6/10] Fix header breakage with _XOPEN_SOURCE. Message-ID: <001d01c6b664$285ff540$c47eedc1@ramsay1.demon.co.uk> In-Reply-To: <7vpsfjvaul.fsf@assigned-by-dhcp.cox.net> On Wed, 2006-08-02 at 8:46, Junio C Hamano wrote: > > "Ramsay Jones" writes: > > > convert-objects.c sets _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED before > > including , in order to get the declaration of strptime(). > > This leads to breakage in cache.h, due to S_ISLNK and S_IFLNK no longer > > being defined by . These definitions are protected by the > > __USE_BSD symbol, which is not set when _XOPEN_SOURCE is set. Moving > > the #defines and #include below all other #includes does not > > fix the problem, however, since now _USE_XOPEN, which protects the > > declaration of strptime(), is now not defined (don't ask!). > > Wouldn't including "cache.h" and friends first and including > last solve the problem, then? > Not for me. It may be a glibc 2.1 specific problem, of course, but strptime() remains undeclared. > This kind of change tends to fix one system while potentially > breaking another, and we would need to be careful. Will queue > for post 1.4.2 and have people scream if it breaks somebody, I > guess. > Yes, I had some concern about that myself. Unfortunately, you can't make it conditional on the glibc version macros; in order to get the macros, you have to include (one way or another) , at which point it is already too late ... Ramsay