diff options
author | Chih-Hung Hsieh <chh@google.com> | 2020-08-08 16:20:47 -0700 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2020-08-09 13:01:46 +0200 |
commit | 53290e8f3535f118bcc06c048d34740233ef7821 (patch) | |
tree | 1e347f692a9ca8c3fe7cac7384273cea8dc7b98b /tests/headers/default-macro-constant-type-unsigned.h | |
parent | 1127561bb232fe0aa3ef48cc8404b26ed3b7116c (diff) |
Add --default-macro-constant-type
* --default-macro-constant-type could be 'signed' or 'unsigned'
* Its default value is 'unsigned' to use u32/u64
for C macro constants that fit into the u32/u64 ranges.
* For old C libraries that use macros as int/long parameter
and/or return value types, their macros are better declared
as i32/i64 if the values fit the i32/i64 ranges,
to be compatible with c_int/c_long types.
They can use "--default-macro-constant-type signed"
Diffstat (limited to 'tests/headers/default-macro-constant-type-unsigned.h')
-rw-r--r-- | tests/headers/default-macro-constant-type-unsigned.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/headers/default-macro-constant-type-unsigned.h b/tests/headers/default-macro-constant-type-unsigned.h new file mode 100644 index 00000000..1078e852 --- /dev/null +++ b/tests/headers/default-macro-constant-type-unsigned.h @@ -0,0 +1,3 @@ +// bindgen-flags: --default-macro-constant-type unsigned +// Negative values are i32 or i64; others are u32 or u64. +#include "default-macro-constant-type.h" |