X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2FABM2.git;a=blobdiff_plain;f=ABM2%2FEngine%2Fsingleton.h;h=748414ad43f9ac475bea4c13f4737d5a4f815e91;hp=2e3e6e2cfbea6e65cbb33abf9ef8ae6c01dda9cb;hb=357a451150c18b27f99cecd5f9d13be1ae5a9fdf;hpb=0b314338a46fe83c1c4bb646da858ebd5d4a7317 diff --git a/ABM2/Engine/singleton.h b/ABM2/Engine/singleton.h index 2e3e6e2..748414a 100755 --- a/ABM2/Engine/singleton.h +++ b/ABM2/Engine/singleton.h @@ -11,8 +11,10 @@ class Singleton assert(!ms_singleton); //use a cunning trick to get the singleton pointing to the start of the whole, rather than //the start of the Singleton part of the object - int offset = (int)(T*)1 - (int)(Singleton *)(T*)1; - ms_singleton = (T*)((int)this + offset); + // This used to say "int" instead of long, but that breaks + // on 64 bit linux at least + long offset = (long)(T*)1 - (long)(Singleton *)(T*)1; + ms_singleton = (T*)((long)this + offset); } ~Singleton() {