summaryrefslogtreecommitdiffstats
path: root/third_party/rust/freetype/etc/bindgen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/freetype/etc/bindgen.sh')
-rwxr-xr-xthird_party/rust/freetype/etc/bindgen.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/third_party/rust/freetype/etc/bindgen.sh b/third_party/rust/freetype/etc/bindgen.sh
new file mode 100755
index 0000000000..2b8b9f684d
--- /dev/null
+++ b/third_party/rust/freetype/etc/bindgen.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+cd "$(dirname $0)"
+
+# We replace the FT_ integer types of known widths, since we can do better.
+#
+# We blacklist FT_Error and import our own in order to have convenience methods
+# on it instead of being a plain integer.
+"${BINDGEN}" bindings.h -o ../src/freetype.rs \
+ --blacklist-type "FT_(Int16|UInt16|Int32|UInt32|Int16|Int64|UInt64)" \
+ --raw-line "pub type FT_Int16 = i16;" \
+ --raw-line "pub type FT_UInt16 = u16;" \
+ --raw-line "pub type FT_Int32 = i32;" \
+ --raw-line "pub type FT_UInt32 = u32;" \
+ --raw-line "pub type FT_Int64= i64;" \
+ --raw-line "pub type FT_UInt64= u64;" \
+ --blacklist-type "FT_Error" \
+ --raw-line "pub use FT_Error;" \
+ --generate=functions,types,vars \
+ --whitelist-function="FT_.*" \
+ --whitelist-type="FT_.*" \
+ --whitelist-var="FT_.*" \
+ -- -I/usr/include/freetype2