Skip to content

Commit

Permalink
Move crc32c.c out of support so that it can use julia runtime functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Jun 19, 2017
1 parent 04e8b23 commit 94bb51b
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contrib/add_license_to_files.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const skipfiles = [
"../src/support/tzfile.h",
"../src/support/utf8.c",
"../test/perf/micro/randmtzig.c",
"../src/support/crc32c.c",
"../src/crc32c.c",
"../examples/quine.jl", # has license text in code
]

Expand Down
3 changes: 2 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ SRCS := \
dlload sys init task array dump toplevel jl_uv datatype \
simplevector APInt-C runtime_intrinsics runtime_ccall precompile \
threadgroup threading stackwalk gc gc-debug gc-pages method \
jlapi signal-handling safepoint jloptions timing subtype rtutils
jlapi signal-handling safepoint jloptions timing subtype rtutils \
crc32c

ifeq ($(USEMSVC), 1)
SRCS += getopt
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "builtin_proto.h"
#undef DEFINE_BUILTIN_GLOBALS
#include "threading.h"
#include "crc32c.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -547,6 +548,7 @@ void _julia_init(JL_IMAGE_SEARCH rel)
jl_ptls_t ptls = jl_get_ptls_states();
jl_safepoint_init();
libsupport_init();
jl_crc32c_init(0);
ios_set_io_wait_func = jl_set_io_wait;
jl_io_loop = uv_default_loop(); // this loop will internal events (spawning process etc.),
// best to call this first, since it also initializes libuv
Expand Down
1 change: 1 addition & 0 deletions src/jlapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <assert.h>
#include "julia.h"
#include "options.h"
#include "crc32c.h"

#ifdef __cplusplus
#include <cfenv>
Expand Down
2 changes: 1 addition & 1 deletion src/support/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ override CXXFLAGS += $(JCXXFLAGS)
override CPPFLAGS += $(JCPPFLAGS)

SRCS := hashing timefuncs ptrhash operators utf8 ios htable bitvector \
int2str libsupportinit arraylist strtod crc32c
int2str libsupportinit arraylist strtod
ifeq ($(OS),WINNT)
SRCS += asprintf wsasocketpair strptime
ifeq ($(ARCH),i686)
Expand Down
1 change: 0 additions & 1 deletion src/support/libsupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "bitvector.h"
#include "dirpath.h"
#include "strtod.h"
#include "crc32c.h"

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 0 additions & 2 deletions src/support/libsupportinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ void libsupport_init(void)

ios_init_stdstreams();

jl_crc32c_init(0);

isInitialized=1;
}
}
Expand Down

0 comments on commit 94bb51b

Please sign in to comment.