Mercurial > hg > orthanc
changeset 674:d76b747aec1b
improved check for big endianness
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 03 Dec 2013 13:50:08 +0100 |
parents | ca528c365a39 |
children | 9a8716686f18 |
files | THANKS UnitTestsSources/main.cpp |
diffstat | 2 files changed, 41 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/THANKS Tue Dec 03 12:38:22 2013 +0100 +++ b/THANKS Tue Dec 03 13:50:08 2013 +0100 @@ -11,35 +11,36 @@ Code contributors ----------------- -* Cyril Paulus (cyril.paulus@student.ulg.ac.be), for the build process +* Cyril Paulus <cyril.paulus@student.ulg.ac.be>, for the build process and suggestions about the REST API. -* Will Ryder (will.ryder@sydney.edu.au), for improvements with the +* Will Ryder <will.ryder@sydney.edu.au>, for improvements with the handling of series with temporal positions (fMRI and dynamic PET). -* Ryan Walklin (ryanwalklin@gmail.com), for Mac OS X build. -* Peter Somlo (peter.somlo@gmail.com), for ClearCanvas and JPEG support. +* Ryan Walklin <ryanwalklin@gmail.com>, for Mac OS X build. +* Peter Somlo <peter.somlo@gmail.com>, for ClearCanvas and JPEG support. * 12maksqwe@gmail.com, for fixing issue #8. * Julien Nabet, for various suggestions to improve the source code. +Debian/Ubuntu +------------- + +* Mathieu Malaterre <mathieu.malaterre@gmail.com>, for sponsoring Orthanc. +* Andreas Tille <andreas@an3as.eu>, for help about packaging. +* Adam Conrad <adconrad@debian.org>, to improve support of big endianness. + + +Fedora and Red Hat +------------------ + +* Mario Ceresa <mrceresa@gmail.com>, for help about packaging. + + Artwork ------- https://code.google.com/p/orthanc/wiki/Logos -* Benjamin Golinvaux (golinvauxb@gmail.com), for creating the official logo. -* Jean-François Degbomont (jfdegbo@gmail.com), for submitting a logo. -* Martin Jolly (martin.jolly@gmail.com), for submitting a logo. -* Philippe Sepers (sepers.philippe@gmail.com), for submitting a logo. - - -Debian ------- - -* Mathieu Malaterre (mathieu.malaterre@gmail.com), for sponsoring Orthanc. -* Andreas Tille (andreas@an3as.eu), for help about packaging. - - -Fedora and Red Hat ------------------- - -* Mario Ceresa (mrceresa@gmail.com), for help about packaging. +* Benjamin Golinvaux <golinvauxb@gmail.com>, for creating the official logo. +* Jean-François Degbomont <jfdegbo@gmail.com>, for submitting a logo. +* Martin Jolly <martin.jolly@gmail.com>, for submitting a logo. +* Philippe Sepers <sepers.philippe@gmail.com>, for submitting a logo.
--- a/UnitTestsSources/main.cpp Tue Dec 03 12:38:22 2013 +0100 +++ b/UnitTestsSources/main.cpp Tue Dec 03 13:50:08 2013 +0100 @@ -522,18 +522,33 @@ } + +#if defined(__linux) +#include <endian.h> +#endif + TEST(Toolbox, Endianness) { -#if defined(__powerpc__) || defined(__powerpc64__) - ASSERT_EQ(Endianness_Big, Toolbox::DetectEndianness()); -#endif + // Parts of this test come from Adam Conrad + // http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=728822#5 #if defined(_WIN32) ASSERT_EQ(Endianness_Little, Toolbox::DetectEndianness()); + +#elif defined(__linux) + +#if !defined(__BYTE_ORDER) +# error Support your platform here #endif -#if defined(__amd64__) || defined(__i386__) +# if __BYTE_ORDER == __BIG_ENDIAN + ASSERT_EQ(Endianness_Big, Toolbox::DetectEndianness()); +# else // __LITTLE_ENDIAN ASSERT_EQ(Endianness_Little, Toolbox::DetectEndianness()); +# endif + +#else +#error Support your platform here #endif }