Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Unified Diff: src/ots.cc

Issue 10205009: [OTS] TAG() macro for big endian (Closed) Base URL: http://ots.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ots.cc
===================================================================
--- src/ots.cc (revision 86)
+++ src/ots.cc (working copy)
@@ -82,8 +82,12 @@
};
// Use a macro instead of a function because gcc 4.4.3 creates static
-// initializers in that case. Note this macro assumes a little-endian system.
+// initializers in that case.
+#if defined(__BIG_ENDIAN__) || defined(_BIG_ENDIAN)
jfkthame 2012/04/28 09:10:46 Unfortunately, this doesn't work as intended on so
+#define TAG(d, c, b, a) (a | (b << 8) | (c << 16) | (d << 24))
+#else
#define TAG(a, b, c, d) (a | (b << 8) | (c << 16) | (d << 24))
+#endif
const struct {
uint32_t tag;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698