Closed Spotlightsrule closed 1 year ago
Thanks for the report. Those errors are coming for amalgamated projects which are using their own sized type declarations which differ slightly. I think the correct fix is to update the amalgamation tool I use so that the amalgamated libraries use miniaudio's types instead of their own.
I'll have a look into this one.
I've done a partial fix for this. It's in the dev branch. It should address the c89atomic errors, but the drwav ones will still be there for the moment. Is that the full list of errors by the way?
Yes. That's the full list
I've done a big rework of the amalgamation of c89atomic and dr_wav which should address all of these errors. Changes are in the dev branch. Are you able to give that a try?
Yes, I can try that. Thanks for the rapid deployment of a fix.
Switched to the dev branch and I am now getting the following compiler errors regardless of whether I use the C11 fixed width ints or not. The rest of the code remains unchanged
$ g++ miniaudio-loop.cpp -o miniaudio-loop && miniaudio-loop
In file included from miniaudio-loop.cpp:6:
_lib/miniaudio/miniaudio.h: In function ‘void* ma_dlopen(ma_log*, const char*)’:
_lib/miniaudio/miniaudio.h:17745:46: error: ‘RTLD_NOW’ was not declared in this scope
17745 | handle = (ma_handle)dlopen(filename, RTLD_NOW);
| ^~~~~~~~
_lib/miniaudio/miniaudio.h:17745:46: note: the macro ‘RTLD_NOW’ had not yet been defined
In file included from /usr/include/dlfcn.h:27,
from _lib/miniaudio/miniaudio.h:17847:
/usr/include/x86_64-linux-gnu/bits/dlfcn.h:25: note: it was later defined here
25 | #define RTLD_NOW 0x00002 /* Immediate function call binding. */
|
_lib/miniaudio/miniaudio.h:17745:29: error: ‘dlopen’ was not declared in this scope; did you mean ‘popen’?
17745 | handle = (ma_handle)dlopen(filename, RTLD_NOW);
| ^~~~~~
| popen
_lib/miniaudio/miniaudio.h: In function ‘void ma_dlclose(ma_log*, ma_handle)’:
_lib/miniaudio/miniaudio.h:17771:9: error: ‘dlclose’ was not declared in this scope; did you mean ‘pclose’?
17771 | dlclose((void*)handle);
| ^~~~~~~
| pclose
_lib/miniaudio/miniaudio.h: In function ‘void (* ma_dlsym(ma_log*, ma_handle, const char*))()’:
_lib/miniaudio/miniaudio.h:17796:21: error: ‘dlsym’ was not declared in this scope; did you mean ‘ma_dlsym’?
17796 | proc = (ma_proc)dlsym((void*)handle, symbol);
| ^~~~~
| ma_dlsym
Thanks. My mistake. That was due to an unrelated change I made yesterday. Should be fixed in the dev branch now.
Yes its fixed now, and I can use fixed-width ints from the stdlib. Thanks.
I was working with Miniaudio on a project and I noticed it had an undocumented option:
MA_USE_STDINT
. In short, it forces the customma_*
integral types into theirstdint.h
equivalents. This was addressed in feature request #334. However, there seems to be an issue on LP64 platforms (ie: 64-bit Linux) that defineuint64_t
to belong unsigned int
, which causes issues with interop between different components of the library (see below). The library is usable without this option, but it would be nice to be able to properly use the inbuilt fixed width types vs having to mix them in my code.References: https://en.cppreference.com/w/cpp/language/types, https://en.cppreference.com/w/cpp/types/integer The error: