Core: Modernize C headers with C++ equivalents

This commit is contained in:
Thaddeus Crews 2025-04-28 16:05:13 -05:00
parent a8ece29adc
commit 01fc9aee6c
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
101 changed files with 126 additions and 168 deletions

View file

@ -46,8 +46,8 @@
#include <dlfcn.h>
#include <execinfo.h>
#include <link.h>
#include <signal.h>
#include <stdlib.h>
#include <csignal>
#include <cstdlib>
static void handle_crash(int sig) {
signal(SIGSEGV, SIG_DFL);

View file

@ -32,7 +32,7 @@
#ifdef DBUS_ENABLED
#include <stdint.h>
#include <cstdint>
class FreeDesktopScreenSaver {
private:

View file

@ -32,10 +32,10 @@
#include "main/main.h"
#include <limits.h>
#include <locale.h>
#include <stdlib.h>
#include <unistd.h>
#include <climits>
#include <clocale>
#include <cstdlib>
#if defined(SANITIZERS_ENABLED)
#include <sys/resource.h>

View file

@ -35,10 +35,10 @@
#include "core/os/os.h"
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/input.h>
#include <unistd.h>
#include <cerrno>
#ifdef UDEV_ENABLED
#ifdef SOWRAP_ENABLED

View file

@ -68,13 +68,12 @@
#endif
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <unistd.h>
#include <cstdio>
#include <cstdlib>
#if __has_include(<mntent.h>)
#include <mntent.h>

View file

@ -35,7 +35,7 @@
#endif
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
#include <stdlib.h> // alloca
#include <cstdlib> // alloca
// FreeBSD and OpenBSD use pthread_set_name_np, while other platforms,
// include NetBSD, use pthread_setname_np. NetBSD's version however requires
// a different format, we handle this directly in thread_posix.

View file

@ -36,13 +36,10 @@
#include "core/string/print_string.h"
#include "core/string/ustring.h"
#include <stdlib.h>
#include <cstring>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <cstdlib>
// To prevent shadowing warnings.
#undef glGetString

View file

@ -61,8 +61,8 @@
#include "core/input/input.h"
#include "servers/display_server.h"
#include <limits.h>
#include <stdio.h>
#include <climits>
#include <cstdio>
#undef CursorShape

View file

@ -46,11 +46,10 @@
#include <X11/Xutil.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <cstdlib>
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092

View file

@ -58,13 +58,12 @@
#endif
#include <dlfcn.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <climits>
#include <cstdio>
#include <cstdlib>
#undef CursorShape
#include <X11/XKBlib.h>

View file

@ -34,9 +34,9 @@
#include "thirdparty/glad/glad/glx.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <cstdio>
#include <cstdlib>
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092

View file

@ -32,8 +32,8 @@
#if defined(X11_ENABLED) && defined(GLES3_ENABLED)
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
const char *GLManagerEGL_X11::_get_platform_extension_name() const {
return "EGL_KHR_platform_x11";