sourcepawn/compiler/sclinux.h
author David Anderson <dvander@alliedmods.net>
Thu Jan 25 22:00:15 2007 +0000 (2007-01-25)
changeset 365 d830b2b0414f
parent 353 492a8d0d5f59
child 2471 194be299b700
permissions -rw-r--r--
added Id svn:keywords property
     1 /*
     2  * Things needed to compile under linux.
     3  *
     4  * Should be reworked totally to use GNU's 'configure'
     5  */
     6 #ifndef SCLINUX_H
     7 #define SCLINUX_H
     8 
     9 /* getchar() is not a 'cool' replacement for MSDOS getch: Linux/unix depends on the features activated or not about the
    10  * controlling terminal's tty. This means that ioctl(2) calls must be performed, for instance to have the controlling 
    11  * terminal tty's in 'raw' mode, if we want to be able to fetch a single character. This also means that everything must 
    12  * be put back correctly when the function ends. See GETCH.C for an implementation.
    13  *
    14  * For interactive use of SRUN/SDBG if would be much better to use GNU's readline package: the user would be able to 
    15  * have a complete emacs/vi like line editing system.
    16  */
    17 #include "getch.h"
    18 
    19 #define	stricmp(a,b)    strcasecmp(a,b)
    20 #define	strnicmp(a,b,c) strncasecmp(a,b,c)
    21 
    22 /*
    23  * WinWorld wants '\'. Unices do not.
    24  */
    25 #define	DIRECTORY_SEP_CHAR      '/'
    26 #define	DIRECTORY_SEP_STR       "/"
    27 
    28 /*
    29  * SC assumes that a computer is Little Endian unless told otherwise. It uses
    30  * (and defines) the macros BYTE_ORDER and BIG_ENDIAN.
    31  * For Linux, we must overrule these settings with those defined in glibc.
    32  */
    33 #if !defined __BYTE_ORDER
    34 # include <stdlib.h>
    35 #endif
    36 
    37 #if defined __OpenBSD__ || defined __FreeBSD__
    38 # define __BYTE_ORDER    BYTE_ORDER
    39 # define __LITTLE_ENDIAN LITTLE_ENDIAN
    40 # define __BIG_ENDIAN    BIG_ENDIAN
    41 #endif
    42 
    43 #if !defined __BYTE_ORDER
    44 # error	"Can't figure computer byte order (__BYTE_ORDER macro not found)"
    45 #endif
    46 
    47 #endif /* SCLINUX_H */