Skip to content

Commit

Permalink
Account for different library names and order of extension/version in…
Browse files Browse the repository at this point in the history
…fo on Darwin systems
  • Loading branch information
DomHeinzeller committed Jan 6, 2018
1 parent 2ec810d commit c2f5669
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ccpp_dl.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,16 @@ ccpp_dl_open(const char *scheme, const char *lib, const char *ver,
library = malloc(n);
memset(library, 0, n);
if (strcmp(ver, "") != 0) {
#ifdef __APPLE__
snprintf(library, n, "%s%s.%s%s", prefix, lib,
ver, suffix);
#elif defined(__linux__) || defined(__unix__)
snprintf(library, n, "%s%s%s.%s", prefix, lib,
suffix, ver);
#else
warnx("CCPP library name not configured for this operating system");
return(EXIT_FAILURE);
#endif
} else {
snprintf(library, n, "%s%s%s", prefix, lib, suffix);
}
Expand Down

0 comments on commit c2f5669

Please sign in to comment.