1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/sourcepawn/compiler/sclinux.h Thu Jan 25 20:08:00 2007 +0000
1.3 @@ -0,0 +1,47 @@
1.4 +/*
1.5 + * Things needed to compile under linux.
1.6 + *
1.7 + * Should be reworked totally to use GNU's 'configure'
1.8 + */
1.9 +#ifndef SCLINUX_H
1.10 +#define SCLINUX_H
1.11 +
1.12 +/* getchar() is not a 'cool' replacement for MSDOS getch: Linux/unix depends on the features activated or not about the
1.13 + * controlling terminal's tty. This means that ioctl(2) calls must be performed, for instance to have the controlling
1.14 + * terminal tty's in 'raw' mode, if we want to be able to fetch a single character. This also means that everything must
1.15 + * be put back correctly when the function ends. See GETCH.C for an implementation.
1.16 + *
1.17 + * For interactive use of SRUN/SDBG if would be much better to use GNU's readline package: the user would be able to
1.18 + * have a complete emacs/vi like line editing system.
1.19 + */
1.20 +#include "getch.h"
1.21 +
1.22 +#define stricmp(a,b) strcasecmp(a,b)
1.23 +#define strnicmp(a,b,c) strncasecmp(a,b,c)
1.24 +
1.25 +/*
1.26 + * WinWorld wants '\'. Unices do not.
1.27 + */
1.28 +#define DIRECTORY_SEP_CHAR '/'
1.29 +#define DIRECTORY_SEP_STR "/"
1.30 +
1.31 +/*
1.32 + * SC assumes that a computer is Little Endian unless told otherwise. It uses
1.33 + * (and defines) the macros BYTE_ORDER and BIG_ENDIAN.
1.34 + * For Linux, we must overrule these settings with those defined in glibc.
1.35 + */
1.36 +#if !defined __BYTE_ORDER
1.37 +# include <stdlib.h>
1.38 +#endif
1.39 +
1.40 +#if defined __OpenBSD__ || defined __FreeBSD__
1.41 +# define __BYTE_ORDER BYTE_ORDER
1.42 +# define __LITTLE_ENDIAN LITTLE_ENDIAN
1.43 +# define __BIG_ENDIAN BIG_ENDIAN
1.44 +#endif
1.45 +
1.46 +#if !defined __BYTE_ORDER
1.47 +# error "Can't figure computer byte order (__BYTE_ORDER macro not found)"
1.48 +#endif
1.49 +
1.50 +#endif /* SCLINUX_H */