bugfix: c2nim: typedef unsigned char
This commit is contained in:
parent
202d229fdf
commit
2b21285144
4 changed files with 5 additions and 7 deletions
|
|
@ -1123,12 +1123,6 @@ proc isNil*(x: cstring): bool {.noSideEffect, magic: "IsNil".}
|
||||||
## Fast check whether `x` is nil. This is sometimes more efficient than
|
## Fast check whether `x` is nil. This is sometimes more efficient than
|
||||||
## ``== nil``.
|
## ``== nil``.
|
||||||
|
|
||||||
|
|
||||||
# Fixup some magic symbols here:
|
|
||||||
#{.fixup_system.}
|
|
||||||
# This is an undocumented pragma that can only be used
|
|
||||||
# once in the system module.
|
|
||||||
|
|
||||||
proc `&` *[T](x, y: openArray[T]): seq[T] {.noSideEffect.} =
|
proc `&` *[T](x, y: openArray[T]): seq[T] {.noSideEffect.} =
|
||||||
newSeq(result, x.len + y.len)
|
newSeq(result, x.len + y.len)
|
||||||
for i in 0..x.len-1:
|
for i in 0..x.len-1:
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,9 @@ elif defined(nogc):
|
||||||
# object, because C does not support this operation... Even though every
|
# object, because C does not support this operation... Even though every
|
||||||
# possible implementation has to have a way to determine the object's size.
|
# possible implementation has to have a way to determine the object's size.
|
||||||
# C just sucks.
|
# C just sucks.
|
||||||
|
when appType == "lib":
|
||||||
|
{.warning: "nogc in a library context may not work".}
|
||||||
|
|
||||||
include "system/alloc"
|
include "system/alloc"
|
||||||
|
|
||||||
when false:
|
when false:
|
||||||
|
|
|
||||||
|
|
@ -376,7 +376,7 @@ proc typeAtom(p: var TParser): PNode =
|
||||||
elif isIntType(p.tok.s):
|
elif isIntType(p.tok.s):
|
||||||
var x = "c" & p.tok.s
|
var x = "c" & p.tok.s
|
||||||
getTok(p, nil)
|
getTok(p, nil)
|
||||||
while p.tok.xkind == pxSymbol and isIntType(p.tok.s):
|
while p.tok.xkind == pxSymbol and (isIntType(p.tok.s) or p.tok.s == "char"):
|
||||||
add(x, p.tok.s)
|
add(x, p.tok.s)
|
||||||
getTok(p, nil)
|
getTok(p, nil)
|
||||||
result = newIdentNodeP(x, p)
|
result = newIdentNodeP(x, p)
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ extern "C" {
|
||||||
|
|
||||||
typedef char gchar;
|
typedef char gchar;
|
||||||
typedef unsigned int gunsignedint;
|
typedef unsigned int gunsignedint;
|
||||||
|
typedef unsigned char guchar;
|
||||||
|
|
||||||
point* newPoint(void) {
|
point* newPoint(void) {
|
||||||
for (int i = 0; i < 89; ++i) echo("test" " string " "concatenation");
|
for (int i = 0; i < 89; ++i) echo("test" " string " "concatenation");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue