Vadim Petrochenkov
aeb69bcc69
Switch default sorting order for items to "None"
2020-10-05 19:57:33 +02:00
Vadim Petrochenkov
56d0799366
Use U'...' character literals instead of L'...' character literals
...
On Windows `L'...'` is 16 bit, so Rust `char` won't generally fit into it.
2020-10-03 17:34:27 +02:00
Kartikaya Gupta
5f6b223237
Add ostream header to all generated .cpp files.
...
Ideally we'd just do this when we need it, but the ostream derivation
will be controlled by both global config and per-structure config, so
it's hard to know exactly when we need it and when we don't.
2020-10-01 12:22:51 +02:00
Hayes Neuman
967c378308
Support casts in constants
2020-05-26 23:21:28 +02:00
Arnav Singh
c6809b00fb
Emit documentation on constants ( #471 )
...
Fixes #403
2020-02-11 01:51:57 +01:00
John VanEnk
eb9cce6934
Update tests/expectations
2020-01-24 11:22:39 +01:00
Jaseem Abid
e0fe4e4c44
Add tests for expressions like (0 << SHIFT) | BOOL
...
Fixes https://github.com/eqrion/cbindgen/issues/412
2019-12-08 12:34:59 +01:00
Emilio Cobos Álvarez
9b5dd80d84
Stop including <uchar.h>, and instead map Rust char to uint32_t.
...
This is technically a breaking change for C++, unfortunately.
Fixes #423 .
2019-12-04 00:03:38 +01:00
Adrian Wong
087d36f32a
Map char to char32_t
...
Rust's `char` is 32 bits wide, but `wchar_t` on Windows is 16.
Avoid truncation by mapping `char` to `char32_t`.
2019-10-04 10:39:31 +02:00
Emilio Cobos Álvarez
b2e224354b
Use placement new for constructing in tagged unions' helper methods.
...
Using operator= is not quite sound in presence of destructors and operator
overloading.
It's perfectly fine to assume that the left-hand-side of an operator= expression
is valid memory, however we're using uninitialized memory here, that may not be
the case.
Use placement new to properly construct tagged unions. I don't need this with
any urgency, but it's the right thing to do in presence of complex types, and
the current code seems a bomb waiting to explode :)
2019-05-10 18:15:39 +02:00
Axel Nennker
87007649c8
fix #205 Negative literals ( #323 )
...
* fix #205
Signed-off-by: Axel Nennker <axel.nennker@telekom.de >
* remove comment
Signed-off-by: Axel Nennker <axel.nennker@telekom.de >
2019-04-19 15:45:16 +02:00
Axel Nennker
7a8b3d9944
check char constant length
...
Signed-off-by: Axel Nennker <axel.nennker@telekom.de >
2019-04-15 15:56:36 +02:00
Axel Nennker
60b001ebb2
translate Rust unicode representation to C style unicode representation
...
Signed-off-by: Axel Nennker <axel.nennker@telekom.de >
2019-04-15 15:22:56 +02:00
Axel Nennker
19483c21bc
heart char constant in tests
...
Signed-off-by: Axel Nennker <axel.nennker@telekom.de >
2019-04-15 12:30:05 +02:00
Axel Nennker
58e85439c5
escape chars
...
Signed-off-by: Axel Nennker <axel.nennker@telekom.de >
2019-04-15 07:57:09 +02:00
Axel Nennker
19fd975b6f
test for char const
...
Signed-off-by: Axel Nennker <axel.nennker@telekom.de >
2019-04-13 23:46:51 +02:00
Dan Robertson
304f752c06
Add support for VaList functions
2019-01-03 09:46:55 -06:00
Ingvar Stepanyan
8fddc5d0a9
Emit generics as native templates in C++
2017-11-18 14:40:42 -06:00
Ryan Hunt
aa9c20bc03
Do not emit const char* for &str
2017-11-13 23:05:00 -05:00
Ryan Hunt
6a02ec4a7f
Commit test expectations
2017-11-09 18:04:22 -05:00