mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Travis: restore build on GCC 4.4
This commit is contained in:
		| @@ -2,6 +2,12 @@ sudo: false | ||||
| language: cpp | ||||
| matrix: | ||||
|   include: | ||||
|     - compiler: gcc | ||||
|       addons: | ||||
|         apt: | ||||
|           sources: ['ubuntu-toolchain-r-test'] | ||||
|           packages: ['g++-4.4'] | ||||
|       env: SCRIPT=cmake GCC=4.4 | ||||
|     - compiler: gcc | ||||
|       addons: | ||||
|         apt: | ||||
|   | ||||
| @@ -139,7 +139,7 @@ | ||||
| #ifndef ARDUINOJSON_LITTLE_ENDIAN | ||||
| #if defined(_MSC_VER) ||                                                      \ | ||||
|     (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || \ | ||||
|     (defined(__LITTLE_ENDIAN__)) | ||||
|     defined(__LITTLE_ENDIAN__) || defined(__i386) || defined(__x86_64) | ||||
| #define ARDUINOJSON_LITTLE_ENDIAN 1 | ||||
| #else | ||||
| #define ARDUINOJSON_LITTLE_ENDIAN 0 | ||||
|   | ||||
| @@ -9,6 +9,7 @@ | ||||
|  | ||||
| namespace ARDUINOJSON_NAMESPACE { | ||||
|  | ||||
| #if ARDUINOJSON_LITTLE_ENDIAN | ||||
| inline void fixEndianess(uint8_t *p, integral_constant<size_t, 8>) { | ||||
|   swap(p[0], p[7]); | ||||
|   swap(p[1], p[6]); | ||||
| @@ -29,10 +30,12 @@ inline void fixEndianess(uint8_t*, integral_constant<size_t, 1>) {} | ||||
|  | ||||
| template <typename T> | ||||
| inline void fixEndianess(T &value) { | ||||
| #if ARDUINOJSON_LITTLE_ENDIAN | ||||
|   fixEndianess(reinterpret_cast<uint8_t *>(&value), | ||||
|                integral_constant<size_t, sizeof(T)>()); | ||||
| #endif | ||||
| } | ||||
| #else | ||||
| template <typename T> | ||||
| inline void fixEndianess(T &) {} | ||||
| #endif | ||||
|  | ||||
| }  // namespace ARDUINOJSON_NAMESPACE | ||||
|   | ||||
		Reference in New Issue
	
	Block a user