SCons: Simplify Endian determination
Differential Revision: https://developer.blender.org/D252
This commit is contained in:

committed by
Thomas Dinges

parent
9896508e14
commit
eeefbbcc78
@@ -63,19 +63,8 @@ def get_hash():
|
|||||||
return build_hash
|
return build_hash
|
||||||
|
|
||||||
|
|
||||||
# copied from: http://www.scons.org/wiki/AutoconfRecipes
|
|
||||||
def checkEndian():
|
def checkEndian():
|
||||||
import struct
|
return sys.byteorder
|
||||||
array = struct.pack('cccc', '\x01', '\x02', '\x03', '\x04')
|
|
||||||
i = struct.unpack('i', array)
|
|
||||||
# Little Endian
|
|
||||||
if i == struct.unpack('<i', array):
|
|
||||||
return "little"
|
|
||||||
# Big Endian
|
|
||||||
elif i == struct.unpack('>i', array):
|
|
||||||
return "big"
|
|
||||||
else:
|
|
||||||
raise Exception("cant find endian")
|
|
||||||
|
|
||||||
|
|
||||||
# This is used in creating the local config directories
|
# This is used in creating the local config directories
|
||||||
|
Reference in New Issue
Block a user