vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
556 stars 93 forks source link

compilation problem with COMPACT=0 #258

Closed jan-kaspar closed 3 years ago

jan-kaspar commented 3 years ago

It seems to me that dbc74f5b52f9c610324fbc1c2f6ec946be3d8ef1 (and previous) has introduced a compilation problem when COMPACT=0 is used. In particular, file.io uses vm::Undefined https://github.com/vectorgraphics/asymptote/blob/dbc74f5b52f9c610324fbc1c2f6ec946be3d8ef1/fileio.h#L225 which is only defined when COMPACT is enabled: https://github.com/vectorgraphics/asymptote/blob/dbc74f5b52f9c610324fbc1c2f6ec946be3d8ef1/item.h#L29-L34

johncbowman commented 3 years ago

Good to know. However, we were actually considering to enforce COMPACT=1 in the near future. Does your hardware not have 64 bit integers?

jan-kaspar commented 3 years ago

Many thanks @johncbowman for the quick fix!

My reason for using COMPACT=0 is the ROOT extension that I developed: http://artax.karlin.mff.cuni.cz/~kaspj0am/doku.php?id=en:prog:asyroot I apologise, the documentation is somewhat outdated, e.g. the uptodate code is now in GitHub: https://github.com/jan-kaspar/asymptote/tree/root The extension needs to have access to the vm::item::type(), e.g.: https://github.com/jan-kaspar/asymptote/blob/root/root.cc#L689 which is only available with COMPACT=0 https://github.com/jan-kaspar/asymptote/blob/root/item.h#L160 Would there be any possibility to get access to the item type with COMPACT=1 ?

Somewhat related question, would it be conceivable to merge this extension to the official code base? I guess this is a necessity to get more people using it...

Many thanks in advance!