[llvm-commits] CVS: llvm/include/llvm/Bytecode/Primitives.h
John Criswell
criswell at choi.cs.uiuc.edu
Wed Jun 11 14:57:04 PDT 2003
Changes in directory llvm/include/llvm/Bytecode:
Primitives.h updated: 1.8 -> 1.9
---
Log message:
Changed the LITTLE_ENDIAN and BIG_ENDIAN macros to ENDIAN_LITTLE and ENDIAN_BIG.
This will prevent them from conflicting with macros defined by the system
header files.
When autoconf comes, this will look a lot nicer.
---
Diffs of the changes:
Index: llvm/include/llvm/Bytecode/Primitives.h
diff -u llvm/include/llvm/Bytecode/Primitives.h:1.8 llvm/include/llvm/Bytecode/Primitives.h:1.9
--- llvm/include/llvm/Bytecode/Primitives.h:1.8 Tue May 6 13:45:02 2003
+++ llvm/include/llvm/Bytecode/Primitives.h Wed Jun 11 14:44:51 2003
@@ -23,7 +23,7 @@
static inline bool read(const unsigned char *&Buf, const unsigned char *EndBuf,
unsigned &Result) {
if (Buf+4 > EndBuf) return true;
-#ifdef LITTLE_ENDIAN
+#ifdef ENDIAN_LITTLE
Result = *(unsigned*)Buf;
#else
Result = Buf[0] | (Buf[1] << 8) | (Buf[2] << 16) | (Buf[3] << 24);
@@ -36,7 +36,7 @@
uint64_t &Result) {
if (Buf+8 > EndBuf) return true;
-#ifdef LITTLE_ENDIAN
+#ifdef ENDIAN_LITTLE
Result = *(uint64_t*)Buf;
#else
Result = Buf[0] | (Buf[1] << 8) | (Buf[2] << 16) | (Buf[3] << 24) |
@@ -136,7 +136,7 @@
unsigned char *Start = (unsigned char *)Ptr;
unsigned Amount = (unsigned char *)End - Start;
if (Buf+Amount > EndBuf) return true;
-#ifdef LITTLE_ENDIAN
+#ifdef ENDIAN_LITTLE
std::copy(Buf, Buf+Amount, Start);
Buf += Amount;
#else
@@ -159,7 +159,7 @@
//
static inline void output(unsigned i, std::deque<unsigned char> &Out,
int pos = -1) {
-#ifdef LITTLE_ENDIAN
+#ifdef ENDIAN_LITTLE
if (pos == -1)
Out.insert(Out.end(), (unsigned char*)&i, (unsigned char*)&i+4);
else
@@ -257,7 +257,7 @@
static inline void output_data(void *Ptr, void *End,
std::deque<unsigned char> &Out,
bool Align = false) {
-#ifdef LITTLE_ENDIAN
+#ifdef ENDIAN_LITTLE
Out.insert(Out.end(), (unsigned char*)Ptr, (unsigned char*)End);
#else
unsigned char *E = (unsigned char *)End;
More information about the llvm-commits
mailing list