Corrected the alignment of unicode message table strings in wmc, and
switched to unicode for message strings, so that FormatMessage() now
works.
diff --git a/Make.rules.in b/Make.rules.in
index fec8f11..bc07ba0 100644
--- a/Make.rules.in
+++ b/Make.rules.in
@@ -117,7 +117,7 @@
$(AS) -o $@ $<
.mc.mc.rc:
- $(LDPATH) $(WMC) -i -H /dev/null -o $@ $<
+ $(LDPATH) $(WMC) -i -U -H /dev/null -o $@ $<
.rc.res:
$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -r $<
diff --git a/tools/wmc/write.c b/tools/wmc/write.c
index 4c16cdd..e45e117 100644
--- a/tools/wmc/write.c
+++ b/tools/wmc/write.c
@@ -359,7 +359,10 @@
b = 0;
}
}
- len = (len + 3) & ~3;
+ if (unicodeout)
+ len = (len + 1) & ~1;
+ else
+ len = (len + 3) & ~3;
for(; i < len; i++)
{
*cptr++ = '\\';
@@ -467,7 +470,7 @@
cptr = make_string(blk->msgs[j]->msg, l, unicodeout ? 0 : blk->msgs[j]->cp);
fprintf(fp, "\n /* Msg 0x%08x */ 0x%04x, 0x000%c,\n",
blk->idlo + j,
- (unicodeout ? (l*2+3)&~3 : (l+3)&~3)+4,
+ (unicodeout ? (l*2+3)&~3 : (l+3)&~3) + 4,
unicodeout ? '1' : '0');
fprintf(fp, "%s%s\n", cptr, comma);
free(cptr);