Skip to content

Commit

Permalink
Make enum and extension lookup case insensitive.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 21, 2005
1 parent 5036c27 commit 21edf21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions osx/alContext.c
Expand Up @@ -411,7 +411,7 @@ ALCAPI ALboolean ALCAPIENTRY alcIsExtensionPresent(ALCdevice *device, ALubyte *e
} // alcIsExtensionPresent


#define PROC_ADDRESS(x) if (strcmp(#x, (const char *)funcName) == 0) { return x; }
#define PROC_ADDRESS(x) if (strcasecmp(#x, (const char *)funcName) == 0) { return x; }
ALCAPI ALvoid * ALCAPIENTRY alcGetProcAddress(ALCdevice *device, ALubyte *funcName)
{
PROC_ADDRESS(alcCreateContext);
Expand Down Expand Up @@ -448,7 +448,7 @@ ALCAPI ALvoid * ALCAPIENTRY alcGetProcAddress(ALCdevice *device, ALubyte *funcN
} // alcGetProcAddress


#define ENUM_VALUE(x) if (strcmp(#x, (const char *)enumName) == 0) { return x; }
#define ENUM_VALUE(x) if (strcasecmp(#x, (const char *)enumName) == 0) { return x; }
ALCAPI ALenum ALCAPIENTRY alcGetEnumValue(ALCdevice *device, ALubyte *enumName)
{
ENUM_VALUE(ALC_INVALID);
Expand Down
6 changes: 3 additions & 3 deletions osx/alExtension.c
Expand Up @@ -183,7 +183,7 @@ ALboolean __alIsExtensionPresent(const ALubyte *extName, ALboolean isALC)
{
if (__alExtensionTable[i].isALC == isALC)
{
if (strcmp((const char *) __alExtensionTable[i].extName, (const char *) extName) == 0)
if (strcasecmp((const char *) __alExtensionTable[i].extName, (const char *) extName) == 0)
{
if (__alExtensionTable[i].available)
return(AL_TRUE);
Expand All @@ -206,7 +206,7 @@ ALAPI ALboolean ALAPIENTRY alIsExtensionPresent(const ALubyte *extName)
} // alIsExtensionPresent


#define PROC_ADDRESS(x) if (strcmp(#x, (const char *)fname) == 0) { return x; }
#define PROC_ADDRESS(x) if (strcasecmp(#x, (const char *)fname) == 0) { return x; }
ALAPI ALvoid * ALAPIENTRY alGetProcAddress(const ALubyte *fname)
{
PROC_ADDRESS(alEnable);
Expand Down Expand Up @@ -283,7 +283,7 @@ ALAPI ALvoid * ALAPIENTRY alGetProcAddress(const ALubyte *fname)
} // alGetProcAddress


#define ENUM_VALUE(x) if (strcmp(#x, (const char *)ename) == 0) { return x; }
#define ENUM_VALUE(x) if (strcasecmp(#x, (const char *)ename) == 0) { return x; }
ALAPI ALenum ALAPIENTRY alGetEnumValue (const ALubyte *ename)
{
ENUM_VALUE(AL_INVALID);
Expand Down

0 comments on commit 21edf21

Please sign in to comment.