[icecast-dev] [patch] ices CVS tree and potential problems compiling on Solaris

David Flynn
Fri, 06 Aug 2004 14:57:31 -0000

Hello icecast-dev,

this patch against the current ices module CVS tree fixes the following:

PROBLEM:
  use of #include "thread.h" in (of all things) im_sun.[ch] can
  cause a compile error.

REPRODUCTION:
  Compile source tree on Solaris 2.8 using gcc3.2.3 (SMCgcc)
  from sunfreeware.com will fail with a name space collision, eg:
     thread/thread.h:66: conflicting types for `mutex_t'
      /usr/include/synch.h:51: previous declaration of `mutex_t'

REASON:
  Solaris has its own threading library (threads) as well as POSIX (pthreads)
  to use the pthread library one must include /usr/include/pthread.h, to use
  solaris threads one must include /usr/include/thread.h (and
  /usr/include/sched.h) due to im_sun.[ch] including "thread.h" rather
than
  "thread/thread.h" without thread/ being in the include search path,
gcc
  resorts to the system thread.h.

FIX:
  correct #include "thread.h" to #include "thread/thread.h"

also changed in this patch:
 - removal of #include <pthread.h> from stream.c for it is redundant
 - formatting of <thread/thread.h> to "thread/thread.h"

Enjoy!

--david