提交 7ebcca7d 编写于 作者: R Richard Wilkes

Fix bad include of a C++ header into the C API from upstream

上级 6850e6cd
...@@ -165,6 +165,17 @@ func (c *install) untar(in io.Reader) { ...@@ -165,6 +165,17 @@ func (c *install) untar(in io.Reader) {
case tar.TypeReg: case tar.TypeReg:
buffer, err := ioutil.ReadAll(r) buffer, err := ioutil.ReadAll(r)
checkFileError(err, "read archive data for", name) checkFileError(err, "read archive data for", name)
if name == path.Join(installPrefix, "include/capi/cef_resource_request_handler_capi.h") {
const includeToRemove = `#include "include/internal/cef_types_wrappers.h"`
if i := bytes.Index(buffer, []byte(includeToRemove)); i != -1 {
fmt.Printf(" Fixing up %s...\n", name)
b := make([]byte, len(buffer)+2)
copy(b, buffer[:i])
copy(b[i:], []byte{'/', '/'})
copy(b[i+2:], buffer[i:])
buffer = b
}
}
checkFileError(ioutil.WriteFile(name, buffer, os.FileMode(h.Mode|0444)), "write", name) checkFileError(ioutil.WriteFile(name, buffer, os.FileMode(h.Mode|0444)), "write", name)
default: default:
fmt.Printf("Unexpected type flag: %d\n", h.Typeflag) fmt.Printf("Unexpected type flag: %d\n", h.Typeflag)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册