Remove redundant void argument list in function def
[openal-soft.git] / OpenAL32 / alExtension.cpp
blob3cfc253eaee7568d6e9b28d6e42777241fdd415f
1 /**
2 * OpenAL cross platform audio library
3 * Copyright (C) 1999-2007 by authors.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 * Or go to http://www.gnu.org/copyleft/lgpl.html
21 #include "config.h"
23 #include <cstdlib>
24 #include <cstring>
25 #include <cctype>
27 #include "AL/al.h"
28 #include "AL/alc.h"
30 #include "alMain.h"
31 #include "alcontext.h"
32 #include "alError.h"
34 AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extName)
36 ContextRef context{GetContextRef()};
37 if(UNLIKELY(!context)) return AL_FALSE;
39 if(!extName)
40 SETERR_RETURN(context.get(), AL_INVALID_VALUE, AL_FALSE, "NULL pointer");
42 size_t len{strlen(extName)};
43 const char *ptr{context->ExtensionList};
44 while(ptr && *ptr)
46 if(strncasecmp(ptr, extName, len) == 0 &&
47 (ptr[len] == '\0' || isspace(ptr[len])))
48 return AL_TRUE;
50 if((ptr=strchr(ptr, ' ')) != nullptr)
52 do {
53 ++ptr;
54 } while(isspace(*ptr));
58 return AL_FALSE;
62 AL_API ALvoid* AL_APIENTRY alGetProcAddress(const ALchar *funcName)
64 if(!funcName) return nullptr;
65 return alcGetProcAddress(nullptr, funcName);
68 AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *enumName)
70 if(!enumName) return static_cast<ALenum>(0);
71 return alcGetEnumValue(nullptr, enumName);