From: Kai T. <kti...@go...> - 2011-10-31 22:55:26
|
2011/10/31 JonY <jo...@us...>: > On 11/1/2011 05:45, niXman wrote: >> Hi Oszkan, Hi Ruben! >> >> I correct it(but not check). >> Like this?: >> >> 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 >> +#define WINPTHREADS_VERSION_H >> + > > Did anybody consider #pragma once? :) > >> +#if defined(__x86_64) >> +# define __WINPTHREADS_ARCH "x86_64" >> +#elif defined(__i386) >> +# define __WINPTHREADS_ARCH "x86" >> +#else >> +# error Unsupported platform! >> +#endif >> + > > I'm curious as to why this is needed, why not just: > #ifndef _WIN32 > #error Unsupported Platform > #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 */ >> 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__)) >> > > These look OK. Well, mostly. I agree that here a check for _WIN64 is enough to determine if for 64-bit is build, otherwise it might (and has to ;) ) be 32-bit. So why checking here architecture at all? Also I dislike here an new header. Please inline it directly into pthread.h Cheers, Kai |