Andrew Kelley
9e7ae06249
std lib API deprecations for the upcoming 0.6.0 release
...
See #3811
2020-03-30 14:23:22 -04:00
Layne Gustafson
2a05ca1c94
Conv macro string concat to ++
2020-03-28 20:40:13 -04:00
Andrew Kelley
53b5aa812b
Merge remote-tracking branch 'origin/master' into llvm10
2020-03-19 22:19:24 -04:00
Andrew Kelley
8ea0a00f40
improve std lib code for the new semantics
2020-03-19 09:53:54 -04:00
Andrew Kelley
656ba530d8
Merge remote-tracking branch 'origin/master' into llvm10
2020-03-13 15:17:53 -04:00
Andrew Kelley
4905102901
fix all the TODOs from the pull request
...
* `std.Buffer.print` is removed; use `buffer.outStream().print`
* `std.fmt.count` returns a `u64`
* `std.Fifo.print` is removed; use `fifo.outStream().print`
* `std.fmt.bufPrint` error is renamed from `BufferTooSmall`
to `NoSpaceLeft` to match `std.os.write`.
* `std.io.FixedBufferStream.getWritten` returns mutable buffer
if the buffer is mutable.
2020-03-13 12:02:58 -04:00
Andrew Kelley
2dd920ee39
Merge branch 'format-stream' of https://github.com/fengb/zig into fengb-format-stream
2020-03-13 11:31:11 -04:00
Benjamin Feng
4aae55b4cc
Replace fmt with new fmtstream
2020-03-12 10:41:09 -05:00
Benjamin Feng
4023ed56d4
Convert translate-c to fmtstream
2020-03-12 10:41:09 -05:00
Vexu
02c491e42a
translate-c fix order of tokens
2020-03-12 17:14:01 +02:00
Vexu
dda711ba0d
translate-c treat c bools as ints
2020-03-12 14:40:47 +02:00
Vexu
cb4c488cbd
translate-c support struct field alignment
2020-03-10 15:57:57 +02:00
Vexu
4cace8f7c3
properly mangle shadowed primitive types
2020-03-10 15:52:54 +02:00
Vexu
baec74645d
translate-c add daurnimator's pointer check to macro cast
2020-03-10 15:52:03 +02:00
Vexu
692a974c3e
translate-c reject structs with VLAs
2020-03-08 12:11:37 +02:00
Vexu
5aa993cd61
translate-c fix nested loops without blocks.
2020-03-08 11:26:53 +02:00
Andrew Kelley
9e60c89601
Revert "Translate C: Group generated casts"
...
This reverts commit 895672b3f96aab1f5bad3446f5186a047f29412c.
2020-03-08 03:53:06 -04:00
Andrew Kelley
8b80cb3072
Revert "translate-c remove redundant grouping, fix nested loops without blocks."
...
This reverts commit abe7305e169be2047d65f96e6525d3828684f058.
2020-03-08 03:52:52 -04:00
Andrew Kelley
96c07674fc
Merge remote-tracking branch 'origin/master' into llvm10
2020-03-07 12:18:41 -05:00
Vexu
abe7305e16
translate-c remove redundant grouping, fix nested loops without blocks.
2020-03-07 12:14:44 -05:00
Lachlan Easton
895672b3f9
Translate C: Group generated casts
...
Translate C: Put an alignCast in c style pointer casts to allow opaque types to cast properly in C macros
Translate C: add test case for aligning opaque types in pointer casts
Translate C: Fix @typeId -> @typeInfo
Add test case to run_translated_c for casting from pointer to opaque type
2020-03-07 03:26:42 -05:00
Vexu
83d27f71ef
translate-c more macro ops
2020-03-06 17:34:37 -05:00
Vexu
eaccfffe56
translate-c: default initialize non-extern variables to undefined
2020-03-06 00:06:45 -05:00
Vexu
ad27041de9
translate-c demote struct to opaque if unable to translate type
2020-03-05 10:55:32 -05:00
Vexu
e063854563
translate-c correct assumption about macros
2020-03-05 12:23:32 +02:00
Vexu
8088bdc6d5
translate-c macro comma operator
2020-03-05 11:22:50 +02:00
Andrew Kelley
d1cb16aace
Merge remote-tracking branch 'origin/master' into llvm10
2020-03-03 09:44:13 -05:00
Andrew Kelley
ef3d761da5
breaking: std.mem.len no longer takes a type argument
...
also update fmt code to use std.mem.span.
2020-03-01 13:21:39 -05:00
Andrew Kelley
f33bf48af7
Merge remote-tracking branch 'origin/master' into llvm10
2020-02-25 16:30:40 -05:00
Vexu
45da72c5b6
remove usages of @typeId, @memberCount, @memberName and @memberType
2020-02-24 23:09:01 +02:00
Michael Dusan
8583038640
translate-c: change OutOfMemory → ASTUnitFailure
...
- return a better error when no diagnostics are available
2020-02-15 05:14:31 -05:00
Andrew Kelley
a8b36fbe34
Merge remote-tracking branch 'origin/master' into llvm10
2020-02-14 10:27:44 -05:00
Vexu
9206f8a8cd
translate-c improve macro cast translation
2020-02-14 09:36:44 -05:00
Vexu
ae5ba369e1
translate-c float fixes
2020-02-10 11:02:29 -05:00
Andrew Kelley
cdc5070f21
Merge remote-tracking branch 'origin/master' into llvm10
2020-02-10 00:26:33 -05:00
Vexu
f196ddd251
translate c type names
2020-02-05 17:52:46 +02:00
Vexu
1f49460dcb
fix regressions in comments and string prefixes
2020-02-05 08:35:30 +02:00
Andrew Kelley
d0b12d7726
Merge remote-tracking branch 'origin/master' into llvm10
2020-02-03 17:30:38 -05:00
Vexu
35c40f0a70
fix regressions
2020-02-02 10:49:51 +02:00
Vexu
3b23929be5
use std.c.tokenizer in translate-c
2020-02-02 01:40:46 +02:00
LemonBoy
176bc53858
translate-c: Fix translation of fn pointers
...
Closes #4332
2020-01-30 21:33:50 -05:00
Andrew Kelley
a475877007
fix translate-c regression
...
clang.zig had incorrect enum for builtin types
2020-01-30 18:43:54 -05:00
LemonBoy
c944865fc7
Generate compilable code for array inits
...
The compiler still doesn't like too much the newfangled anonymous arrays
so let's use the old-style declarations.
Closes #4181
2020-01-30 19:45:08 +01:00
LemonBoy
534014f84e
translate-c: Handle fn protos wrapped in parenthesis
...
Closes #4289
2020-01-29 12:06:53 -05:00
Feix Weiglhofer
a4a9330648
translate-c: Don't make const parameters mutable. ( #4273 )
...
* translate-c: Remove arg-prefix from const parameters.
* translate-c: Add unittest for const parameters.
2020-01-24 15:32:32 -05:00
LemonBoy
a284be3f69
Fix unsafe cast in translate_c
...
Fixes #4250
2020-01-22 17:58:57 -05:00
Andrew Kelley
b5ac079f88
Merge pull request #4191 from Vexu/non-exhaustive-enums
...
Implement non-exhaustive enums
2020-01-17 14:26:12 -05:00
LemonBoy
7e5e767ba0
Fix regression in char printing
...
Closes #4014
2020-01-16 12:17:16 -05:00
Vexu
6450736c5f
translate-c default enum tag type to c_int
2020-01-16 12:50:44 +02:00
Vexu
f3d174aa61
require size for non-exhaustive enums
2020-01-15 21:38:11 +02:00