Skip to content

Commit

Permalink
Try to fix Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Mar 9, 2022
1 parent 263d418 commit 7e285eb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/staticdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -2473,9 +2473,18 @@ JL_DLLEXPORT jl_value_t *jl_restore_system_image_data(const char *buf, size_t le

JL_DLLEXPORT jl_value_t *jl_restore_package_image_from_file(const char *fname)
{
void *pkgimg_handle = dlopen(fname, RTLD_LAZY);
if (!pkgimg_handle)
jl_errorf("Error opening package file %s: %s\n", fname, dlerror());
void *pkgimg_handle = jl_dlopen(fname, JL_RTLD_LAZY);
if (!pkgimg_handle) {
#ifdef _OS_WINDOWS_
int err;
char reason[256];
err = GetLastError();
win32_formatmessage(err, reason, sizeof(reason));
#else
const char *reason = dlerror();
#endif
jl_errorf("Error opening package file %s: %s\n", fname, reason);
}
const char *pkgimg_data;
jl_dlsym(pkgimg_handle, "jl_system_image_data", (void **)&pkgimg_data, 1);
size_t *plen;
Expand Down

0 comments on commit 7e285eb

Please sign in to comment.