mirror of
				https://github.com/gnif/LookingGlass.git
				synced 2025-10-31 04:31:57 +00:00 
			
		
		
		
	[common] only define min/max if they have not already been defined
This commit is contained in:
		| @@ -21,10 +21,15 @@ | ||||
| #ifndef _H_LG_COMMON_UTIL_ | ||||
| #define _H_LG_COMMON_UTIL_ | ||||
|  | ||||
| #ifndef min | ||||
| #define min(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); \ | ||||
|     _a < _b ? _a : _b; }) | ||||
| #endif | ||||
|  | ||||
| #ifndef max | ||||
| #define max(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); \ | ||||
|     _a > _b ? _a : _b; }) | ||||
| #endif | ||||
|  | ||||
| #define UPCAST(type, x) \ | ||||
|   (type *)((uintptr_t)(x) - offsetof(type, base)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Geoffrey McRae
					Geoffrey McRae