Skip to content

Commit

Permalink
freetype-sys: fix bindgen FT_Err enums (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP authored Nov 16, 2024
1 parent ade86c6 commit 6709a1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion crates/freetype-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ fn main() {
.parse_callbacks(Box::new(CargoCallbacks::new()))
.clang_args(clang_args)
.ctypes_prefix("::libc")
.allowlist_file(r".+[/\\]freetype[/\\].+")
.allowlist_file(r".+[/\\]freetype[/\\].+|.+[/\\]freetype\.h")
.prepend_enum_name(false)
.generate()
.unwrap();

Expand Down
5 changes: 3 additions & 2 deletions crates/freetype-sys/include/freetype.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include <ft2build.h>

#define FT_INCLUDE_ERR_PROTOS
#define FT_ERRORDEF(e, v, s) const FT_Error e = v;
#define FT_MODERRDEF(e, v, s) const FT_Error FT_Mod_Err_##e = v;
#define FT_ERRORDEF( e, v, s ) e = v,
#define FT_ERROR_START_LIST enum FT_ERR : FT_Error {
#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };

#include FT_FREETYPE_H
#include FT_MODULE_H
Expand Down

0 comments on commit 6709a1b

Please sign in to comment.