update SDL3 from 3.2.20 to 3.4.2
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
SDL_Process *SDL_CreateProcess(const char * const *args, bool pipe_stdio)
|
||||
{
|
||||
if (!args || !args[0] || !args[0][0]) {
|
||||
CHECK_PARAM(!args || !args[0] || !args[0][0]) {
|
||||
SDL_InvalidParamError("args");
|
||||
return NULL;
|
||||
}
|
||||
@@ -45,10 +45,18 @@ SDL_Process *SDL_CreateProcess(const char * const *args, bool pipe_stdio)
|
||||
SDL_Process *SDL_CreateProcessWithProperties(SDL_PropertiesID props)
|
||||
{
|
||||
const char * const *args = SDL_GetPointerProperty(props, SDL_PROP_PROCESS_CREATE_ARGS_POINTER, NULL);
|
||||
if (!args || !args[0] || !args[0][0]) {
|
||||
#if defined(SDL_PLATFORM_WINDOWS)
|
||||
const char *cmdline = SDL_GetStringProperty(props, SDL_PROP_PROCESS_CREATE_CMDLINE_STRING, NULL);
|
||||
CHECK_PARAM((!args || !args[0] || !args[0][0]) && (!cmdline || !cmdline[0])) {
|
||||
SDL_SetError("Either SDL_PROP_PROCESS_CREATE_ARGS_POINTER or SDL_PROP_PROCESS_CREATE_CMDLINE_STRING must be valid");
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
CHECK_PARAM(!args || !args[0] || !args[0][0]) {
|
||||
SDL_InvalidParamError("SDL_PROP_PROCESS_CREATE_ARGS_POINTER");
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
SDL_Process *process = (SDL_Process *)SDL_calloc(1, sizeof(*process));
|
||||
if (!process) {
|
||||
@@ -73,7 +81,7 @@ SDL_Process *SDL_CreateProcessWithProperties(SDL_PropertiesID props)
|
||||
|
||||
SDL_PropertiesID SDL_GetProcessProperties(SDL_Process *process)
|
||||
{
|
||||
if (!process) {
|
||||
CHECK_PARAM(!process) {
|
||||
return SDL_InvalidParamError("process");
|
||||
}
|
||||
return process->props;
|
||||
@@ -90,7 +98,7 @@ void *SDL_ReadProcess(SDL_Process *process, size_t *datasize, int *exitcode)
|
||||
*exitcode = -1;
|
||||
}
|
||||
|
||||
if (!process) {
|
||||
CHECK_PARAM(!process) {
|
||||
SDL_InvalidParamError("process");
|
||||
return NULL;
|
||||
}
|
||||
@@ -110,7 +118,7 @@ void *SDL_ReadProcess(SDL_Process *process, size_t *datasize, int *exitcode)
|
||||
|
||||
SDL_IOStream *SDL_GetProcessInput(SDL_Process *process)
|
||||
{
|
||||
if (!process) {
|
||||
CHECK_PARAM(!process) {
|
||||
SDL_InvalidParamError("process");
|
||||
return NULL;
|
||||
}
|
||||
@@ -126,7 +134,7 @@ SDL_IOStream *SDL_GetProcessInput(SDL_Process *process)
|
||||
|
||||
SDL_IOStream *SDL_GetProcessOutput(SDL_Process *process)
|
||||
{
|
||||
if (!process) {
|
||||
CHECK_PARAM(!process) {
|
||||
SDL_InvalidParamError("process");
|
||||
return NULL;
|
||||
}
|
||||
@@ -142,7 +150,7 @@ SDL_IOStream *SDL_GetProcessOutput(SDL_Process *process)
|
||||
|
||||
bool SDL_KillProcess(SDL_Process *process, bool force)
|
||||
{
|
||||
if (!process) {
|
||||
CHECK_PARAM(!process) {
|
||||
return SDL_InvalidParamError("process");
|
||||
}
|
||||
|
||||
@@ -155,7 +163,7 @@ bool SDL_KillProcess(SDL_Process *process, bool force)
|
||||
|
||||
bool SDL_WaitProcess(SDL_Process *process, bool block, int *exitcode)
|
||||
{
|
||||
if (!process) {
|
||||
CHECK_PARAM(!process) {
|
||||
return SDL_InvalidParamError("process");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user