Ticket #470 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

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:

Description

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

comment:1 Changed 10 years ago by bennylp

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

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 10 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.