On Fri, Mar 3, 2017 at 5:27 AM, Timothy Arceri <tarc...@itsqueeze.com> wrote: > Previously we were deleting the entire cache if a user switched > between 32 and 64 bit applications. > > V2: make the check more generic, it should now work with any > platform we are likely to support. > --- > src/util/disk_cache.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c > index 3abdec4..92528a9 100644 > --- a/src/util/disk_cache.c > +++ b/src/util/disk_cache.c > @@ -40,20 +40,30 @@ > #include "zlib.h" > > #include "util/crc32.h" > #include "util/u_atomic.h" > #include "util/mesa-sha1.h" > #include "util/ralloc.h" > #include "main/errors.h" > > #include "disk_cache.h" > > +#if defined(__ILP32__) > +#if defined(__x86_64__) || defined(__arm__) > +#define CACHE_ARCH "ilp-32" > +#else > +#define CACHE_ARCH "32" > +#endif > +#else > +#define CACHE_ARCH "64" > +#endif
That reports "64" for me on gcc -m32, I think only clang sets __ILP32__ for non-x32 32bit build. I'd still suggest using sizeof(void *) directly in the code, perhaps within some "const char *get_arch_bitness_string()" helper, that should be more reliable. Gražvydas _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev