Menu

#67 winpthreads compatibility problem

closed-invalid
nobody
5
2012-03-02
2012-02-27
Anonymous
No

I am attempting to rebuild SANE with the latest w64 tools.

SANE builds fine with the old pthreads implementation, but fails with winpthreads.

SANE defines SANE_Pid as a pthread_t. They then try to expand a SANE_Pid pointer.

pid->p = 0;

This works under pthreads, but fails with winpthreads as winpthreads does not define pthread_t as a structure. I see that the pthread.h header file defines the structure but the structure is commented out.

What is the "correct way" of handling this if there is one? Is winpthreads broken or is SANE broken?

Discussion

  • Ozkan Sezer

    Ozkan Sezer - 2012-02-28

    To my knowledge, pthread_t is an implementation-dependent type without being restricted to scalar or structure, and even if it were a structure its details don't have to be exposed. Look at linux and see pthread_t being defined as unsigned long. Therefore I'd say that SANE is at fault here.

     

Log in to post a comment.