ReactOS 0.4.15-dev-8614-gbc76250
__throw_out_of_range_fmt.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: GCC c++ support library
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: __throw_out_of_range_fmt implementation
5 * COPYRIGHT: Copyright 2024 Timo Kreuzer <timo.kreuzer@reactos.org>
6 */
7
8#include <stdexcept>
9#include <cstdarg>
10#include <cstring>
11#include <malloc.h>
12
13namespace std {
14
16{
17 char* m_msg;
18public:
19 explicit out_of_range_error(const char* msg) noexcept
20 {
21 size_t len = strlen(msg) + 1;
22 m_msg = (char*)malloc(len);
24 }
26 virtual const char* what() const noexcept { return m_msg; }
27};
28
29void __throw_out_of_range_fmt(const char *format, ...)
30{
31 char buffer[1024];
32 va_list argptr;
33
34 va_start(argptr, format);
35 _vsnprintf(buffer, sizeof(buffer), format, argptr);
36 buffer[sizeof(buffer) - 1] = 0;
37 va_end(argptr);
38
40}
41
42} // namespace std
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define msg(x)
Definition: auth_time.c:54
out_of_range_error(const char *msg) noexcept
virtual const char * what() const noexcept
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLuint buffer
Definition: glext.h:5915
GLenum GLsizei len
Definition: glext.h:6722
Definition: features.h:417
void __throw_out_of_range_fmt(const char *format,...)
#define _vsnprintf
Definition: xmlstorage.h:202
#define const
Definition: zconf.h:233