Make it build on Android

This commit is contained in:
Zeex 2017-02-11 19:39:54 +06:00
parent 3a4878f54b
commit ca5a957bcd
2 changed files with 11 additions and 3 deletions

View File

@ -28,6 +28,10 @@ check_include_file("alloca.h" HAVE_ALLOCA_H)
if(HAVE_ALLOCA_H) if(HAVE_ALLOCA_H)
add_definitions(-DHAVE_ALLOCA_H) add_definitions(-DHAVE_ALLOCA_H)
endif() endif()
check_include_file("endian.h" HAVE_ENDIAN_H)
if(HAVE_ENDIAN_H)
add_definitions(-DHAVE_ENDIAN_H)
endif()
# check for optional library functions # check for optional library functions
include(CheckFunctionExists) include(CheckFunctionExists)

View File

@ -25,6 +25,10 @@
#define DIRECTORY_SEP_CHAR '/' #define DIRECTORY_SEP_CHAR '/'
#define DIRECTORY_SEP_STR "/" #define DIRECTORY_SEP_STR "/"
#if defined HAVE_ENDIAN_H
# include <endian.h>
#endif
/* /*
* SC assumes that a computer is Little Endian unless told otherwise. It uses * SC assumes that a computer is Little Endian unless told otherwise. It uses
* (and defines) the macros BYTE_ORDER and BIG_ENDIAN. * (and defines) the macros BYTE_ORDER and BIG_ENDIAN.