system/ByteOrder: testing for endianness in a more general way
Fixes build tests on ia64 and mipsel by testing for endianness in a more general / portable way.
This commit is contained in:
		 Florian Schlichting
					Florian Schlichting
				
			
				
					committed by
					
						 Max Kellermann
						Max Kellermann
					
				
			
			
				
	
			
			
			 Max Kellermann
						Max Kellermann
					
				
			
						parent
						
							3a4df25db2
						
					
				
				
					commit
					51ec499c89
				
			
							
								
								
									
										1
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								NEWS
									
									
									
									
									
								
							| @@ -1,6 +1,7 @@ | |||||||
| ver 0.18.5 (20??/??/??) | ver 0.18.5 (20??/??/??) | ||||||
| * decoder | * decoder | ||||||
|   - fluidsynth: auto-detect by default |   - fluidsynth: auto-detect by default | ||||||
|  | * fix ia64, mipsel and other little-endian architectures | ||||||
| * fix build failures due to missing includes | * fix build failures due to missing includes | ||||||
| * fix build failure with static libmpdclient | * fix build failure with static libmpdclient | ||||||
|  |  | ||||||
|   | |||||||
| @@ -36,10 +36,20 @@ | |||||||
| /* well-known little-endian */ | /* well-known little-endian */ | ||||||
| #  define IS_LITTLE_ENDIAN true | #  define IS_LITTLE_ENDIAN true | ||||||
| #  define IS_BIG_ENDIAN false | #  define IS_BIG_ENDIAN false | ||||||
| #else | #elif defined(__MIPSEB__) | ||||||
| /* well-known big-endian */ | /* well-known big-endian */ | ||||||
| #  define IS_LITTLE_ENDIAN false | #  define IS_LITTLE_ENDIAN false | ||||||
| #  define IS_BIG_ENDIAN true | #  define IS_BIG_ENDIAN true | ||||||
|  | #else | ||||||
|  | /* generic compile-time check */ | ||||||
|  | #  include <endian.h> | ||||||
|  | #  if __BYTE_ORDER == __LITTLE_ENDIAN | ||||||
|  | #    define IS_LITTLE_ENDIAN true | ||||||
|  | #    define IS_BIG_ENDIAN false | ||||||
|  | #  else | ||||||
|  | #    define IS_LITTLE_ENDIAN false | ||||||
|  | #    define IS_BIG_ENDIAN true | ||||||
|  | #  endif | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| static inline constexpr bool | static inline constexpr bool | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user