Re: [PATCH 1/1] MSVC: port pthread code to native Windows threads
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 3, 2009, 23:38 UTC
- Message-ID
- <alpine.DEB.1.00.0911040031210.4985@pacific.mpi-cbg.de>
- In-Reply-To
- <1257283802-29726-2-git-send-email-ahaczewski@gmail.com>
Hi,
On Tue, 3 Nov 2009, Andrzej K. Haczewski wrote:
> ---
Could you please add the reasoning from the cover letter to this commit message? And add a sign-off?
Show 18 quoted lines
> diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c > index 02f9246..a8a4f59 100644 > --- a/builtin-pack-objects.c > +++ b/builtin-pack-objects.c > @@ -18,8 +18,12 @@ > #include "refs.h" > > #ifdef THREADED_DELTA_SEARCH > -#include "thread-utils.h" > -#include <pthread.h> > +# include "thread-utils.h" > +# ifndef _WIN32 > +# include <pthread.h> > +# else > +# include <winthread.h> > +# endif > #endif >
It is unlikely that an #ifdef "contamination" of this extent will go through easily, but I have a suggestion that may make your patch both easier to read and more likely to be accepted into git.git: Try to wrap the win32 calls into pthread-compatible function signatures. Then you can add a compat/win32/pthread.h and not even touch core files of git.git at all.
Oh, and you definitely do not want to copy-paste err_win_to_posix(). You definitely want to reuse the existing instance.
Ciao, Dscho