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 <uig08771@HIL4255W.cw01.contiwan.com>

* Update src/shared_library.c

Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: Felix F Xu <84662027+felixf4xu@users.noreply.github.com>

---------

Signed-off-by: U-CW01\uig08771 <uig08771@HIL4255W.cw01.contiwan.com>
Signed-off-by: Felix F Xu <84662027+felixf4xu@users.noreply.github.com>
Co-authored-by: U-CW01\uig08771 <uig08771@HIL4255W.cw01.contiwan.com>
Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
  • Loading branch information
3 people committed 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.