Skip to content

Commit

Permalink
Merge pull request ReadyTalk#568 from 'paulie-g/master'
Browse files Browse the repository at this point in the history
Minimum viable fix for enums from vm namespaces clashing
with identifiers from math includes

Fixes ReadyTalk#569
  • Loading branch information
Techcable committed Jul 12, 2023
2 parents 0871979 + c460a0a commit 3ba2dd1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions src/compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3976,16 +3976,16 @@ lir::TernaryOperation toCompilerBinaryOp(MyThread* t, unsigned instruction)
case iushr:
case lushr:
return lir::UnsignedShiftRight;
case fadd:
case ::vm::fadd:
case dadd:
return lir::FloatAdd;
case fsub:
case ::vm::fsub:
case dsub:
return lir::FloatSubtract;
case fmul:
case ::vm::fmul:
case dmul:
return lir::FloatMultiply;
case fdiv:
case ::vm::fdiv:
case ddiv:
return lir::FloatDivide;
case frem:
Expand Down Expand Up @@ -4573,10 +4573,10 @@ void compile(MyThread* t,
c->f2i(ir::Type::i8(), frame->pop(ir::Type::f4())));
} break;

case fadd:
case fsub:
case fmul:
case fdiv:
case ::vm::fadd:
case ::vm::fsub:
case ::vm::fmul:
case ::vm::fdiv:
case frem: {
ir::Value* a = frame->pop(ir::Type::f4());
ir::Value* b = frame->pop(ir::Type::f4());
Expand Down
8 changes: 4 additions & 4 deletions src/debug-util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int printInstruction(uint8_t* code, unsigned& ip, const char* prefix)
return fprintf(stderr, "f2i");
case f2l:
return fprintf(stderr, "f2l");
case fadd:
case ::vm::fadd:
return fprintf(stderr, "fadd");
case faload:
return fprintf(stderr, "faload");
Expand All @@ -156,15 +156,15 @@ int printInstruction(uint8_t* code, unsigned& ip, const char* prefix)
return fprintf(stderr, "fconst_1");
case fconst_2:
return fprintf(stderr, "fconst_2");
case fdiv:
case ::vm::fdiv:
return fprintf(stderr, "fdiv");
case fmul:
case ::vm::fmul:
return fprintf(stderr, "fmul");
case fneg:
return fprintf(stderr, "fneg");
case frem:
return fprintf(stderr, "frem");
case fsub:
case ::vm::fsub:
return fprintf(stderr, "fsub");

case getfield:
Expand Down
8 changes: 4 additions & 4 deletions src/machine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ void disassembleCode(const char* prefix, uint8_t* code, unsigned length)
case f2l:
fprintf(stderr, "f2l\n");
break;
case fadd:
case ::vm::fadd:
fprintf(stderr, "fadd\n");
break;
case faload:
Expand All @@ -1717,10 +1717,10 @@ void disassembleCode(const char* prefix, uint8_t* code, unsigned length)
case fconst_2:
fprintf(stderr, "fconst_2\n");
break;
case fdiv:
case ::vm::fdiv:
fprintf(stderr, "fdiv\n");
break;
case fmul:
case ::vm::fmul:
fprintf(stderr, "fmul\n");
break;
case fneg:
Expand All @@ -1729,7 +1729,7 @@ void disassembleCode(const char* prefix, uint8_t* code, unsigned length)
case frem:
fprintf(stderr, "frem\n");
break;
case fsub:
case ::vm::fsub:
fprintf(stderr, "fsub\n");
break;

Expand Down

0 comments on commit 3ba2dd1

Please sign in to comment.