diff options
author | midipix <writeonce@midipix.org> | 2024-02-20 07:12:33 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-02-20 07:12:33 +0000 |
commit | b8dd56ad1477766403a4b7dbaaff309feba3d92d (patch) | |
tree | b300e91154474d4b1b8ddb3a51a81b5660252971 /src/arbits | |
parent | f248f358ccd4fc8b194a4831a86c4c5b6e3ba446 (diff) | |
download | slibtool-b8dd56ad1477766403a4b7dbaaff309feba3d92d.tar.bz2 slibtool-b8dd56ad1477766403a4b7dbaaff309feba3d92d.tar.xz |
slbt_ar_create_mapfile(): refactor coff & mach-o detection logic.
Diffstat (limited to 'src/arbits')
-rw-r--r-- | src/arbits/slbt_archive_mapfile.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/arbits/slbt_archive_mapfile.c b/src/arbits/slbt_archive_mapfile.c index 5bfa0f7..c448c8c 100644 --- a/src/arbits/slbt_archive_mapfile.c +++ b/src/arbits/slbt_archive_mapfile.c @@ -45,14 +45,11 @@ static int slbt_ar_output_mapfile_impl( fsort = !(dctx->cctx->fmtflags & SLBT_OUTPUT_ARCHIVE_NOSORT); - fmach = !strcmp(dctx->cctx->host.flavor,"darwin"); - fmach = fmach || (mctx->ofmtattr & AR_OBJECT_ATTR_MACHO); - - fcoff = !strcmp(dctx->cctx->host.flavor,"midipix"); - fcoff = fcoff || !strcmp(dctx->cctx->host.flavor,"cygwin"); - fcoff = fcoff || !strcmp(dctx->cctx->host.flavor,"mingw"); - fcoff = fcoff || !strcmp(dctx->cctx->host.flavor,"msys2"); - fcoff = fcoff || (mctx->ofmtattr & AR_OBJECT_ATTR_COFF); + fmach = slbt_host_objfmt_is_macho(dctx); + fmach |= (mctx->ofmtattr & AR_OBJECT_ATTR_MACHO); + + fcoff = slbt_host_objfmt_is_coff(dctx); + fcoff |= (mctx->ofmtattr & AR_OBJECT_ATTR_COFF); if (fcoff) { if (slbt_dprintf(fdout,"EXPORTS\n") < 0) |