This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc/gthr-posix.h changes


On Aug  9, 2000, Ovidiu Predescu <ovidiu@cup.hp.com> wrote:

> OK, how about something like this:

> #ifdef HAVE_SCHED_H
> # include <sched.h>
> #endif

> #ifdef HAVE_PTHREAD_H
> # include <pthread.h>
> #endif

> of course, with the appropriate AC_CHECK_HEADER in configure.in:

> AC_CHECK_HEADER(sched.h)
> AC_CHECK_HEADER(pthread.h)

Looks good to me.  I think these tests would have to be done in both
GCC's and libobjc's configure.ins.

> Including both pthread.h and sched.h should not do any harm, right?

Hopefully not.  Let's try it as you say and see if we find problems on
any known platforms.

Another approach would be to check whether the needed struct is
defined with pthread.h alone, and only test for sched.h otherwise.
But that would require a more complicated configure.in test, so I'd
rather only do it if really needed.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]