missing #include "ngspice/config.h" thats required for consistent interpretation of the type struct IFdevice from ngspice/ifsim.h included from ngspice/devdefs.h (invisible XSPICE definition leading to different size and layout of this struct)