Skip to content

Commit

Permalink
Add #ifdef guard for windows
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
azeey committed Aug 23, 2022
1 parent 739ae12 commit 644f613
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions loader/src/Loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,13 @@ namespace gz

// NOTE: We open using RTLD_LOCAL instead of RTLD_GLOBAL to prevent the
// symbols of different libraries from writing over each other.
#ifdef _WIN32
// RTLD_NODELETE is not defined in dlfcn-32.
(void) _noDelete;
int dlopenMode = RTLD_LAZY | RTLD_LOCAL;
#else
int dlopenMode = RTLD_LAZY | RTLD_LOCAL | (_noDelete ? RTLD_NODELETE : 0);
#endif
void *dlHandle = dlopen(_full_path.c_str(), dlopenMode);

const char *loadError = dlerror();
Expand Down

0 comments on commit 644f613

Please sign in to comment.