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

@ -7,11 +7,11 @@
#define SCLINUX_H #define SCLINUX_H
/* getchar() is not a 'cool' replacement for MSDOS getch: Linux/unix depends on the features activated or not about the /* 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 * 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 * 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. * 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. * have a complete emacs/vi like line editing system.
*/ */
#include "getch.h" #include "getch.h"
@ -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.