Dmitry Timoshkov : widl: Fixup the defaultvalue(BSTR) expression type like midl does.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 30 09:54:02 CST 2015


Module: wine
Branch: master
Commit: b53c5b30b2f2c2d8ad21bbb4097b1a63b43136b0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b53c5b30b2f2c2d8ad21bbb4097b1a63b43136b0

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Fri Nov 27 18:00:27 2015 +0800

widl: Fixup the defaultvalue(BSTR) expression type like midl does.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/widl/header.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/widl/header.c b/tools/widl/header.c
index cb4601e..7b97158 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -35,6 +35,7 @@
 #include "header.h"
 #include "expr.h"
 #include "typetree.h"
+#include "typelib.h"
 
 static int indentation = 0;
 static int is_object_interface = 0;
@@ -1009,6 +1010,16 @@ void write_args(FILE *h, const var_list_t *args, const char *name, int method, i
             /* Output default value only if all following arguments also have default value. */
             LIST_FOR_EACH_ENTRY_REV( tail_arg, args, const var_t, entry ) {
                 if(tail_arg == arg) {
+                    expr_t bstr;
+
+                    /* Fixup the expression type for a BSTR like midl does. */
+                    if (get_type_vt(arg->type) == VT_BSTR && expr->type == EXPR_STRLIT)
+                    {
+                        bstr = *expr;
+                        bstr.type = EXPR_WSTRLIT;
+                        expr = &bstr;
+                    }
+
                     fprintf(h, " = ");
                     write_expr( h, expr, 0, 1, NULL, NULL, "" );
                     break;




More information about the wine-cvs mailing list