Skip to content

Commit

Permalink
Merge pull request #2426 from yebblies/ifdef3
Browse files Browse the repository at this point in the history
[DDMD] Work around ugly PULL93 `#if`s
  • Loading branch information
9rnsr committed Jul 31, 2013
2 parents 1bcbb25 + 0b65d2e commit f5fb19a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 7 additions & 1 deletion src/declaration.c
Expand Up @@ -1202,6 +1202,12 @@ void VarDeclaration::semantic(Scope *sc)
const char *s = (storage_class & STCimmutable) ? "immutable" : "const";
fprintf(stderr, "%s: %s.%s is %s field\n", p ? p : "", ad->toPrettyChars(), toChars(), s);
}
storage_class |= STCfield;
#if DMDV2
if (tbn->ty == Tstruct && ((TypeStruct *)tbn)->sym->noDefaultCtor ||
tbn->ty == Tclass && ((TypeClass *)tbn)->sym->noDefaultCtor)
aad->noDefaultCtor = TRUE;
#endif
#else
if (storage_class & (STCconst | STCimmutable) && init)
{
Expand All @@ -1212,7 +1218,6 @@ void VarDeclaration::semantic(Scope *sc)
storage_class |= STCstatic;
}
else
#endif
{
storage_class |= STCfield;
#if DMDV2
Expand All @@ -1221,6 +1226,7 @@ void VarDeclaration::semantic(Scope *sc)
aad->noDefaultCtor = TRUE;
#endif
}
#endif
}

InterfaceDeclaration *id = parent->isInterfaceDeclaration();
Expand Down
4 changes: 1 addition & 3 deletions src/expression.c
Expand Up @@ -7785,9 +7785,7 @@ Expression *DotVarExp::semantic(Scope *sc)
accessCheck(loc, sc, e1, var);

VarDeclaration *v = var->isVarDeclaration();
#if PULL93
if (v && (v->isDataseg() || (v->storage_class & STCmanifest)))
#endif
if (!PULL93 || v && (v->isDataseg() || (v->storage_class & STCmanifest)))
{
Expression *e = expandVar(WANTvalue, v);
if (e)
Expand Down
2 changes: 1 addition & 1 deletion src/mars.c
Expand Up @@ -684,7 +684,7 @@ Language changes listed by -transition=id:\n\
if (strcmp(p + 12, "tls") == 0)
global.params.vtls = 1;
#if PULL93
else if (strcmp(p + 12, "field") == 0)
if (strcmp(p + 12, "field") == 0)
global.params.vfield = 1;
#endif
}
Expand Down

0 comments on commit f5fb19a

Please sign in to comment.