__WORDSIZE doesn't seem to be available on platforms other than Mac or Linux, and best practices are for user-level code not to rely on it anyhow, since it's meant to be an internal macro.  Fortunately, autoconf already has a way of determining the word size at configure time, so it can be passed into the compiler.  This should work on any platform and has been tested on all of the Un*x platforms we support (Linux, Mac, FreeBSD, Solaris.)


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.4.x@1550 632fc199-4ca6-4c93-a231-07263d6284db
diff --git a/jdhuff.h b/jdhuff.h
index f2805e4..c7f3d50 100644
--- a/jdhuff.h
+++ b/jdhuff.h
@@ -67,7 +67,11 @@
  * necessary.
  */
 
-#if __WORDSIZE == 64 || defined(_WIN64)
+#if !defined(_WIN32) && !defined(SIZEOF_SIZE_T)
+#error Cannot determine word size
+#endif
+
+#if SIZEOF_SIZE_T==8 || defined(_WIN64)
 
 typedef size_t bit_buf_type;    /* type of bit-extraction buffer */
 #define BIT_BUF_SIZE  64                /* size of buffer in bits */