Let Wuffs compile with MSVC (Microsoft Visual C++)

This commit is contained in:
Nigel Tao committed 2019-02-16 09:02:33 +11:00
1 parent 438fc10597
commit ab7d6de318
13 files changed
+182 -155

No files matched your search

+7 -2
View File
@@ -289,12 +289,17 @@ func (g *gen) writeVars(b *buffer, f *funk, inStructDecl bool) error {
b.writes(" = false;\n")
} else if typ.IsStatus() {
b.writes(" = NULL;\n")
} else if typ.IsIOType() {
b.writes(" = {.private_impl = {0}};\n")
} else {
b.writes(" = {};\n")
b.writes(" = {0};\n")
}
if typ.IsIOType() {
b.printf("wuffs_base__io_buffer %s%s WUFFS_BASE__POTENTIALLY_UNUSED = {};\n", uPrefix, name)
b.printf("wuffs_base__io_buffer %s%s WUFFS_BASE__POTENTIALLY_UNUSED = {"+
".data = ((wuffs_base__slice_u8){0}),\n"+
".meta = ((wuffs_base__io_buffer_meta){0}),\n"+
"};\n", uPrefix, name)
preName := vPrefix + name
// TODO: io0_etc variables?
b.printf("uint8_t* %s%s WUFFS_BASE__POTENTIALLY_UNUSED = NULL;\n", iopPrefix, preName)