Skip to content

Commit

Permalink
refactor extern(Windows) on 64 bit Windows to make clear it has C lin…
Browse files Browse the repository at this point in the history
…kage
  • Loading branch information
WalterBright committed Jun 19, 2014
1 parent ed1385d commit c8a26f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/glue.c
Expand Up @@ -1453,6 +1453,8 @@ unsigned totym(Type *tx)
switch (tf->linkage)
{
case LINKwindows:
if (global.params.is64bit)
goto Lc;
t = (tf->varargs == 1) ? TYnfunc : TYnsfunc;
break;

Expand All @@ -1462,6 +1464,7 @@ unsigned totym(Type *tx)

case LINKc:
case LINKcpp:
Lc:
t = TYnfunc;
#if TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_SOLARIS
if (I32 && retStyle(tf) == RETstack)
Expand Down
6 changes: 3 additions & 3 deletions src/tocsym.c
Expand Up @@ -220,7 +220,7 @@ Symbol *toSymbol(Dsymbol *s)
switch (vd->linkage)
{
case LINKwindows:
m = mTYman_std;
m = global.params.is64bit ? mTYman_c : mTYman_std;
break;

case LINKpascal:
Expand Down Expand Up @@ -324,7 +324,7 @@ Symbol *toSymbol(Dsymbol *s)
switch (fd->linkage)
{
case LINKwindows:
t->Tmangle = mTYman_std;
t->Tmangle = global.params.is64bit ? mTYman_c : mTYman_std;
break;

case LINKpascal:
Expand Down Expand Up @@ -481,7 +481,7 @@ Symbol *Dsymbol::toImport(Symbol *sym)
}
else
{
sprintf(id,(config.exe == EX_WIN64) ? "__imp__%s" : "_imp__%s",n);
sprintf(id,(config.exe == EX_WIN64) ? "__imp_%s" : "_imp__%s",n);
}
t = type_alloc(TYnptr | mTYconst);
t->Tnext = sym->Stype;
Expand Down

0 comments on commit c8a26f1

Please sign in to comment.