Have gen's "single file C library" be .h not .c

This commit is contained in:
Nigel Tao committed 2018-07-14 09:26:10 +10:00
1 parent eac9ac13d2
commit f2e683ab69
4 files changed
+12 -7

No files matched your search

+2 -2
View File
@@ -78,11 +78,11 @@ var (
func genObj(outDir string, inDir string, cc string, dynamism string, filenames []string) error {
for _, filename := range filenames {
in := filepath.Join(inDir, filename+".c")
in := filepath.Join(inDir, filename+".h")
out := genlibOutFilename(outDir, dynamism, filename)
args := []string(nil)
args = append(args, "-O3", "-std=c99", "-DWUFFS_IMPLEMENTATION")
args = append(args, "-x", "c", "-O3", "-std=c99", "-DWUFFS_IMPLEMENTATION")
if dynamism == "dynamic" {
args = append(args, "-fPIC", "-DPIC")
}
+1 -1
View File
@@ -805,7 +805,7 @@ func (g *gen) writeUse(b *buffer, n *a.Use) error {
}
}
useeFilename := filepath.Join(g.wuffsRoot, "gen", "c", filepath.FromSlash(useDirname)+".c")
useeFilename := filepath.Join(g.wuffsRoot, "gen", "c", filepath.FromSlash(useDirname)+".h")
usee, err := ioutil.ReadFile(useeFilename)
if err != nil {
return err