Skip to content

Commit

Permalink
load dll built by MINGW with lib prefix (#470)
Browse files Browse the repository at this point in the history
* load dll built by MINGW with lib prefix

Signed-off-by: U-CW01\uig08771 <[email protected]>

* Update src/shared_library.c

Co-authored-by: Tomoya Fujita <[email protected]>
Signed-off-by: Felix F Xu <[email protected]>

---------

Signed-off-by: U-CW01\uig08771 <[email protected]>
Signed-off-by: Felix F Xu <[email protected]>
Co-authored-by: U-CW01\uig08771 <[email protected]>
Co-authored-by: Tomoya Fujita <[email protected]>
  • Loading branch information
3 people authored Jun 17, 2024
1 parent b2ad5ed commit e9ec8a0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/shared_library.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,19 @@ rcutils_get_platform_library_name(
}
}
#elif _WIN32
#ifdef __MINGW64__
if (debug) {
if (buffer_size >= (strlen(library_name) + 9)) {
written = rcutils_snprintf(
library_name_platform, strlen(library_name) + 9, "lib%sd.dll", library_name);
}
} else {
if (buffer_size >= (strlen(library_name) + 8)) {
written = rcutils_snprintf(
library_name_platform, strlen(library_name) + 8, "lib%s.dll", library_name);
}
}
#else
if (debug) {
if (buffer_size >= (strlen(library_name) + 6)) {
written = rcutils_snprintf(
Expand All @@ -330,6 +343,7 @@ rcutils_get_platform_library_name(
library_name_platform, strlen(library_name) + 5, "%s.dll", library_name);
}
}
#endif // __MINGW64__
#endif
if (written <= 0) {
RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING(
Expand Down

0 comments on commit e9ec8a0

Please sign in to comment.