From 498b87c31cb5cceb29f82cdb5c584b421010c750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Haraldsson?= Date: Fri, 25 Oct 2024 21:56:53 +0000 Subject: [PATCH 1/8] Add jl_stdout_obj back fixing regression of r-juliacall --- src/rtutils.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rtutils.c b/src/rtutils.c index fcc4a489d3f38..c79f4c2b590f7 100644 --- a/src/rtutils.c +++ b/src/rtutils.c @@ -565,6 +565,15 @@ JL_DLLEXPORT void jl_flush_cstdio(void) JL_NOTSAFEPOINT fflush(stderr); } +JL_DLLEXPORT jl_value_t *jl_stdout_obj(void) JL_NOTSAFEPOINT +{ + if (jl_base_module == NULL) + return NULL; + jl_binding_t *stdout_obj = jl_get_module_binding(jl_base_module, jl_symbol("stdout"), 0); + return stdout_obj ? jl_atomic_load_relaxed(&stdout_obj->value) : NULL; +} + +# Please do not remove (again breaking r-juliacall). Maybe after https://github.com/Non-Contradiction/JuliaCall/pull/237 JL_DLLEXPORT jl_value_t *jl_stderr_obj(void) JL_NOTSAFEPOINT { if (jl_base_module == NULL) From 10f06bfd82de0f0970cc42b647ad7de671dbf2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Haraldsson?= Date: Fri, 25 Oct 2024 22:03:17 +0000 Subject: [PATCH 2/8] Adding export back (XX(jl_lisp_prompt) could go though) --- src/jl_exported_funcs.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index 71a78b1c20fc7..542221ec6a8ff 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -430,7 +430,7 @@ XX(jl_static_show_func_sig) \ XX(jl_stderr_obj) \ XX(jl_stderr_stream) \ - XX(jl_stdin_stream) \ + XX(jl_stdout_obj) \ XX(jl_stdout_stream) \ XX(jl_stored_inline) \ XX(jl_string_ptr) \ From 4894cd232186feed1bcb6f7bc340fc31078dfe4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Haraldsson?= Date: Fri, 25 Oct 2024 22:05:09 +0000 Subject: [PATCH 3/8] Fix drop in jl_exported_funcs.inc --- src/jl_exported_funcs.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index 542221ec6a8ff..fb230db1e303d 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -428,6 +428,7 @@ XX(jl_specializations_lookup) \ XX(jl_static_show) \ XX(jl_static_show_func_sig) \ + XX(jl_stdin_stream) \ XX(jl_stderr_obj) \ XX(jl_stderr_stream) \ XX(jl_stdout_obj) \ From cc1accff55b337b902842ba5750c1c14f096ddbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Haraldsson?= Date: Fri, 25 Oct 2024 22:07:00 +0000 Subject: [PATCH 4/8] Update jl_exported_funcs.inc --- src/jl_exported_funcs.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index fb230db1e303d..515f60b9c29be 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -428,9 +428,9 @@ XX(jl_specializations_lookup) \ XX(jl_static_show) \ XX(jl_static_show_func_sig) \ - XX(jl_stdin_stream) \ XX(jl_stderr_obj) \ XX(jl_stderr_stream) \ + XX(jl_stdin_stream) \ XX(jl_stdout_obj) \ XX(jl_stdout_stream) \ XX(jl_stored_inline) \ From 59645cb2736a4ffb97ee606fa95c08882bbb9c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Haraldsson?= Date: Fri, 25 Oct 2024 22:11:43 +0000 Subject: [PATCH 5/8] Update julia.h --- src/julia.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/julia.h b/src/julia.h index a9864aad16ccc..8a5e1cd384216 100644 --- a/src/julia.h +++ b/src/julia.h @@ -2518,6 +2518,7 @@ JL_DLLEXPORT int jl_termios_size(void); // showing and std streams JL_DLLEXPORT void jl_flush_cstdio(void) JL_NOTSAFEPOINT; +JL_DLLEXPORT jl_value_t *jl_stdout_obj(void) JL_NOTSAFEPOINT; # Is used in r-juliacall. JL_DLLEXPORT jl_value_t *jl_stderr_obj(void) JL_NOTSAFEPOINT; JL_DLLEXPORT size_t jl_static_show(JL_STREAM *out, jl_value_t *v) JL_NOTSAFEPOINT; JL_DLLEXPORT size_t jl_static_show_func_sig(JL_STREAM *s, jl_value_t *type) JL_NOTSAFEPOINT; From 7fc4c7456af43337e07096baa20023fe961fd263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Haraldsson?= Date: Fri, 25 Oct 2024 22:21:08 +0000 Subject: [PATCH 6/8] Update julia.h - fix comment --- src/julia.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/julia.h b/src/julia.h index 8a5e1cd384216..298f56731a916 100644 --- a/src/julia.h +++ b/src/julia.h @@ -2518,7 +2518,7 @@ JL_DLLEXPORT int jl_termios_size(void); // showing and std streams JL_DLLEXPORT void jl_flush_cstdio(void) JL_NOTSAFEPOINT; -JL_DLLEXPORT jl_value_t *jl_stdout_obj(void) JL_NOTSAFEPOINT; # Is used in r-juliacall. +JL_DLLEXPORT jl_value_t *jl_stdout_obj(void) JL_NOTSAFEPOINT; // Is "used" in r-juliacall. JL_DLLEXPORT jl_value_t *jl_stderr_obj(void) JL_NOTSAFEPOINT; JL_DLLEXPORT size_t jl_static_show(JL_STREAM *out, jl_value_t *v) JL_NOTSAFEPOINT; JL_DLLEXPORT size_t jl_static_show_func_sig(JL_STREAM *s, jl_value_t *type) JL_NOTSAFEPOINT; From fee100aeb07f6b79184cce771e7f5c96201815e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Haraldsson?= Date: Fri, 25 Oct 2024 22:30:07 +0000 Subject: [PATCH 7/8] Update rtutils.c - fix comment style to C --- src/rtutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtutils.c b/src/rtutils.c index c79f4c2b590f7..a548439e8edea 100644 --- a/src/rtutils.c +++ b/src/rtutils.c @@ -573,7 +573,7 @@ JL_DLLEXPORT jl_value_t *jl_stdout_obj(void) JL_NOTSAFEPOINT return stdout_obj ? jl_atomic_load_relaxed(&stdout_obj->value) : NULL; } -# Please do not remove (again breaking r-juliacall). Maybe after https://github.com/Non-Contradiction/JuliaCall/pull/237 +// Please do not remove (again breaking r-juliacall). Maybe after https://github.com/Non-Contradiction/JuliaCall/pull/237 JL_DLLEXPORT jl_value_t *jl_stderr_obj(void) JL_NOTSAFEPOINT { if (jl_base_module == NULL) From ad83b842c38639f58b81bfb368bfb0bf1346ac75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Haraldsson?= Date: Fri, 25 Oct 2024 22:41:59 +0000 Subject: [PATCH 8/8] Comment moved to right place... --- src/rtutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtutils.c b/src/rtutils.c index a548439e8edea..7c5b75cb0ea36 100644 --- a/src/rtutils.c +++ b/src/rtutils.c @@ -565,6 +565,7 @@ JL_DLLEXPORT void jl_flush_cstdio(void) JL_NOTSAFEPOINT fflush(stderr); } +// Please do not remove jl_stdout_obj (again breaking r-juliacall). Maybe after https://github.com/Non-Contradiction/JuliaCall/pull/237 JL_DLLEXPORT jl_value_t *jl_stdout_obj(void) JL_NOTSAFEPOINT { if (jl_base_module == NULL) @@ -573,7 +574,6 @@ JL_DLLEXPORT jl_value_t *jl_stdout_obj(void) JL_NOTSAFEPOINT return stdout_obj ? jl_atomic_load_relaxed(&stdout_obj->value) : NULL; } -// Please do not remove (again breaking r-juliacall). Maybe after https://github.com/Non-Contradiction/JuliaCall/pull/237 JL_DLLEXPORT jl_value_t *jl_stderr_obj(void) JL_NOTSAFEPOINT { if (jl_base_module == NULL)