> > I had the same problem.  A half solution was to check the size of the 
> > structures eg sizeof(EMC_STAT).  I only need to know if a binary has 
> > changed, and stop when there was a mismatch.

> I wish there was a way to do that at runtime. As far as I know that trick 
> only works at compile time. You get the size of the EMC_STAT class you
>  compiled with, not the version that is currently running.


            if ( m_emcStatus->size != sizeof(EMC_STAT) )
            {


The size of the structure is in the message, so you can check the version of
your application, against the version of linuxcnc that you are communicating
with.  In my case, I just stop if there is a mismatch - if you want to
support multiple versions, you need to manage version changes yourself ie
create a constant for each size when versions change.  Again, just a half
solution.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to