Re: [PATCH] MSVC: port pthread code to native Windows threads
- From
Erik Faye-Lund <kusmabite@googlemail.com>
- Date
- Nov 4, 2009, 10:50 UTC
- Message-ID
- <40aa078e0911040250k55fa1920g6eee5657c6e35345@mail.gmail.com>
- In-Reply-To
- <1257331059-26344-1-git-send-email-ahaczewski@gmail.com>
On Wed, Nov 4, 2009 at 11:37 AM, Andrzej K. Haczewski <ahaczewski@gmail.com> wrote:
Show 13 quoted lines
> +/* > + * Properly defines thread routine for Windows and POSIX > + */ > +#ifndef NO_PTHREADS > +# ifndef _WIN32 > +# define THREAD_FUNC(f, a) void *f(void *a) > +# define THREAD_RETURN(x) return (x) > +# else > +# define THREAD_FUNC(f, a) DWORD __stdcall f(LPVOID a) > +# define THREAD_RETURN(x) return (DWORD)(x); > +# endif > +#endif > +
Seeing how THREAD_RETURN is only called with NULL-parameter, perhaps it would be better to do this?
+/* + * Properly defines thread routine for Windows and POSIX + */ +#ifndef NO_PTHREADS +# ifndef _WIN32 +# define THREAD_FUNC(f, a) void *f(void *a) +# define THREAD_RETURN() return NULL; +# else +# define THREAD_FUNC(f, a) DWORD __stdcall f(LPVOID a) +# define THREAD_RETURN() return 0; +# endif +#endif
> +
-- Erik "kusma" Faye-Lund