scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit a69c48367ae383abcbc749cd56509ed8a52fb325
parent 474f2f97f7bd8041b50a4cc7e1fc8b4752642c74
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue,  1 Nov 2022 22:55:38 +0100

cc2: Move type declarations to cc2.h

It may be useful to use these types in some other file and this
avoids having multiple declarations of the same type.

Diffstat:
Msrc/cmd/cc/cc2/cc2.h | 9+++++++++
Msrc/cmd/cc/cc2/parser.c | 8--------
2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/cmd/cc/cc2/cc2.h b/src/cmd/cc/cc2/cc2.h @@ -260,3 +260,12 @@ extern void freesym(Symbol *sym); extern Symbol *curfun; extern Symbol *locals; extern Inst *pc, *prog; + +/* target */ +extern Type int8type, int16type, int32type, int64type, + uint8type, uint16type, uint32type, uint64type, + float32type, float64type, float80type, + booltype, + ptrtype, + voidtype, + arg_type; diff --git a/src/cmd/cc/cc2/parser.c b/src/cmd/cc/cc2/parser.c @@ -11,14 +11,6 @@ #define STACKSIZ 50 -extern Type int8type, int16type, int32type, int64type, - uint8type, uint16type, uint32type, uint64type, - float32type, float64type, float80type, - booltype, - ptrtype, - voidtype, - arg_type; - Type funetype = { .flags = FUNF | ELLIPS };