Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#534 closed Bug (fixed)

libpthread compile error

Reported by: fizz Owned by:
Priority: Normal Milestone: 1.00
Component: Transmission Version: 0.95
Severity: Normal Keywords:
Cc:

Description

Building 0.95 fails with

In file included from platform.c:46: /usr/include/pthread.h:435: parse error before `*' /usr/include/pthread.h:440: parse error before `*' /usr/include/pthread.h:443: parse error before `*' /usr/include/pthread.h:446: parse error before `*' /usr/include/pthread.h:456: parse error before `*' /usr/include/pthread.h:459: parse error before `*' /usr/include/pthread.h:469: parse error before `*' /usr/include/pthread.h:475: parse error before `*' /usr/include/pthread.h:478: parse error before `*' /usr/include/pthread.h:481: parse error before `*' /usr/include/pthread.h:486: parse error before `*' /usr/include/pthread.h:490: parse error before `*' /usr/include/pthread.h:494: parse error before `*' make[2]: * [platform.o] Error 1

The reason is pretty simple. platform.c contains

#include ... ...

#ifdef BEOS ... #else

#define _XOPEN_SOURCE 500 /* needed for recursive locks. */ #ifndef USE_UNIX98 #define USE_UNIX98 /* some older Linuxes need it spelt out for them */ #endif #include <pthread.h>

#endif

My system is one of those that need the UNIX98 define. However, pthreadtypes.h is apparently already included by one of the previously included headers, so it won't get included again, and thus we're not getting the additional types needed for UNIX98. The fix is simple: Make sure that the define is set before including any other system headers. Patch follows.

Attachments (1)

transmission-pthread.diff (630 bytes) - added by fizz 13 years ago.
change include order to avoid error

Download all attachments as: .zip

Change History (4)

Changed 13 years ago by fizz

change include order to avoid error

comment:1 Changed 13 years ago by charles

  • Resolution set to fixed
  • Status changed from new to closed

fixed in trunk in r4089. thanks for the patch!

comment:2 Changed 13 years ago by goyko

Big THANK YOU for this patch! I almost losed hope of using T ever again because of this error.

comment:3 Changed 13 years ago by charles

  • Milestone changed from None Set to 1.00
Note: See TracTickets for help on using tickets.