Skip to content

Commit

Permalink
Fix more ifdef issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Jul 30, 2013
1 parent 4203c06 commit 829e18e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
15 changes: 8 additions & 7 deletions src/ctfeexpr.c
Expand Up @@ -329,12 +329,12 @@ Expression *copyLiteral(Expression *e)
else if (e->op == TOKindex)
r = new IndexExp(e->loc, ((IndexExp *)e)->e1, ((IndexExp *)e)->e2);
else if (e->op == TOKdotvar)
r = new DotVarExp(e->loc, ((DotVarExp *)e)->e1,
((DotVarExp *)e)->var
#if DMDV2
, ((DotVarExp *)e)->hasOverloads
r = new DotVarExp(e->loc, ((DotVarExp *)e)->e1,
((DotVarExp *)e)->var, ((DotVarExp *)e)->hasOverloads);
#else
r = new DotVarExp(e->loc, ((DotVarExp *)e)->e1, ((DotVarExp *)e)->var);
#endif
);
else
assert(0);
r->type = e->type;
Expand Down Expand Up @@ -1973,11 +1973,12 @@ Expression *changeArrayLiteralLength(Loc loc, TypeArray *arrayType,

bool isCtfeValueValid(Expression *newval)
{
if (
#if DMDV2
newval->type->ty == Tnull ||
bool isnull = newval->type->ty == Tnull;
#else
bool isnull = false;
#endif
isPointer(newval->type) )
if (isnull || isPointer(newval->type))
{
if (newval->op == TOKaddress || newval->op == TOKnull ||
newval->op == TOKstring)
Expand Down
5 changes: 3 additions & 2 deletions src/json.c
Expand Up @@ -970,9 +970,10 @@ void TemplateDeclaration::toJson(JsonOut *json)
if (s->isTemplateThisParameter())
json->property("kind", "this");
else
#endif
json->property("kind", "type");

#else
json->property("kind", "type");
#endif
json->property("type", "deco", type->specType);

json->property("default", "defaultDeco", type->defaultType);
Expand Down
2 changes: 1 addition & 1 deletion src/root/root.c
Expand Up @@ -1353,7 +1353,7 @@ int File::exists()
void File::remove()
{
#if POSIX
::remove(this->name->toChars());
int dummy = ::remove(this->name->toChars());
#elif _WIN32
DeleteFileA(this->name->toChars());
#else
Expand Down

0 comments on commit 829e18e

Please sign in to comment.