emscripten-core / emscripten-core/emscripten
alext.h does not define macros for absent extensions
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
OpenAL does not require all extensions to work and provides `alIsExtensionPresent` to check if an extension works. My codebase (and I suppose many others) handles this situation like
```
if (alIsExtensionPresent("AL_SOFT_direct_channels")) {
alSourcei(id, AL_DIRECT_CHANNELS_SOFT, AL_TRUE);
}
```
This code fails to compile with emscripten after cf8a0d0 and requires additional macros to fix. On the other hand, if you unconditionlessly call `alSourcei(id, AL_DIRECT_CHANNELS_SOFT, AL_TRUE);`, it will raise an AL_INVALID_ENUM error on a platform with no such extension, which is expected behavior.
I would like to suggest adding macros of unsupported extensions for compatibility with native code.
Contributor guide
Assessment
This issue has not been assessed yet.