RPM Community Forums

Mailing List Message of <rpm-devel>

Re: compile error in psm.c (missing pthread.h include?) on qnx

From: Jeff Johnson <n3npq@mac.com>
Date: Fri 25 Jan 2008 - 17:12:43 CET
Message-Id: <30C98F51-EAD3-4213-881B-645B3F32E3AB@mac.com>
This needs to be done in psm.c, not in rpmsq.c.

rpmsq.h ends up in /usr/include/rpm, and applications should
not be forced to define HAVE_PTHREAD_H in order
to include rpmsq.h.

The better fix is to find every place in rpm code that rpmsq.h is  
included,
and insure that pthread.h is included first. I'll attempt that
fix, but I cannot test because no QNX here.

Yes, that also means that applications will have to do their own
    #include <pthread.h>
but that's life.

Better than forcing applications to define HAVE_PTHREAD_H imho.

73 de Jeff

On Jan 24, 2008, at 6:21 PM, Peter Kalbus wrote:

> psm.c is currently not compilable under qnx 6.3.2:
>
>  qcc -DHAVE_CONFIG_H -I. -I.. -I../build -I../lib -I../rpmdb -I../ 
> rpmio -I../misc -I../db3 -I../file/src -I../file -I/usr/pkg/svn/ 
> HEAD/pkgsrc/misc/rpm5/work/.buildlink/include - 
> DRPM_OS_NTOQNX=060400 -O2 -D_GNU_SOURCE -D_REENTRANT -MT psm.lo -MD  
> -MP -MF .deps/psm.Tpo -c psm.c  -fPIC -DPIC -o .libs/psm.o
> In file included from psm.h:9,
>                  from psm.c:20:
> ../rpmio/rpmsq.h:50: error: parse error before "pthread_mutex_t"
> ../rpmio/rpmsq.h:50: warning: no semicolon at end of struct or union
> ../rpmio/rpmsq.h:51: warning: data definition has no type or  
> storage class
> In file included from psm.c:20:
> psm.h:65: error: field `sq' has incomplete type
>
> if i include pthread.h in rpmsq.h, every works fine. i guess, that  
> the chance is valid for every os, although, i've not cross checked  
> that.
>
> <patch-av>
>
>
> -piet
>
Received on Fri Jan 25 17:12:49 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.