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
101 changed files with 126 additions and 168 deletions

View File

@ -30,13 +30,12 @@
#pragma once
#include <cstdint>
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <stdint.h>
extern int godot_audio_is_available();
extern int godot_audio_has_worklet();
extern int godot_audio_has_script_processor();

View File

@ -32,13 +32,12 @@
#define WASM_EXPORT __attribute__((visibility("default")))
#include <cstdint>
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <stdint.h>
// Config
extern void godot_js_config_locale_get(char *p_ptr, int p_ptr_max);
extern void godot_js_config_canvas_id_get(char *p_ptr, int p_ptr_max);

View File

@ -30,11 +30,12 @@
#pragma once
#include <cstdint>
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
extern int godot_js_webmidi_open_midi_inputs(
void (*p_callback)(int p_size, const char **p_connected_input_names),
void (*p_on_midi_message)(int p_device_index, int p_status, const uint8_t *p_data, int p_data_len),

View File

@ -36,8 +36,6 @@
extern "C" {
#endif
#include <stddef.h>
typedef enum {
GODOT_JS_FETCH_STATE_REQUESTING = 0,
GODOT_JS_FETCH_STATE_BODY = 1,

View File

@ -46,7 +46,7 @@
#include <dlfcn.h>
#include <emscripten.h>
#include <stdlib.h>
#include <cstdlib>
void OS_Web::alert(const String &p_alert, const String &p_title) {
godot_js_display_alert(p_alert.utf8().get_data());

View File

@ -43,7 +43,7 @@
#endif
#include <emscripten/emscripten.h>
#include <stdlib.h>
#include <cstdlib>
static OS_Web *os = nullptr;
#ifndef PROXY_TO_PTHREAD_ENABLED