Subject: Re: [PATCH 2/2] better introduction of GIT with USE_NSEC defined

From: Johannes Sixt <[email-masked]>
Date: Thu, 05 Mar 2009 12:55:25 +0100

Johannes Sixt schrieb:
> Kjetil Barvik schrieb:
>> -	istate->timestamp.sec = st.st_mtime;
>> -#ifdef USE_NSEC
>> +	istate->timestamp.sec = (unsigned int)st.st_mtime;
>>  	istate->timestamp.nsec = (unsigned int)st.st_mtim.tv_nsec;
>> -#else
>> -	istate->timestamp.nsec = 0;
>> -#endif
> 
> Doesn't this break on systems where st_mtime is time_t and st_mtim does
> not exist?

Yes, it breaks. You can test this on Linux by commenting out these two
lines in git-compat-util.h:

diff --git a/git-compat-util.h b/git-compat-util.h
index dcf4127..ab4b615 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -44,8 +44,8 @@
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
 #define _ALL_SOURCE 1
-#define _GNU_SOURCE 1
-#define _BSD_SOURCE 1
+/*#define _GNU_SOURCE 1*/
+/*#define _BSD_SOURCE 1*/

 #include <unistd.h>
 #include <stdio.h>

The result even passes the test suite (as long as I don't merge
kb/checkout-optim, of course).

-- Hannes