mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-05 04:34:23 +02:00
Upgrade min compatible Godot version to 4.2.1
This commit is contained in:
parent
52a89827c9
commit
fac6361898
16 changed files with 39 additions and 42 deletions
|
@ -120,8 +120,9 @@ static void pty_after_waitpid(uv_async_t *);
|
|||
static void pty_after_close(uv_handle_t *);
|
||||
|
||||
Array PTYUnix::fork(String p_file, int _ignored, PackedStringArray p_args,
|
||||
PackedStringArray p_env, String p_cwd, int p_cols, int p_rows,
|
||||
int p_uid, int p_gid, bool p_utf8, Callable p_on_exit) {
|
||||
PackedStringArray p_env, String p_cwd, int p_cols,
|
||||
int p_rows, int p_uid, int p_gid, bool p_utf8,
|
||||
Callable p_on_exit) {
|
||||
// file
|
||||
char *file = strdup(p_file.utf8().get_data());
|
||||
|
||||
|
@ -445,9 +446,9 @@ static void pty_after_waitpid(uv_async_t *async) {
|
|||
|
||||
Array argv = Array::make(baton->exit_code, baton->signal_code);
|
||||
|
||||
if (baton->cb != nullptr && baton->cb.is_valid()) {
|
||||
if (baton->cb.is_valid()) {
|
||||
baton->cb.callv(argv);
|
||||
baton->cb = (Variant)nullptr;
|
||||
baton->cb = (Variant) nullptr;
|
||||
}
|
||||
|
||||
uv_close((uv_handle_t *)async, pty_after_close);
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
#include "register_types.h"
|
||||
|
||||
#include <gdextension_interface.h>
|
||||
|
||||
#include <godot_cpp/core/class_db.hpp>
|
||||
#include <godot_cpp/core/defs.hpp>
|
||||
#include <godot_cpp/godot.hpp>
|
||||
|
||||
#include "terminal.h"
|
||||
|
||||
#if !defined(_PTY_DISABLED)
|
||||
|
@ -15,10 +9,14 @@
|
|||
#include "node_pty/unix/pty.h"
|
||||
#endif
|
||||
#if defined(__WIN32)
|
||||
//#include "node_pty/win/conpty.h"
|
||||
// #include "node_pty/win/conpty.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <gdextension_interface.h>
|
||||
#include <godot_cpp/core/defs.hpp>
|
||||
#include <godot_cpp/godot.hpp>
|
||||
|
||||
using namespace godot;
|
||||
|
||||
void initialize_godot_xterm_module(ModuleInitializationLevel p_level) {
|
||||
|
@ -45,13 +43,13 @@ void uninitialize_godot_xterm_module(ModuleInitializationLevel p_level) {
|
|||
}
|
||||
}
|
||||
|
||||
extern "C"
|
||||
// Initialization
|
||||
GDExtensionBool GDE_EXPORT
|
||||
godot_xterm_library_init(const GDExtensionInterface *p_interface,
|
||||
GDExtensionClassLibraryPtr p_library,
|
||||
GDExtensionInitialization *r_initialization) {
|
||||
godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library,
|
||||
extern "C" {
|
||||
// Initialization
|
||||
GDExtensionBool GDE_EXPORT
|
||||
godot_xterm_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address,
|
||||
const GDExtensionClassLibraryPtr p_library,
|
||||
GDExtensionInitialization *r_initialization) {
|
||||
godot::GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library,
|
||||
r_initialization);
|
||||
|
||||
init_obj.register_initializer(initialize_godot_xterm_module);
|
||||
|
@ -61,3 +59,4 @@ extern "C"
|
|||
|
||||
return init_obj.init();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue