Merge pull request #105887 from Repiteo/core/modernize-headers

Core: Modernize C headers with C++ equivalents
This commit is contained in:
Thaddeus Crews 2025-05-02 09:25:29 -05:00
commit 1cf573f44d
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
101 changed files with 126 additions and 168 deletions

View file

@ -77,8 +77,8 @@
#define GLTF_IMPORT_DISCARD_MESHES_AND_MATERIALS 32
#define GLTF_IMPORT_FORCE_DISABLE_MESH_COMPRESSION 64
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
constexpr int COMPONENT_COUNT_FOR_ACCESSOR_TYPE[7] = {
1, 2, 3, 4, 4, 9, 16

View file

@ -42,7 +42,7 @@
#include "Jolt/RegisterTypes.h"
#include <stdarg.h>
#include <cstdarg>
void *jolt_alloc(size_t p_size) {
return Memory::alloc_static(p_size);

View file

@ -30,7 +30,7 @@
#pragma once
#include <stdint.h>
#include <cstdint>
enum JoltJointWorldNode : int {
JOLT_JOINT_WORLD_NODE_A,

View file

@ -34,7 +34,7 @@
#include "Jolt/Physics/Collision/BroadPhase/BroadPhaseLayer.h"
#include <stdint.h>
#include <cstdint>
namespace JoltBroadPhaseLayer {

View file

@ -34,7 +34,7 @@
#include "Jolt/Core/TempAllocator.h"
#include <stdint.h>
#include <cstdint>
class JoltTempAllocator final : public JPH::TempAllocator {
uint64_t capacity = 0;

View file

@ -32,8 +32,6 @@
#include <turbojpeg.h>
#include <string.h>
Error jpeg_turbo_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p_buffer_len) {
tjhandle tj_instance = tj3Init(TJINIT_DECOMPRESS);
if (tj_instance == NULL) {

View file

@ -36,9 +36,6 @@
extern "C" {
#endif
#include <stdbool.h>
#include <stdint.h>
// This is taken from the old GDNative, which was removed.
#define GODOT_VARIANT_SIZE (sizeof(real_t) * 4 + sizeof(int64_t))

View file

@ -35,7 +35,7 @@
#include "core/io/file_access.h"
#include "core/os/os.h"
#include <stdlib.h>
#include <cstdlib>
#ifdef WINDOWS_ENABLED
#define WIN32_LEAN_AND_MEAN
@ -43,8 +43,8 @@
#define ENV_PATH_SEP ";"
#else
#include <limits.h>
#include <unistd.h>
#include <climits>
#define ENV_PATH_SEP ":"
#endif

View file

@ -32,8 +32,8 @@
#include "core/io/file_access.h"
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
namespace {

View file

@ -33,7 +33,7 @@
#include "core/string/ustring.h"
#include "core/variant/variant.h"
#include <stdarg.h>
#include <cstdarg>
String sformat(const String &p_text, const String &p1 = String(), const String &p2 = String(),
const String &p3 = String(), const String &p4 = String(), const String &p5 = String(), const String &p6 = String());

View file

@ -60,7 +60,7 @@ using namespace godot;
#include <freetype/otsvg.h>
#include <ft2build.h>
#include <stdlib.h>
#include <cstdlib>
FT_Error tvg_svg_in_ot_init(FT_Pointer *p_state) {
*p_state = memnew(TVG_State);

View file

@ -60,7 +60,7 @@ using namespace godot;
#include <freetype/otsvg.h>
#include <ft2build.h>
#include <stdlib.h>
#include <cstdlib>
FT_Error tvg_svg_in_ot_init(FT_Pointer *p_state) {
*p_state = memnew(TVG_State);

View file

@ -37,7 +37,7 @@
#include <miniupnpc/miniwget.h>
#include <miniupnpc/upnpcommands.h>
#include <stdlib.h>
#include <cstdlib>
void UPNPMiniUPNP::make_default() {
UPNP::_create = UPNPMiniUPNP::_create;

View file

@ -35,8 +35,6 @@
#include <webp/decode.h>
#include <webp/encode.h>
#include <string.h>
namespace WebPCommon {
Vector<uint8_t> _webp_lossy_pack(const Ref<Image> &p_image, float p_quality) {
ERR_FAIL_COND_V(p_image.is_null() || p_image->is_empty(), Vector<uint8_t>());

View file

@ -34,8 +34,6 @@
extern "C" {
#endif
#include <stddef.h>
enum WebXRInputEvent {
WEBXR_INPUT_EVENT_SELECTSTART,
WEBXR_INPUT_EVENT_SELECTEND,

View file

@ -45,7 +45,7 @@
#include "servers/xr/xr_hand_tracker.h"
#include <emscripten.h>
#include <stdlib.h>
#include <cstdlib>
void _emwebxr_on_session_supported(char *p_session_mode, int p_supported) {
XRServer *xr_server = XRServer::get_singleton();