2011/11/29 Ozkan Sezer <[email protected]>
> On Tue, Nov 29, 2011 at 6:41 PM, Ruben Van Boxem
> <[email protected]> wrote:
> > 2011/11/29 xunxun <[email protected]>
> >>
> >> winpthreads svn 4642 add a header file called pthread_compat.h, but is
> >> missing in makefile.in when installing.
> >
> >
> > You are correct, I missed that.
> >
> > Could someone please commit below patch and regenerate autoshizzle files
> (I
> > don't have autotools installed, nor am I on Linux)?
> > Index: Makefile.in
> > ===================================================================
> > --- Makefile.in (revision 4641)
> > +++ Makefile.in (working copy)
> > @@ -274,7 +274,7 @@
> > src/barrier.c src/cond.c src/misc.c src/mutex.c src/rwlock.c
> > src/spinlock.c src/thread.c src/ref.c src/sem.c src/sched.c \
> > src/winpthread_internal.h src/clock.c src/nanosleep.c src/version.rc
> >
> > -include_HEADERS = include/pthread.h include/sched.h include/semaphore.h
> > include/pthread_unistd.h include/pthread_time.h
> > +include_HEADERS = include/pthread.h include/sched.h include/semaphore.h
> > include/pthread_unistd.h include/pthread_time.h include/pthread_compat.h
> > DISTCHECK_CONFIGURE_FLAGS = --host=$(host_triplet)
> > noinst_LTLIBRARIES = libdummy.la
> > libwinpthread_la_LIBADD = libdummy.la
> >
> > Thanks!
> >
> > Ruben
>
> While you are working on that, remember that you were going to
> fix that new header for clashes?
>
Yes, and here is the required changes. It still includes the
makefile.inbit, which needs some autotools love, which my windows box
is unable to
give. I tested with 64-bit GCC and MSVC.
If anyone with autotools present could please apply this patch, I and
anyone trying to use SVN HEAD would be very grateful!
Ruben
> --
> O.S.
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
Index: Makefile.in
===================================================================
--- Makefile.in (revision 4645)
+++ Makefile.in (working copy)
@@ -274,7 +274,7 @@
src/barrier.c src/cond.c src/misc.c src/mutex.c src/rwlock.c
src/spinlock.c src/thread.c src/ref.c src/sem.c src/sched.c \
src/winpthread_internal.h src/clock.c src/nanosleep.c src/version.rc
-include_HEADERS = include/pthread.h include/sched.h include/semaphore.h
include/pthread_unistd.h include/pthread_time.h
+include_HEADERS = include/pthread.h include/sched.h include/semaphore.h
include/pthread_unistd.h include/pthread_time.h include/pthread_compat.h
DISTCHECK_CONFIGURE_FLAGS = --host=$(host_triplet)
noinst_LTLIBRARIES = libdummy.la
libwinpthread_la_LIBADD = libdummy.la
Index: include/pthread_compat.h
===================================================================
--- include/pthread_compat.h (revision 4645)
+++ include/pthread_compat.h (working copy)
@@ -60,16 +60,22 @@
#ifndef WIN_PTHREADS_PTHREAD_COMPAT_H
#define WIN_PTHREADS_PTHREAD_COMPAT_H
-#ifdef _MSC_VER
+#ifdef __GNUC__
+#define WINPTHREADS_INLINE inline
+#define WINPTHREADS_ATTRIBUTE(X) __attribute__(X)
+#define WINPTHREADS_SECTION(X) __section__(X)
+
+#elif _MSC_VER
+
#include "pthread_time.h"
typedef __int64 pid_t;
typedef int clockid_t;
-#define inline __inline
-#define __attribute__(X) __declspec X
-#define __section__(X) allocate(X)
+#define WINPTHREADS_INLINE __inline
+#define WINPTHREADS_ATTRIBUTE(X) __declspec X
+#define WINPTHREADS_SECTION(X) allocate(X)
#endif
Index: src/misc.h
===================================================================
--- src/misc.h (revision 4645)
+++ src/misc.h (working copy)
@@ -82,7 +82,7 @@
#define VALID(x) if (!(p)) return EINVAL;
/* ms can be 64 bit, solve wrap-around issues: */
-static inline unsigned long dwMilliSecs(unsigned long long ms)
+static WINPTHREADS_INLINE unsigned long dwMilliSecs(unsigned long long ms)
{
if (ms >= 0xffffffffULL) return 0xfffffffful;
return (unsigned long) ms;
Index: src/rwlock.c
===================================================================
--- src/rwlock.c (revision 4645)
+++ src/rwlock.c (working copy)
@@ -31,9 +31,9 @@
static spin_t rwl_global = {0,LIFE_SPINLOCK,1};
-static __attribute__((noinline)) int rwlock_static_init(pthread_rwlock_t *rw);
+static WINPTHREADS_ATTRIBUTE((noinline)) int
rwlock_static_init(pthread_rwlock_t *rw);
-static __attribute__ ((noinline)) int rwl_unref(volatile pthread_rwlock_t
*rwl, int res)
+static WINPTHREADS_ATTRIBUTE((noinline)) int rwl_unref(volatile
pthread_rwlock_t *rwl, int res)
{
_spin_lite_lock(&rwl_global);
#ifdef WINPTHREAD_DBG
@@ -44,7 +44,7 @@
return res;
}
-static __attribute__((noinline)) int rwl_ref(pthread_rwlock_t *rwl, int f )
+static WINPTHREADS_ATTRIBUTE((noinline)) int rwl_ref(pthread_rwlock_t *rwl,
int f )
{
int r = 0;
INIT_RWLOCK(rwl);
@@ -60,7 +60,7 @@
return r;
}
-static __attribute__((noinline)) int rwl_ref_unlock(pthread_rwlock_t *rwl )
+static WINPTHREADS_ATTRIBUTE((noinline)) int rwl_ref_unlock(pthread_rwlock_t
*rwl )
{
int r = 0;
@@ -77,7 +77,7 @@
return r;
}
-static __attribute__((noinline)) int rwl_ref_destroy(pthread_rwlock_t *rwl,
pthread_rwlock_t *rDestroy )
+static WINPTHREADS_ATTRIBUTE((noinline)) int rwl_ref_destroy(pthread_rwlock_t
*rwl, pthread_rwlock_t *rDestroy )
{
int r = 0;
@@ -150,7 +150,7 @@
static spin_t cond_locked = {0,LIFE_SPINLOCK,1};
-static __attribute__((noinline)) int rwlock_static_init(pthread_rwlock_t *rw)
+static WINPTHREADS_ATTRIBUTE((noinline)) int
rwlock_static_init(pthread_rwlock_t *rw)
{
int r;
_spin_lite_lock(&cond_locked);
Index: src/mutex.c
===================================================================
--- src/mutex.c (revision 4645)
+++ src/mutex.c (working copy)
@@ -30,13 +30,13 @@
#include "misc.h"
extern int do_sema_b_wait_intern (HANDLE sema, int nointerrupt, DWORD timeout);
-static __attribute__((noinline)) int mutex_static_init(pthread_mutex_t *m);
-static __attribute__((noinline)) int _mutex_trylock(pthread_mutex_t *m);
+static WINPTHREADS_ATTRIBUTE((noinline)) int mutex_static_init(pthread_mutex_t
*m);
+static WINPTHREADS_ATTRIBUTE((noinline)) int _mutex_trylock(pthread_mutex_t
*m);
static spin_t mutex_global = {0,LIFE_SPINLOCK,1};
static spin_t mutex_global_static = {0,LIFE_SPINLOCK,1};
-static __attribute__((noinline)) int
+static WINPTHREADS_ATTRIBUTE((noinline)) int
mutex_unref(pthread_mutex_t *m, int r)
{
mutex_t *m_ = (mutex_t *)*m;
@@ -51,7 +51,7 @@
/* Set the mutex to busy in a thread-safe way */
/* A busy mutex can't be destroyed */
-static __attribute__((noinline)) int
+static WINPTHREADS_ATTRIBUTE((noinline)) int
mutex_ref(pthread_mutex_t *m)
{
int r = 0;
@@ -85,7 +85,7 @@
}
/* An unlock can simply fail with EPERM instead of auto-init (can't be owned)
*/
-static __attribute__((noinline)) int
+static WINPTHREADS_ATTRIBUTE((noinline)) int
mutex_ref_unlock(pthread_mutex_t *m)
{
int r = 0;
@@ -108,7 +108,7 @@
/* doesn't lock the mutex but set it to invalid in a thread-safe way */
/* A busy mutex can't be destroyed -> EBUSY */
-static __attribute__((noinline)) int
+static WINPTHREADS_ATTRIBUTE((noinline)) int
mutex_ref_destroy(pthread_mutex_t *m, pthread_mutex_t *mDestroy )
{
int r = 0;
@@ -135,7 +135,7 @@
return r;
}
-static __attribute__((noinline)) int mutex_ref_init(pthread_mutex_t *m )
+static WINPTHREADS_ATTRIBUTE((noinline)) int mutex_ref_init(pthread_mutex_t *m
)
{
int r = 0;
@@ -173,7 +173,7 @@
}
#endif
-static __attribute__((noinline)) int
+static WINPTHREADS_ATTRIBUTE((noinline)) int
mutex_static_init(pthread_mutex_t *m)
{
static pthread_mutexattr_t mxattr_recursive = PTHREAD_MUTEX_RECURSIVE;
@@ -297,7 +297,7 @@
return mutex_unref(m,0);
}
-static __attribute__((noinline)) int
+static WINPTHREADS_ATTRIBUTE((noinline)) int
_mutex_trylock(pthread_mutex_t *m)
{
int r = 0;
Index: src/thread.c
===================================================================
--- src/thread.c (revision 4645)
+++ src/thread.c (working copy)
@@ -385,7 +385,7 @@
#ifdef _MSC_VER
#pragma section(".CRT$XLF", shared)
#endif
-PIMAGE_TLS_CALLBACK __attribute__ ((__section__ (".CRT$XLF"))) __xl_f =
(PIMAGE_TLS_CALLBACK) __dyn_tls_pthread;
+PIMAGE_TLS_CALLBACK WINPTHREADS_ATTRIBUTE((WINPTHREADS_SECTION(".CRT$XLF")))
__xl_f = (PIMAGE_TLS_CALLBACK) __dyn_tls_pthread;
#ifdef _MSC_VER
#pragma data_seg()
#endif
Index: src/spinlock.c
===================================================================
--- src/spinlock.c (revision 4645)
+++ src/spinlock.c (working copy)
@@ -63,7 +63,7 @@
return 0;
}
-static inline int
+static WINPTHREADS_INLINE int
spinlock_static_init (pthread_spinlock_t *l)
{
int ret;
Index: src/barrier.c
===================================================================
--- src/barrier.c (revision 4645)
+++ src/barrier.c (working copy)
@@ -30,7 +30,7 @@
static spin_t barrier_global = {0,LIFE_SPINLOCK,1};
-static __attribute__((noinline)) int
+static WINPTHREADS_ATTRIBUTE((noinline)) int
barrier_unref(volatile pthread_barrier_t *barrier, int res)
{
_spin_lite_lock(&barrier_global);
@@ -42,7 +42,7 @@
return res;
}
-static __attribute__((noinline)) int barrier_ref(volatile pthread_barrier_t
*barrier)
+static WINPTHREADS_ATTRIBUTE((noinline)) int barrier_ref(volatile
pthread_barrier_t *barrier)
{
int r = 0;
_spin_lite_lock(&barrier_global);
@@ -57,7 +57,7 @@
return r;
}
-static __attribute__((noinline)) int
+static WINPTHREADS_ATTRIBUTE((noinline)) int
barrier_ref_destroy(volatile pthread_barrier_t *barrier, pthread_barrier_t
*bDestroy)
{
int r = 0;
@@ -79,7 +79,7 @@
return r;
}
-static __attribute__((noinline)) void
+static WINPTHREADS_ATTRIBUTE((noinline)) void
barrier_ref_set (volatile pthread_barrier_t *barrier, void *v)
{
_spin_lite_lock(&barrier_global);
Index: src/clock.c
===================================================================
--- src/clock.c (revision 4645)
+++ src/clock.c (working copy)
@@ -19,7 +19,7 @@
*/
#define DELTA_EPOCH_IN_100NS INT64_C(116444736000000000)
-static __inline int lc_set_errno(int result)
+static WINPTHREADS_INLINE int lc_set_errno(int result)
{
if (result != 0) {
errno = result;
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public