diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-09-13 11:52:48 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-09-13 11:13:46 +0000 |
commit | 382de8687d572b3327d3e6ee0b1b7a37cbf6b5e5 (patch) | |
tree | 6594416dfc1139cdfa23cdfc8339d41003098c7f /src/qml/compiler/qv4instr_moth_p.h | |
parent | a3a380f334aa1335a802fe429c199db8ccb1e862 (diff) |
Make msvc2015 happy
- safely truncate a size_t to an int
- __VA_ARGS__ expansion is slightly different on msvc, so massage some
usages
- use unused labels
Change-Id: I0a90bd15f9ddf7e0faea1ae8bb0e51cb9574a205
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4instr_moth_p.h')
-rw-r--r-- | src/qml/compiler/qv4instr_moth_p.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index 90ed2c804c..8234f1261e 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -304,10 +304,11 @@ QT_BEGIN_NAMESPACE #define MOTH_INSTR_ENUM(I) I, #define MOTH_INSTR_SIZE(I) (sizeof(QV4::Moth::Instr::instr_##I)) +#define MOTH_EXPAND_FOR_MSVC(x) x #define MOTH_DEFINE_ARGS(nargs, ...) \ - MOTH_DEFINE_ARGS##nargs(__VA_ARGS__) + MOTH_EXPAND_FOR_MSVC(MOTH_DEFINE_ARGS##nargs(__VA_ARGS__)) -#define MOTH_DEFINE_ARGS0(dummy) +#define MOTH_DEFINE_ARGS0() #define MOTH_DEFINE_ARGS1(arg) \ int arg; #define MOTH_DEFINE_ARGS2(arg1, arg2) \ @@ -352,6 +353,7 @@ QT_BEGIN_NAMESPACE #define MOTH_DECODE_INSTRUCTION(name, nargs, ...) \ MOTH_DEFINE_ARGS(nargs, __VA_ARGS__) \ + goto op_int_##name; \ op_int_##name: \ MOTH_ADJUST_CODE(int, nargs); \ MOTH_DECODE_ARGS(name, int, nargs, __VA_ARGS__) \ @@ -365,6 +367,7 @@ QT_BEGIN_NAMESPACE #define MOTH_DECODE_WITH_BASE_INSTRUCTION(name, nargs, ...) \ MOTH_DEFINE_ARGS(nargs, __VA_ARGS__) \ const char *base_ptr; \ + goto op_int_##name; \ op_int_##name: \ base_ptr = code; \ MOTH_ADJUST_CODE(int, nargs); \ @@ -378,7 +381,7 @@ QT_BEGIN_NAMESPACE ; \ #define MOTH_DECODE_ARGS(name, type, nargs, ...) \ - MOTH_DECODE_ARGS##nargs(name, type, nargs, __VA_ARGS__) + MOTH_EXPAND_FOR_MSVC(MOTH_DECODE_ARGS##nargs(name, type, nargs, __VA_ARGS__)) #define MOTH_DECODE_ARGS0(name, type, nargs, dummy) #define MOTH_DECODE_ARGS1(name, type, nargs, arg) \ |