mirror of
				https://github.com/RetroShare/RetroShare.git
				synced 2025-11-03 15:29:02 -05:00 
			
		
		
		
	Fix build error on big endian architectures
This commit is contained in:
		
							parent
							
								
									9587cfd4d9
								
							
						
					
					
						commit
						3a6648f706
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -26,7 +26,7 @@
 | 
			
		|||
 * This file provide convenient integer endiannes conversion utilities.
 | 
			
		||||
 * Instead of providing them with different names for each type (a la C htonl,
 | 
			
		||||
 * htons, ntohl, ntohs ), which make them uncomfortable to use, expose a
 | 
			
		||||
 * templated function `rs_endian_fix` to reorder integers representation byets
 | 
			
		||||
 * templated function `rs_endian_fix` to reorder integers bytes representation
 | 
			
		||||
 * when sending or receiving from the network. */
 | 
			
		||||
 | 
			
		||||
/* enforce LITTLE_ENDIAN on Windows */
 | 
			
		||||
| 
						 | 
				
			
			@ -46,7 +46,7 @@ template<typename INTTYPE> inline INTTYPE rs_endian_fix(INTTYPE val)
 | 
			
		|||
		swapped |= (val >> (8*(sizeof(INTTYPE)-i-1)) & 0xFF) << (8*i);
 | 
			
		||||
	return swapped;
 | 
			
		||||
#else
 | 
			
		||||
	return hostI;
 | 
			
		||||
	return val;
 | 
			
		||||
#endif
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue