tomhrr / dale

Lisp-flavoured C
BSD 3-Clause "New" or "Revised" License
1.02k stars 48 forks source link

Include often causes errors, even memory errors #160

Closed porky11 closed 7 years ago

porky11 commented 7 years ago

I don't know many exact cases, where errors occur, mostly it happened while trying to include some files in https://github.com/porky11/dale-gl Some simple example:

(namespace include

(include "enum.dt")

(def print-enum (fn intern void ((a enum)) ;;type enum not defined in this scope
  (printf "%u" a)))

)

(def main (fn extern-c void (void)
  (print-enum value)))

where enum.dt is:

(import enum)

(def-enum enum extern uint
  ((value 0)))
tomhrr commented 7 years ago

Thanks, this should be fixed now.

tomhrr commented 7 years ago

There were some bad assumptions with this change, so this needs a little more work now, but it shouldn't take long.

tomhrr commented 7 years ago

Should be OK now.