compiler/ccgtypes: hide exportc proc unless it has dynlib (#13199)

This hides most of stdlib's internal functions from resulting
binaries/libraries, where they aren't needed on *nix. Static libraries
are not affected by this change (visibility doesn't apply to them).
This commit is contained in:
alaviss 2020-01-20 09:51:21 +00:00 • committed by Andreas Rumpf
commit 470faa97c6
3 changed files with 24 additions and 1 deletions

View file

@ -954,7 +954,7 @@ proc genProcHeader(m: BModule, prc: PSym, asPtr: bool = false): Rope =
result.add "N_LIB_EXPORT "
elif prc.typ.callConv == ccInline or asPtr or isNonReloadable(m, prc):
result.add "static "
elif {sfImportc, sfExportc} * prc.flags == {}:
elif sfImportc notin prc.flags:
result.add "N_LIB_PRIVATE "
var check = initIntSet()
fillLoc(prc.loc, locProc, prc.ast[namePos], mangleName(m, prc), OnUnknown)