[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[certi-cvs] certi/libHLA HLAbasicType.hh TestHLAtypes.cc
From: |
certi-cvs |
Subject: |
[certi-cvs] certi/libHLA HLAbasicType.hh TestHLAtypes.cc |
Date: |
Tue, 18 Nov 2008 17:38:59 +0000 |
CVSROOT: /sources/certi
Module name: certi
Changes by: Petr Gotthard <gotthardp> 08/11/18 17:38:59
Modified files:
libHLA : HLAbasicType.hh TestHLAtypes.cc
Log message:
The __BYTE_ORDER variable is wrong on some systems. Use the CMake
provided value instead.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libHLA/HLAbasicType.hh?cvsroot=certi&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/certi/libHLA/TestHLAtypes.cc?cvsroot=certi&r1=1.2&r2=1.3
Patches:
Index: HLAbasicType.hh
===================================================================
RCS file: /sources/certi/certi/libHLA/HLAbasicType.hh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- HLAbasicType.hh 6 Nov 2008 22:21:24 -0000 1.3
+++ HLAbasicType.hh 18 Nov 2008 17:38:59 -0000 1.4
@@ -11,7 +11,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
-// $Id: HLAbasicType.hh,v 1.3 2008/11/06 22:21:24 erk Exp $
+// $Id: HLAbasicType.hh,v 1.4 2008/11/18 17:38:59 gotthardp Exp $
// ----------------------------------------------------------------------------
#ifndef _HLATYPES_BASICTYPE_HH
@@ -49,12 +49,10 @@
struct LittleEndian
{
inline const T operator()(const T& x) const {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- return x;
-#elif __BYTE_ORDER == __BIG_ENDIAN
+#ifdef HOST_IS_BIG_ENDIAN
return __swap<T>()( x );
#else
-#error Undefined __BYTE_ORDER
+ return x;
#endif
}
};
@@ -64,10 +62,10 @@
struct BigEndian
{
inline const T operator()(const T& x) const {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- return __swap<T>()( x );
-#elif __BYTE_ORDER == __BIG_ENDIAN
+#ifdef HOST_IS_BIG_ENDIAN
return x;
+#else
+ return __swap<T>()( x );
#endif
}
};
@@ -209,5 +207,5 @@
#endif // _HLATYPES_BASICTYPE_HH
-// $Id: HLAbasicType.hh,v 1.3 2008/11/06 22:21:24 erk Exp $
+// $Id: HLAbasicType.hh,v 1.4 2008/11/18 17:38:59 gotthardp Exp $
Index: TestHLAtypes.cc
===================================================================
RCS file: /sources/certi/certi/libHLA/TestHLAtypes.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- TestHLAtypes.cc 18 Nov 2008 16:39:02 -0000 1.2
+++ TestHLAtypes.cc 18 Nov 2008 17:38:59 -0000 1.3
@@ -11,7 +11,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
-// $Id: TestHLAtypes.cc,v 1.2 2008/11/18 16:39:02 gotthardp Exp $
+// $Id: TestHLAtypes.cc,v 1.3 2008/11/18 17:38:59 gotthardp Exp $
// ----------------------------------------------------------------------------
#include <memory>
@@ -186,12 +186,10 @@
int result = 0;
std::cerr << "Host byte-order: "
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- << "__LITTLE_ENDIAN" << std::endl;
-#elif __BYTE_ORDER == __BIG_ENDIAN
- << "__BIG_ENDIAN" << std::endl;
+#ifdef HOST_IS_BIG_ENDIAN
+ << "big-endian" << std::endl;
#else
- << "(unknown)" << std::endl;
+ << "little-endian" << std::endl;
#endif
result += test1();
@@ -203,4 +201,4 @@
return result;
}
-// $Id: TestHLAtypes.cc,v 1.2 2008/11/18 16:39:02 gotthardp Exp $
+// $Id: TestHLAtypes.cc,v 1.3 2008/11/18 17:38:59 gotthardp Exp $
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [certi-cvs] certi/libHLA HLAbasicType.hh TestHLAtypes.cc,
certi-cvs <=