diff --git a/mongoose.c b/mongoose.c index ae41af20..035b50bc 100644 --- a/mongoose.c +++ b/mongoose.c @@ -684,6 +684,33 @@ double cs_time() { return now; } #ifdef MG_MODULE_LINES +#line 1 "./src/../../common/cs_endian.h" +#endif +/* + * Copyright (c) 2014-2016 Cesanta Software Limited + * All rights reserved + */ + +#ifndef CS_COMMON_CS_ENDIAN_H_ +#define CS_COMMON_CS_ENDIAN_H_ + +/* + * clang with std=-c99 uses __LITTLE_ENDIAN, by default + * while for ex, RTOS gcc - LITTLE_ENDIAN, by default + * it depends on __USE_BSD, but let's have everything + */ +#if !defined(BYTE_ORDER) && defined(__BYTE_ORDER) +#define BYTE_ORDER __BYTE_ORDER +#ifndef LITTLE_ENDIAN +#define LITTLE_ENDIAN __LITTLE_ENDIAN +#endif /* LITTLE_ENDIAN */ +#ifndef BIG_ENDIAN +#define BIG_ENDIAN __LITTLE_ENDIAN +#endif /* BIG_ENDIAN */ +#endif /* BYTE_ORDER */ + +#endif /* CS_COMMON_CS_ENDIAN_H_ */ +#ifdef MG_MODULE_LINES #line 1 "./src/../../common/md5.c" #endif /*