Commit 9630376
committed
py/mpconfig.h: Be stricter when autodetecting machine endianness.
This patch changes 2 things in the endianness detection:
1. Don't assume that __BYTE_ORDER__ not being __ORDER_LITTLE_ENDIAN__ means
that the machine is big endian, so add an explicit check that this macro
is indeed __ORDER_BIG_ENDIAN__ (same with __BYTE_ORDER, __LITTLE_ENDIAN
and __BIG_ENDIAN). A machine could have PDP endianness.
2. Remove the checks which base their autodetection decision on whether any
little or big endian macros are defined (eg __LITTLE_ENDIAN__ or
__BIG_ENDIAN__). Just because a system defines these does not mean it
has that endianness.
See issue adafruit#3760.1 parent 7541be5 commit 9630376
1 file changed
+6
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1256 | 1256 | | |
1257 | 1257 | | |
1258 | 1258 | | |
1259 | | - | |
| 1259 | + | |
1260 | 1260 | | |
1261 | 1261 | | |
1262 | 1262 | | |
1263 | | - | |
| 1263 | + | |
1264 | 1264 | | |
1265 | 1265 | | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | 1266 | | |
1271 | 1267 | | |
1272 | 1268 | | |
1273 | 1269 | | |
1274 | 1270 | | |
1275 | | - | |
| 1271 | + | |
1276 | 1272 | | |
1277 | 1273 | | |
1278 | | - | |
1279 | | - | |
1280 | 1274 | | |
1281 | 1275 | | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
1282 | 1279 | | |
1283 | 1280 | | |
1284 | 1281 | | |
| |||
0 commit comments