[caching] handle VARIABLE_HINT_SIZE incompat flag
This commit is contained in:
		
							
								
								
									
										26
									
								
								base/bits.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								base/bits.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
#ifndef BASE_BITS_H
 | 
			
		||||
#define BASE_BITS_H
 | 
			
		||||
 | 
			
		||||
//----------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
namespace base {
 | 
			
		||||
	template <typename T>
 | 
			
		||||
	bool test_bit(T flag, unsigned bit) {
 | 
			
		||||
		return flag & (1 << bit);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	template <typename T>
 | 
			
		||||
	void set_bit(T &flag, unsigned bit) {
 | 
			
		||||
		flag = flag | (1 << bit);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	template <typename T>
 | 
			
		||||
	void clear_bit(T &flag, unsigned bit) {
 | 
			
		||||
		flag = flag & ~(1 << bit);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//----------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user