| 239 | |
| 240 | FORCE_ALIGN DECL_FUNCEXT6(void, alDebugMessageInsert,EXT, ALenum, ALenum, ALuint, ALenum, ALsizei, const ALchar*) |
| 241 | FORCE_ALIGN void AL_APIENTRY alDebugMessageInsertDirectEXT(ALCcontext *context, ALenum source, |
| 242 | ALenum type, ALuint id, ALenum severity, ALsizei length, const ALchar *message) noexcept |
| 243 | { |
| 244 | if(!context->mContextFlags.test(ContextFlags::DebugBit)) |
| 245 | return; |
| 246 | |
| 247 | if(!message) UNLIKELY |
| 248 | return context->setError(AL_INVALID_VALUE, "Null message pointer"); |
| 249 | |
| 250 | auto msgview = (length < 0) ? std::string_view{message} |
| 251 | : std::string_view{message, static_cast<uint>(length)}; |
| 252 | if(msgview.length() >= MaxDebugMessageLength) UNLIKELY |
| 253 | return context->setError(AL_INVALID_VALUE, "Debug message too long (%zu >= %d)", |
| 254 | msgview.length(), MaxDebugMessageLength); |
| 255 | |
| 256 | auto dsource = GetDebugSource(source); |
| 257 | if(!dsource) |
| 258 | return context->setError(AL_INVALID_ENUM, "Invalid debug source 0x%04x", source); |
| 259 | if(*dsource != DebugSource::ThirdParty && *dsource != DebugSource::Application) |
| 260 | return context->setError(AL_INVALID_ENUM, "Debug source 0x%04x not allowed", source); |
| 261 | |
| 262 | auto dtype = GetDebugType(type); |
| 263 | if(!dtype) |
| 264 | return context->setError(AL_INVALID_ENUM, "Invalid debug type 0x%04x", type); |
| 265 | |
| 266 | auto dseverity = GetDebugSeverity(severity); |
| 267 | if(!dseverity) |
| 268 | return context->setError(AL_INVALID_ENUM, "Invalid debug severity 0x%04x", severity); |
| 269 | |
| 270 | context->debugMessage(*dsource, *dtype, id, *dseverity, msgview); |
| 271 | } |
| 272 | |
| 273 | |
| 274 | FORCE_ALIGN DECL_FUNCEXT6(void, alDebugMessageControl,EXT, ALenum, ALenum, ALenum, ALsizei, const ALuint*, ALboolean) |
nothing calls this directly
no test coverage detected