KhronosGroup / KhronosGroup/COLLADA2GLTF

use `__APPLE__` instead of `__MACH__`

Open
#103 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
573
Forks
154
PR merge metrics
No merged PRs in 30d

Description

In [o3dgcTimer.h#L31](https://github.com/KhronosGroup/COLLADA2GLTF/blob/f7e8645/dependencies/o3dgc/src/o3dgc_common_lib/inc/o3dgcTimer.h#L31) there are some includes protected by an `#ifdef __MACH__`:

~~~C
#elif __MACH__
#include
#include
#else
#include
#include
#endif
~~~

It seems that this is intended for OSX/macOS.
However there are other implementations of the *Mach Microkernel*, notably `GNU Hurd`, which lacks the `mach/clock.h` include.
Therefore this file cannot be built on the Hurd.

If the define was indeed meant for OSX/macOS, I suggest to use `__APPLE__` instead:
~~~C
#elif __APPLE__
#include
#include
#else
#include
#include
#endif
~~~

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with dependencies/o3dgc/src/o3dgc_common_lib/inc/o3dgcTimer.h around line 31 and inspect the platform-specific include guard. Verify the current condition fails on GNU Hurd, then confirm the macOS and fallback paths still select the expected headers. Done means the file builds on Hurd without changing the macOS behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.