2015-09-30 12:03:46 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Code for endianness checking *
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file obilittlebigman.c
|
|
|
|
* @author Eric Coissac (eric.coissac@metabarcoding.org)
|
|
|
|
* @date 23 May 2015
|
|
|
|
* @brief Code endianness checking.
|
2015-05-23 11:39:00 +03:00
|
|
|
*/
|
|
|
|
|
2015-05-23 13:18:28 +03:00
|
|
|
#include "obilittlebigman.h"
|
2015-05-23 11:39:00 +03:00
|
|
|
|
2015-06-10 15:19:02 +02:00
|
|
|
|
2017-02-20 14:55:36 +01:00
|
|
|
// TODO this function does not seem to work properly
|
2015-06-10 15:19:02 +02:00
|
|
|
bool obi_is_little_endian() {
|
2015-05-23 11:39:00 +03:00
|
|
|
union { int entier;
|
|
|
|
char caractere[4] ;
|
|
|
|
} test;
|
|
|
|
|
|
|
|
test.entier=0x01020304;
|
|
|
|
|
|
|
|
return (test.caractere[3] == 1);
|
|
|
|
}
|
|
|
|
|