From 6ec3549cd7b02745a54d09ea8afca200efe3d3ca Mon Sep 17 00:00:00 2001 From: Dietrich Epp Date: Tue, 22 Mar 2022 19:05:13 -0400 Subject: [PATCH] Build charmap.c generated file --- gen/scriptmap.go | 2 +- src/BUILD.bazel | 2 ++ src/convert.h | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/convert.h diff --git a/gen/scriptmap.go b/gen/scriptmap.go index 488b8b3..a4a85c6 100644 --- a/gen/scriptmap.go +++ b/gen/scriptmap.go @@ -86,7 +86,7 @@ func writeMap(d *scriptdata, m []*scriptmap, filename string) error { w.WriteString(header) w.WriteString( - "#include \"convert.h\"\n" + + "#include \"src/convert.h\"\n" + "int GetCharmap(int script, int region) {\n" + "switch (script) {\n") for _, s := range m { diff --git a/src/BUILD.bazel b/src/BUILD.bazel index ead3393..d1a620e 100644 --- a/src/BUILD.bazel +++ b/src/BUILD.bazel @@ -31,6 +31,8 @@ genrule( cc_library( name = "convert", srcs = [ + "charmap.c", + "convert.h", "defs.h", "toolbox.c", ], diff --git a/src/convert.h b/src/convert.h new file mode 100644 index 0000000..b5ada64 --- /dev/null +++ b/src/convert.h @@ -0,0 +1,9 @@ +#ifndef convert_h +#define convert_h +/* convert.h - character set conversion routines. */ + +/* Get the character map used for the given Mac OS script and region codes. + Return -1 if no known character map exists. */ +int GetCharmap(int script, int region); + +#endif