Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#470 closed defect (fixed)

Compile error when <semaphore.h> is not present

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-0.9.0
Component: pjlib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:


The PJLIB's os_core_unix.c includes <semaphore.h> unconditionally, which causes compilation error if it's not present (e.g. in newlib, IIRC). Since semaphore is optional (it's only used when read/write mutex (rwmutex) needs to be emulated), the configure script should detect this and set the flags accordingly.

Change History (2)

comment:1 Changed 16 years ago by bennylp

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

Fixed in r1783:

  • Added PJ_HAS_SEMAPHORE_H macro which will be checked by the configure script, to detect whether <semaphore.h> is present.
  • The PJ_HAS_SEMAPHORE macro now is set according to PJ_HAS_SEMAPHORE_H
  • When PJ_HAS_SEMAPHORE is false, throw compilation error in os_core_unix.c when rwmutex emulation is used.

comment:2 Changed 16 years ago by bennylp

In r1787:

  • Fixed semaphore support got disabled on Mingw because configure script doesn't detect <semaphore.h>
Note: See TracTickets for help on using tickets.