mirror of
				https://github.com/facebook/zstd.git
				synced 2025-11-03 20:33:11 +03:00 
			
		
		
		
	minor static assert for 32/64 bits system. Suggested by @ebiggers
This commit is contained in:
		
							
								
								
									
										3
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								NEWS
									
									
									
									
									
								
							@@ -1,3 +1,6 @@
 | 
				
			|||||||
 | 
					v0.7.5
 | 
				
			||||||
 | 
					Fixed : premature end of frame when zero-sized raw block, reported by Eric Biggers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
v0.7.4
 | 
					v0.7.4
 | 
				
			||||||
Added : homebrew for Mac
 | 
					Added : homebrew for Mac
 | 
				
			||||||
Added : more examples
 | 
					Added : more examples
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -44,16 +44,14 @@ extern "C" {
 | 
				
			|||||||
******************************************/
 | 
					******************************************/
 | 
				
			||||||
#include <stddef.h>     /* size_t, ptrdiff_t */
 | 
					#include <stddef.h>     /* size_t, ptrdiff_t */
 | 
				
			||||||
#include <string.h>     /* memcpy */
 | 
					#include <string.h>     /* memcpy */
 | 
				
			||||||
#if defined(_MSC_VER)   /* Visual Studio */
 | 
					 | 
				
			||||||
#   include <stdlib.h>  /* _byteswap_ulong */
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*-****************************************
 | 
					/*-****************************************
 | 
				
			||||||
*  Compiler specifics
 | 
					*  Compiler specifics
 | 
				
			||||||
******************************************/
 | 
					******************************************/
 | 
				
			||||||
#if defined(_MSC_VER)
 | 
					#if defined(_MSC_VER)   /* Visual Studio */
 | 
				
			||||||
#   include <intrin.h>   /* _byteswap_ */
 | 
					#   include <stdlib.h>  /* _byteswap_ulong */
 | 
				
			||||||
 | 
					#   include <intrin.h>  /* _byteswap_* */
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
#if defined(__GNUC__)
 | 
					#if defined(__GNUC__)
 | 
				
			||||||
#  define MEM_STATIC static __attribute__((unused))
 | 
					#  define MEM_STATIC static __attribute__((unused))
 | 
				
			||||||
@@ -65,6 +63,10 @@ extern "C" {
 | 
				
			|||||||
#  define MEM_STATIC static  /* this version may generate warnings for unused static functions; disable the relevant warning */
 | 
					#  define MEM_STATIC static  /* this version may generate warnings for unused static functions; disable the relevant warning */
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* code only tested on 32 and 64 bits systems */
 | 
				
			||||||
 | 
					#define MEM_STATIC_ASSERT(c)   { enum { XXH_static_assert = 1/(int)(!!(c)) }; }
 | 
				
			||||||
 | 
					MEM_STATIC void MEM_check(void) { MEM_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*-**************************************************************
 | 
					/*-**************************************************************
 | 
				
			||||||
*  Basic Types
 | 
					*  Basic Types
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user