summaryrefslogtreecommitdiff
path: root/lzf_c.c
diff options
context:
space:
mode:
authorroot <root>2008-05-09 12:42:50 +0000
committerroot <root>2008-05-09 12:42:50 +0000
commit95b63bcf4dfbc28630ee68784f7619b34c1db30b (patch)
tree45f90b81a39c5829ccaf5a48b0c43dd14bc6aede /lzf_c.c
parent696c19178d924f4e8ce0e76eda7488892351df8e (diff)
*** empty log message ***
Diffstat (limited to 'lzf_c.c')
-rw-r--r--lzf_c.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lzf_c.c b/lzf_c.c
index 268313a..c1847f3 100644
--- a/lzf_c.c
+++ b/lzf_c.c
@@ -113,12 +113,19 @@ lzf_compress (const void *const in_data, unsigned int in_len,
u8 *out_end = op + out_len;
const u8 *ref;
- unsigned int hval;
-#if WIN32
- unsigned _int64 off; /* workaround for microsoft bug (they claim to support POSIX) */
+ /* off requires a type wide enough to hold a general pointer difference.
+ * ISO C doesn't have that (size_t might not be enough and ptrdiff_t only
+ * works for differences within a single object). We also assume that no
+ * no bit pattern traps. Since the only platform that is both non-POSIX
+ * and fails to support both assumptions is windows 64 bit, we make a
+ * special workaround for it.
+ */
+#if defined (WIN32) && defined (_M_X64)
+ unsigned _int64 off; /* workaround for missing POSIX compliance */
#else
unsigned long off;
#endif
+ unsigned int hval;
int lit;
if (!in_len || !out_len)