Skip to content

Commit

Permalink
Add load_libjulia in libjulialoader
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Sep 28, 2020
1 parent 55aeb2f commit da2935d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions cli/loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

// Declarations from `loader_lib.c` and `loader_win_utils.c`
extern const char * get_exe_dir();
extern void * load_libjulia(const char *);
extern int load_repl(const char *, int, char **);
void print_stderr(const char * msg);
void print_stderr3(const char * msg1, const char * msg2, const char * msg3);
Expand Down
12 changes: 9 additions & 3 deletions cli/loader_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ const char * get_exe_dir()
return exe_dir;
}

// Load libjulia and run the REPL with the given arguments (in UTF-8 format)
int load_repl(const char * exe_dir, int argc, char * argv[])
// Load libjulia after loading its dependencies
void * load_libjulia(const char * exe_dir)
{
// Pre-load libraries that libjulia needs.
int deps_len = strlen(dep_libs);
Expand All @@ -152,7 +152,13 @@ int load_repl(const char * exe_dir, int argc, char * argv[])
}

// Last dependency is `libjulia`, so load that and we're done with `dep_libs`!
void * libjulia = load_library(curr_dep, exe_dir);
return load_library(curr_dep, exe_dir);
}

// Load libjulia and run the REPL with the given arguments (in UTF-8 format)
int load_repl(const char * exe_dir, int argc, char * argv[])
{
void * libjulia = load_libjulia(exe_dir);

// Next, if we're on Linux/FreeBSD, set up fast TLS.
#if !defined(_OS_WINDOWS_) && !defined(_OS_DARWIN_)
Expand Down

0 comments on commit da2935d

Please sign in to comment.