Skip to content

Commit 5a53485

Browse files
vchuravyfingolfin
andauthored
Apply suggestions from code review
Co-authored-by: Max Horn <max@quendi.de>
1 parent 4d1fd2c commit 5a53485

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/staticdata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ static void jl_write_values(jl_serializer_state *s) JL_GC_DISABLED
12511251
write_uint8(s->s, '\0'); // null-terminated strings for easier C-compatibility
12521252
}
12531253
else if (jl_is_foreign_type(t) == 1) {
1254-
jl_error("Foreign Objects cannot be serialized");
1254+
jl_error("Cannot serialize instances of foreign datatypes");
12551255
}
12561256
else if (jl_datatype_nfields(t) == 0) {
12571257
// The object has no fields, so we just snapshot its byte representation

test/gcext/Foreign/deps/foreignlib.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ void sweep(jl_value_t *p)
1818
nsweeps++;
1919
}
2020

21-
JL_DLLEXPORT jl_datatype_t *declare_foreign(jl_sym_t* name, jl_module_t *module, jl_datatype_t *parent) {
22-
return jl_new_foreign_type(name, module, parent, mark, sweep, 1, 0);
21+
JL_DLLEXPORT jl_datatype_t *declare_foreign(jl_sym_t* name, jl_module_t *module, jl_datatype_t *parent)
22+
{
23+
return jl_new_foreign_type(name, module, parent, mark, sweep, 1, 0);
2324
}
2425

2526
// #define GC_MAX_SZCLASS (2032 - sizeof(void *))

test/gcext/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ SRCDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
1919
# get the executable suffix, if any
2020
EXE := $(suffix $(abspath $(JULIA)))
2121

22-
DYLIB := .so
22+
OS := $(shell uname)
23+
ifeq ($(OS), Darwin)
24+
DYLIB := .dylib
25+
else
26+
DYLIB := .so
27+
endif
2328

2429
# get compiler and linker flags. (see: `contrib/julia-config.jl`)
2530
JULIA_CONFIG := $(JULIA) -e 'include(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "julia-config.jl"))' --

0 commit comments

Comments
 (0)