Skip to content

Commit e9ec8a0

Browse files
felixf4xuU-CW01\uig08771fujitatomoya
authored
load dll built by MINGW with lib prefix (#470)
* 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]>
1 parent b2ad5ed commit e9ec8a0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/shared_library.c

+14
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,19 @@ rcutils_get_platform_library_name(
319319
}
320320
}
321321
#elif _WIN32
322+
#ifdef __MINGW64__
323+
if (debug) {
324+
if (buffer_size >= (strlen(library_name) + 9)) {
325+
written = rcutils_snprintf(
326+
library_name_platform, strlen(library_name) + 9, "lib%sd.dll", library_name);
327+
}
328+
} else {
329+
if (buffer_size >= (strlen(library_name) + 8)) {
330+
written = rcutils_snprintf(
331+
library_name_platform, strlen(library_name) + 8, "lib%s.dll", library_name);
332+
}
333+
}
334+
#else
322335
if (debug) {
323336
if (buffer_size >= (strlen(library_name) + 6)) {
324337
written = rcutils_snprintf(
@@ -330,6 +343,7 @@ rcutils_get_platform_library_name(
330343
library_name_platform, strlen(library_name) + 5, "%s.dll", library_name);
331344
}
332345
}
346+
#endif // __MINGW64__
333347
#endif
334348
if (written <= 0) {
335349
RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING(

0 commit comments

Comments
 (0)