From ca5a957bcd18f62c5b05217c2e55754edaf183ee Mon Sep 17 00:00:00 2001 From: Zeex Date: Sat, 11 Feb 2017 19:39:54 +0600 Subject: [PATCH] Make it build on Android --- source/compiler/CMakeLists.txt | 4 ++++ source/linux/sclinux.h | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/source/compiler/CMakeLists.txt b/source/compiler/CMakeLists.txt index 92ae51a..d283922 100644 --- a/source/compiler/CMakeLists.txt +++ b/source/compiler/CMakeLists.txt @@ -28,6 +28,10 @@ check_include_file("alloca.h" HAVE_ALLOCA_H) if(HAVE_ALLOCA_H) add_definitions(-DHAVE_ALLOCA_H) endif() +check_include_file("endian.h" HAVE_ENDIAN_H) +if(HAVE_ENDIAN_H) + add_definitions(-DHAVE_ENDIAN_H) +endif() # check for optional library functions include(CheckFunctionExists) diff --git a/source/linux/sclinux.h b/source/linux/sclinux.h index 3b4af2c..79c0fad 100644 --- a/source/linux/sclinux.h +++ b/source/linux/sclinux.h @@ -7,11 +7,11 @@ #define SCLINUX_H /* getchar() is not a 'cool' replacement for MSDOS getch: Linux/unix depends on the features activated or not about the - * controlling terminal's tty. This means that ioctl(2) calls must be performed, for instance to have the controlling - * terminal tty's in 'raw' mode, if we want to be able to fetch a single character. This also means that everything must + * controlling terminal's tty. This means that ioctl(2) calls must be performed, for instance to have the controlling + * terminal tty's in 'raw' mode, if we want to be able to fetch a single character. This also means that everything must * be put back correctly when the function ends. See GETCH.C for an implementation. * - * For interactive use of SRUN/SDBG if would be much better to use GNU's readline package: the user would be able to + * For interactive use of SRUN/SDBG if would be much better to use GNU's readline package: the user would be able to * have a complete emacs/vi like line editing system. */ #include "getch.h" @@ -25,6 +25,10 @@ #define DIRECTORY_SEP_CHAR '/' #define DIRECTORY_SEP_STR "/" +#if defined HAVE_ENDIAN_H +# include +#endif + /* * SC assumes that a computer is Little Endian unless told otherwise. It uses * (and defines) the macros BYTE_ORDER and BIG_ENDIAN.