Op 31 okt. 2011 22:36 schreef "Ozkan Sezer" <sezeroz@gmail.com> het volgende:
>
> On Mon, Oct 31, 2011 at 5:32 PM, niXman <i.nixman@gmail.com> wrote:
> > Hi Kai.
> > Thanks for you`r reply.
> >
> > Patch for add the winpthreads-version information:
>
> My 2 cents inlined below,
>
> > Index: include/pthread_version.h
> > ===================================================================
> > --- include/pthread_version.h   (revision 0)
> > +++ include/pthread_version.h   (revision 0)
> > @@ -0,0 +1,26 @@
> > +
> > +#ifndef WINPTHREADS_VERSION_H_INCLUDED
> > +#define WINPTHREADS_VERSION_H_INCLUDED
>
> IMO, better guard would be WINPTHREADS_VERSION_H
>
> > +
> > +#if defined(_WIN64)
> > +#  define __WINPTHREADS_ARCH "x86_64"
>
> Not good enough: You should specifically check against __x86_64
> and add an error case for unsupported platforms
>
> > +#else
> > +#  define __WINPTHREADS_ARCH "x86"
>
> Similar here, must be checked against __i386

Problem is, that won't work for msvc. Why the architecture check at all? And _WIN64 should suffice, it's defined for all Windows x64 compilers...

>
> > +#endif
> > +
> > +#define __WINPTHREADS_VERSION_MAJOR 0
> > +#define __WINPTHREADS_VERSION_MINOR 0
> > +#define __WINPTHREADS_VERSION_PATCHLEVEL 1
> > +
> > +#define __WINPTHREADS_VERSION_STR \
> > +   __MINGW64_STRINGIFY(__WINPTHREADS_VERSION_MAJOR) \
> > +   "." \
> > +   __MINGW64_STRINGIFY(__WINPTHREADS_VERSION_MINOR) \
> > +   "." \
> > +   __MINGW64_STRINGIFY(__WINPTHREADS_VERSION_PATCHLEVEL) \
> > +   "-" \
> > +   __WINPTHREADS_ARCH
> > +
> > +#define __WINPTHREADS_VERSION_STATE  "alpha"
> > +
> > +#endif /** WINPTHREADS_VERSION_H_INCLUDED */
> > Index: include/pthread.h
> > ===================================================================
> > --- include/pthread.h   (revision 4562)
> > +++ include/pthread.h   (working copy)
> > @@ -479,6 +479,9 @@
> >  #undef SEM_NSEMS_MAX
> >  #define SEM_NSEMS_MAX                           1024
> >
> > +/* winpthreads version */
> > +#include <pthread_version.h>
> > +
> >  /* Wrap cancellation points.  */
> >  #ifdef __WINPTRHEAD_ENABLE_WRAP_API
> >  #define accept(...) (pthread_testcancel(), accept(__VA_ARGS__))
> >
> >
> >
> >
> >
> > Please correct the values for
> > __WINPTHREADS_VERSION_MAJOR/__WINPTHREADS_VERSION_MINOR/__WINPTHREADS_VERSION_PATCHLEVEL
> >
> > Thanks!
> >   niXman.
> >
> > 2011/10/31 Kai Tietz <ktietz70@googlemail.com>:
> >> 2011/10/31 niXman <i.nixman@gmail.com>:
> >>> Hello list!
> >>>
> >>> Anyone, tell me please, what macros I need to use to determine the
> >>> mingw-w64-crt and winpthreads?
> >>> To determine the pthreads-win32: http://sourceware.org/pthreads-win32
> >>> I use PTW32_VERSION macro.
> >>>
> >>> Thanks.
> >>>   niXman.
> >>
> >> Well, winpthread doesn't provide right now a library version define.
> >> Suggest a patch for adding one ;)
> >>
> >> To determine, if you are using mingw-w64, or a different C-runtime,
> >> please use the following mechanism:
> >>
> >> #include <stdlib> /* Or what other C-runtime header you want, you can
> >> use here _mingw.h, too */
> >> #ifdef __MINGW64_VERSION_MAJOR
> >> /* You are using mingw-w64. */
> >> #else
> >> /* You are using something else.  */
> >> #endif
> >>
> >>
> >> Cheers,
> >> Kai
> >>
> >> #endif
> >>
> >
>
> --
> O.S.
>
> ------------------------------------------------------------------------------
> Get your Android app more play: Bring it to the BlackBerry PlayBook
> in minutes. BlackBerry App World&#153; now supports Android&#153; Apps
> for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple
> it is! http://p.sf.net/sfu/android-dev2dev
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public