File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -751,26 +751,23 @@ inline v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
751751 .Check (); \
752752 } while (0 )
753753
754- enum Endianness {
755- kLittleEndian , // _Not_ LITTLE_ENDIAN, clashes with endian.h.
756- kBigEndian
757- };
754+ enum class Endianness { LITTLE, BIG };
758755
759- inline enum Endianness GetEndianness () {
756+ inline Endianness GetEndianness () {
760757 // Constant-folded by the compiler.
761758 const union {
762759 uint8_t u8 [2 ];
763760 uint16_t u16 ;
764761 } u = {{1 , 0 }};
765- return u.u16 == 1 ? kLittleEndian : kBigEndian ;
762+ return u.u16 == 1 ? Endianness::LITTLE : Endianness::BIG ;
766763}
767764
768765inline bool IsLittleEndian () {
769- return GetEndianness () == kLittleEndian ;
766+ return GetEndianness () == Endianness::LITTLE ;
770767}
771768
772769inline bool IsBigEndian () {
773- return GetEndianness () == kBigEndian ;
770+ return GetEndianness () == Endianness::BIG ;
774771}
775772
776773// Round up a to the next highest multiple of b.
You can’t perform that action at this time.
0 commit comments