-
-
Save drKreso/5070534 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| char *lib_name_2; | |
| /* Initialize the object; grab native call part of its body. */ | |
| NativeCallBody *body = get_nc_body(interp, $1); | |
| /* Try to load the library. */ | |
| body->lib_name = lib_name; | |
| body->lib_handle = dlLoadLibrary(strlen(lib_name) ? lib_name : NULL); | |
| if (!body->lib_handle) { | |
| INTVAL pos = STRING_index(interp, $2, Parrot_str_new(interp, ".bundle", 0), 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); | |
| printf( "Did not found %s trying with %s",lib_name, lib_name_2); | |
| 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