mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 797664 - Don't spew wwhen optional functions aren't found - r=vlad
This commit is contained in:
parent
b6b3f09d5e
commit
dbfe12439b
@ -525,7 +525,8 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl)
|
||||
{ (PRFuncPtr*) &mSymbols.fGetTexLevelParameteriv, { "GetTexLevelParameteriv", nullptr } },
|
||||
{ nullptr, { nullptr } },
|
||||
};
|
||||
LoadSymbols(&auxSymbols[0], trygl, prefix);
|
||||
bool warnOnFailures = DebugMode();
|
||||
LoadSymbols(&auxSymbols[0], trygl, prefix, warnOnFailures);
|
||||
}
|
||||
|
||||
if (mInitialized) {
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include "GLLibraryLoader.h"
|
||||
|
||||
#include "nsDebug.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace gl {
|
||||
|
||||
@ -22,15 +24,22 @@ GLLibraryLoader::OpenLibrary(const char *library)
|
||||
}
|
||||
|
||||
bool
|
||||
GLLibraryLoader::LoadSymbols(SymLoadStruct *firstStruct, bool tryplatform, const char *prefix)
|
||||
GLLibraryLoader::LoadSymbols(SymLoadStruct *firstStruct,
|
||||
bool tryplatform,
|
||||
const char *prefix,
|
||||
bool warnOnFailure)
|
||||
{
|
||||
return LoadSymbols(mLibrary, firstStruct, tryplatform ? mLookupFunc : nullptr, prefix);
|
||||
return LoadSymbols(mLibrary,
|
||||
firstStruct,
|
||||
tryplatform ? mLookupFunc : nullptr,
|
||||
prefix,
|
||||
warnOnFailure);
|
||||
}
|
||||
|
||||
PRFuncPtr
|
||||
GLLibraryLoader::LookupSymbol(PRLibrary *lib,
|
||||
const char *sym,
|
||||
PlatformLookupFunction lookupFunction)
|
||||
const char *sym,
|
||||
PlatformLookupFunction lookupFunction)
|
||||
{
|
||||
PRFuncPtr res = 0;
|
||||
|
||||
@ -55,9 +64,10 @@ GLLibraryLoader::LookupSymbol(PRLibrary *lib,
|
||||
|
||||
bool
|
||||
GLLibraryLoader::LoadSymbols(PRLibrary *lib,
|
||||
SymLoadStruct *firstStruct,
|
||||
PlatformLookupFunction lookupFunction,
|
||||
const char *prefix)
|
||||
SymLoadStruct *firstStruct,
|
||||
PlatformLookupFunction lookupFunction,
|
||||
const char *prefix,
|
||||
bool warnOnFailure)
|
||||
{
|
||||
char sbuf[MAX_SYMBOL_LENGTH * 2];
|
||||
int failCount = 0;
|
||||
@ -85,7 +95,9 @@ GLLibraryLoader::LoadSymbols(PRLibrary *lib,
|
||||
}
|
||||
|
||||
if (*ss->symPointer == 0) {
|
||||
fprintf (stderr, "Can't find symbol '%s'\n", ss->symNames[0]);
|
||||
if (warnOnFailure)
|
||||
printf_stderr("Can't find symbol '%s'.\n", ss->symNames[0]);
|
||||
|
||||
failCount++;
|
||||
}
|
||||
|
||||
|
@ -37,8 +37,9 @@ public:
|
||||
} SymLoadStruct;
|
||||
|
||||
bool LoadSymbols(SymLoadStruct *firstStruct,
|
||||
bool tryplatform = false,
|
||||
const char *prefix = nullptr);
|
||||
bool tryplatform = false,
|
||||
const char *prefix = nullptr,
|
||||
bool warnOnFailure = true);
|
||||
|
||||
/*
|
||||
* Static version of the functions in this class
|
||||
@ -47,9 +48,10 @@ public:
|
||||
const char *symname,
|
||||
PlatformLookupFunction lookupFunction = nullptr);
|
||||
static bool LoadSymbols(PRLibrary *lib,
|
||||
SymLoadStruct *firstStruct,
|
||||
PlatformLookupFunction lookupFunction = nullptr,
|
||||
const char *prefix = nullptr);
|
||||
SymLoadStruct *firstStruct,
|
||||
PlatformLookupFunction lookupFunction = nullptr,
|
||||
const char *prefix = nullptr,
|
||||
bool warnOnFailure = true);
|
||||
protected:
|
||||
GLLibraryLoader() {
|
||||
mLibrary = nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user