Wohlstand / libADLMIDI

A Software MIDI Synthesizer library with OPL3 (YMF262) emulator
GNU Lesser General Public License v3.0
170 stars 17 forks source link

Avoid home-grown integer types #242

Closed Cacodemon345 closed 3 years ago

Cacodemon345 commented 3 years ago

This is intended to fix compile errors on some operating systems.

Wohlstand commented 3 years ago

I made that as a workaround for older compiler toolchains that do lack them. They are required on older systems where they gets missing. You better change the condition to don't declare them when use modern systems and declare when using legacy

Cacodemon345 commented 3 years ago

So we bake in the check for older systems in the CMake script? That should be possible.

Wohlstand commented 3 years ago

I mainly do check the presence of stdc macros which usually always exist and everywhere, and when they don't exist, or the C version is smaller than required, the hand-made integers getting defined. Also, I do use the C90 and C++98 standards (to ensure theb compatibility with older compilers) while I build the library, and those integers were absent at older standards.

Wohlstand commented 3 years ago

However, I left the check for the case a wopl library can be re-used by other projects also and they can better use this.

Cacodemon345 commented 3 years ago

I still would argue going for the CMake path; it is easier to check whether the required symbols are actually defined that way.

Cacodemon345 commented 3 years ago

I think I will do this PR at a later time.