File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -246,9 +246,18 @@ doorstop_directory="${BASEDIR}/"
246246doorstop_name=" libdoorstop.${lib_extension} "
247247
248248export LD_LIBRARY_PATH=" ${doorstop_directory} :${corlib_dir} :${LD_LIBRARY_PATH} "
249- export LD_PRELOAD=" ${doorstop_name} :${LD_PRELOAD} "
250- export DYLD_LIBRARY_PATH=" ${doorstop_directory} :${corlib_dir} :${DYLD_LIBRARY_PATH} "
251- export DYLD_INSERT_LIBRARIES=" ${doorstop_name} :${DYLD_INSERT_LIBRARIES} "
249+ if [ -z " $LD_PRELOAD " ]; then
250+ export LD_PRELOAD=" ${doorstop_name} "
251+ else
252+ export LD_PRELOAD=" ${doorstop_name} :${LD_PRELOAD} "
253+ fi
254+
255+ export DYLD_LIBRARY_PATH=" ${doorstop_directory} :${DYLD_LIBRARY_PATH} "
256+ if [ -z " $DYLD_INSERT_LIBRARIES " ]; then
257+ export DYLD_INSERT_LIBRARIES=" ${doorstop_name} "
258+ else
259+ export DYLD_INSERT_LIBRARIES=" ${doorstop_name} :${DYLD_INSERT_LIBRARIES} "
260+ fi
252261
253262# shellcheck disable=SC2086
254263exec " $executable_path " $rest_args
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ __attribute__((constructor)) void doorstop_ctor() {
7575 void * unity_player = plthook_handle_by_name ("UnityPlayer" );
7676
7777 // TODO: Chekc if this still works on macOS
78- if (unity_player && plthook_open_by_address (& hook , unity_player ) == 0 ) {
78+ if (unity_player && plthook_open_by_handle (& hook , unity_player ) == 0 ) {
7979 LOG ("Found UnityPlayer, hooking into it instead" );
8080 } else if (plthook_open (& hook , NULL ) != 0 ) {
8181 LOG ("Failed to open current process PLT! Cannot run Doorstop! "
You can’t perform that action at this time.
0 commit comments