parallel-rdp vulkan/semaphore.h shadows the system <semaphore.h>

Open Beginner friendly
#858 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c
Domain
build-system

Research direction

Start by reading the parallel-rdp Vulkan include path configuration and the bundled header named in the report, mupen64plus-video-paraLLEl/parallel-rdp/vulkan/semaphore.h; check where C files receive that include path. Rename the header with a project-specific prefix and update its references. Done when system <semaphore.h> resolves correctly in the reported Raspberry Pi EGL build and the BSD eventcount case.

Written by the indexing model from the issue text.

Description

Since 09cdc84d ("parallel-rdp: counted semaphores in C"), semaphore.hpp became mupen64plus-video-paraLLEl/parallel-rdp/vulkan/semaphore.h. With HAVE_PARALLEL=1, -I.../parallel-rdp/vulkan is passed to every C file, so #include <semaphore.h> picks up this file instead of the system header.

This breaks the build on Raspberry Pi with the Broadcom userland EGL (platform=armv-neon, Lakka RPiZero2-GPiCase), where EGL/egl.h pulls in vcos_platform.h, which includes <semaphore.h>:

In file included from <sysroot>/usr/include/interface/vcos/vcos.h:118,
                 from <sysroot>/usr/include/interface/vmcs_host/vc_dispmanx.h:33,
                 from <sysroot>/usr/include/EGL/eglplatform.h:110,
                 from <sysroot>/usr/include/EGL/egl.h:36,
                 from libretro/glsm/glsm.c:56:
<sysroot>/usr/include/interface/vcos/pthreads/vcos_platform.h:96:9: error: unknown type name 'sem_t'
   96 | typedef sem_t                 VCOS_SEMAPHORE_T;
      |         ^~~~~

The bundled libretro-common/rthreads/retro_eventcount.c should hit the same issue on BSD, where it includes <semaphore.h>.

Could the header get a prefixed name, e.g. granite_semaphore.h (matching its GRANITE_SEMAPHORE_H guard)?

Still present on 8e3bcf00.

Thanks
Asai, Shigeaki

Dominant language
C
Stars
414
Forks
155
Avg merge
1d 8h
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libretro/parallel-n64

All issues in libretro/parallel-n64

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.