sclinux.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. /* getchar() is not a 'cool' replacement for MSDOS getch: Linux/unix depends on the features activated or not about the
  9. * controlling terminal's tty. This means that ioctl(2) calls must be performed, for instance to have the controlling
  10. * terminal tty's in 'raw' mode, if we want to be able to fetch a single character. This also means that everything must
  11. * be put back correctly when the function ends. See GETCH.C for an implementation.
  12. *
  13. * For interactive use of SRUN/SDBG if would be much better to use GNU's readline package: the user would be able to
  14. * have a complete emacs/vi like line editing system.
  15. */
  16. #include "getch.h"
  17. #define stricmp(a,b) strcasecmp(a,b)
  18. #define strnicmp(a,b,c) strncasecmp(a,b,c)
  19. /*
  20. * WinWorld wants '\'. Unices do not.
  21. */
  22. #define DIRECTORY_SEP_CHAR '/'
  23. #define DIRECTORY_SEP_STR "/"
  24. /*
  25. * SC assumes that a computer is Little Endian unless told otherwise. It uses
  26. * (and defines) the macros BYTE_ORDER and BIG_ENDIAN.
  27. * For Linux, we must overrule these settings with those defined in glibc.
  28. */
  29. #if !defined __BYTE_ORDER
  30. # include <stdlib.h>
  31. #endif
  32. #if defined __OpenBSD__ || defined __FreeBSD__
  33. # define __BYTE_ORDER BYTE_ORDER
  34. # define __LITTLE_ENDIAN LITTLE_ENDIAN
  35. # define __BIG_ENDIAN BIG_ENDIAN
  36. #endif
  37. #if !defined __BYTE_ORDER
  38. # error "Can't figure computer byte order (__BYTE_ORDER macro not found)"
  39. #endif
  40. #endif /* SCLINUX_H */