summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2012-05-09 23:49:41 (GMT)
committeryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2012-05-09 23:49:41 (GMT)
commitd8184bf7efeefae6ea89de6243c7bd9afe9a56e6 (patch)
tree7ecf3a7992ec45f761a47b84e4d328b2420c0028
parentae9eead4aeef810acfc5ee768f72d92b5028fc9f (diff)
downloadlz4-d8184bf7efeefae6ea89de6243c7bd9afe9a56e6.zip
lz4-d8184bf7efeefae6ea89de6243c7bd9afe9a56e6.tar.gz
lz4-d8184bf7efeefae6ea89de6243c7bd9afe9a56e6.tar.bz2
minor : Force Software-bit-count for WinCE environment under Visual. Thanks Bayang for Reporting.
git-svn-id: https://lz4.googlecode.com/svn/trunk@64 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
-rw-r--r--lz4.c8
-rw-r--r--lz4demo.c6
2 files changed, 10 insertions, 4 deletions
diff --git a/lz4.c b/lz4.c
index 826b785..8226361 100644
--- a/lz4.c
+++ b/lz4.c
@@ -85,9 +85,10 @@
# define LZ4_FORCE_UNALIGNED_ACCESS 1
#endif
-// Uncomment this parameter if your target system or compiler does not support hardware bit count
-//#define LZ4_FORCE_SW_BITCOUNT
-
+// Define this parameter if your target system or compiler does not support hardware bit count
+#if defined(_MSC_VER) && defined(_WIN32_WCE) // Visual Studio for Windows CE does not support Hardware bit count
+# define LZ4_FORCE_SW_BITCOUNT
+#endif
//**************************************
@@ -103,7 +104,6 @@
#ifdef _MSC_VER // Visual Studio
# define inline __forceinline // Visual is not C99, but supports some kind of inline
-# include <intrin.h> // _BitScanForward
# if LZ4_ARCH64 // 64-bit
# pragma intrinsic(_BitScanForward64) // For Visual 2005
# pragma intrinsic(_BitScanReverse64) // For Visual 2005
diff --git a/lz4demo.c b/lz4demo.c
index 669d241..88ed79c 100644
--- a/lz4demo.c
+++ b/lz4demo.c
@@ -28,6 +28,12 @@
*/
//****************************
+// Warning messages
+//****************************
+#define _CRT_SECURE_NO_WARNINGS // Visual (must be first line)
+
+
+//****************************
// Includes
//****************************
#include <stdio.h> // fprintf, fopen, fread, _fileno(?)