Skip to content

Instantly share code, notes, and snippets.

@drKreso
Last active December 14, 2015 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drKreso/5070628 to your computer and use it in GitHub Desktop.
Save drKreso/5070628 to your computer and use it in GitHub Desktop.
if (!body->lib_handle) {
INTVAL pos = STRING_index(interp, $2, Parrot_str_new(interp, ".bundle", 0), 0);
if (pos >= 0) {
STRING *lib_name_alternative = Parrot_str_replace(interp, $2, pos, 7, Parrot_str_new(interp, ".dylib", 0));
lib_name_2 = Parrot_str_to_cstring(interp, lib_name_alternative);
body->lib_name = lib_name_2;
body->lib_handle = dlLoadLibrary(strlen(lib_name_2) ? lib_name_2 : NULL);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment