mirror of
https://github.com/ZDoom/ZMusic.git
synced 2024-11-14 00:20:44 +00:00
allow both libsndfile-1.dll and sndfile.dll when dynamically loading the library.
sndfile.dll is the official name so this should be checked as well.
This commit is contained in:
parent
519b76b6e7
commit
3944bbc756
1 changed files with 9 additions and 5 deletions
|
@ -43,11 +43,11 @@ FModule SndFileModule{"SndFile"};
|
|||
|
||||
|
||||
#ifdef _WIN32
|
||||
#define SNDFILELIB "libsndfile-1.dll"
|
||||
static const char* libnames[] = { "sndfile.dll", "libsndfile-1.dll" };
|
||||
#elif defined(__APPLE__)
|
||||
#define SNDFILELIB "libsndfile.1.dylib"
|
||||
static const char* libnames[] = { "libsndfile.1.dylib" };
|
||||
#else
|
||||
#define SNDFILELIB "libsndfile.so.1"
|
||||
static const char* libnames[] = { "libsndfile.so.1" };
|
||||
#endif
|
||||
|
||||
extern "C" int IsSndFilePresent()
|
||||
|
@ -61,8 +61,12 @@ extern "C" int IsSndFilePresent()
|
|||
if (!done)
|
||||
{
|
||||
done = true;
|
||||
auto abspath = FModule_GetProgDir() + "/" SNDFILELIB;
|
||||
cached_result = SndFileModule.Load({abspath.c_str(), SNDFILELIB});
|
||||
for (auto libname : libnames)
|
||||
{
|
||||
auto abspath = FModule_GetProgDir() + "/" + libname;
|
||||
cached_result = SndFileModule.Load({ abspath.c_str(), libname });
|
||||
if (cached_result) break;
|
||||
}
|
||||
}
|
||||
return cached_result;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue