Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jl_stdout_obj back fixing regression of r-juliacall #56340

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions src/jl_exported_funcs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@
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) \
Expand Down
1 change: 1 addition & 0 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -2530,6 +2530,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;
Expand Down
9 changes: 9 additions & 0 deletions src/rtutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,15 @@ 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)
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;
}

JL_DLLEXPORT jl_value_t *jl_stderr_obj(void) JL_NOTSAFEPOINT
{
if (jl_base_module == NULL)
Expand Down
Loading