Annotation of uae/src/include/sysdeps.h, revision 1.1.1.1

1.1       root        1:  /*
                      2:   * UAE - The Un*x Amiga Emulator
                      3:   *
                      4:   * Try to include the right system headers and get other system-specific
                      5:   * stuff right.
                      6:   *
                      7:   * Copyright 1996 Bernd Schmidt
                      8:   */
                      9: 
                     10: #include <stdio.h>
                     11: #include <stdlib.h>
                     12: #include <errno.h>
                     13: #include <assert.h>
                     14: 
                     15: #ifdef HAVE_SYS_TYPES_H
                     16: #include <sys/types.h>
                     17: #endif
                     18: 
                     19: #ifdef HAVE_VALUES_H
                     20: #include <values.h>
                     21: #endif
                     22: 
                     23: #ifdef HAVE_STRINGS_H
                     24: #include <strings.h>
                     25: #endif
                     26: #ifdef HAVE_STRING_H
                     27: #include <string.h>
                     28: #endif
                     29: 
                     30: #ifdef HAVE_UNISTD_H
                     31: #include <unistd.h>
                     32: #endif
                     33: #ifdef HAVE_FCNTL_H
                     34: #include <fcntl.h>
                     35: #endif
                     36: 
                     37: #ifdef HAVE_UTIME_H
                     38: #include <utime.h>
                     39: #endif
                     40: 
                     41: #ifdef HAVE_SYS_PARAM_H
                     42: #include <sys/param.h>
                     43: #endif
                     44: 
                     45: #ifdef HAVE_SYS_SELECT_H
                     46: #include <sys/select.h>
                     47: #endif
                     48: 
                     49: #ifdef HAVE_SYS_VFS_H
                     50: #include <sys/vfs.h>
                     51: #endif
                     52: 
                     53: #ifdef HAVE_SYS_STAT_H
                     54: #include <sys/stat.h>
                     55: #endif
                     56: 
                     57: #ifdef HAVE_SYS_MOUNT_H
                     58: #include <sys/mount.h>
                     59: #endif
                     60: 
                     61: #ifdef HAVE_SYS_STATFS_H
                     62: #include <sys/statfs.h>
                     63: #endif
                     64: 
                     65: #ifdef HAVE_SYS_STATVFS_H
                     66: #include <sys/statvfs.h>
                     67: #endif
                     68: 
                     69: #if TIME_WITH_SYS_TIME
                     70: # include <sys/time.h>
                     71: # include <time.h>
                     72: #else
                     73: # if HAVE_SYS_TIME_H
                     74: #  include <sys/time.h>
                     75: # else
                     76: #  include <time.h>
                     77: # endif
                     78: #endif
                     79: 
                     80: #if HAVE_DIRENT_H
                     81: # include <dirent.h>
                     82: #else
                     83: # define dirent direct
                     84: # if HAVE_SYS_NDIR_H
                     85: #  include <sys/ndir.h>
                     86: # endif
                     87: # if HAVE_SYS_DIR_H
                     88: #  include <sys/dir.h>
                     89: # endif
                     90: # if HAVE_NDIR_H
                     91: #  include <ndir.h>
                     92: # endif
                     93: #endif
                     94: 
                     95: #include <errno.h>
                     96: #include <assert.h>
                     97: 
                     98: #if EEXIST == ENOTEMPTY
                     99: #define BROKEN_OS_PROBABLY_AIX
                    100: #endif
                    101: 
                    102: #ifdef HAVE_LINUX_JOYSTICK_H
                    103: #if BROKEN_JOYSTICK_H == 1
                    104: #include "joystick.h"
                    105: #else
                    106: #include <linux/joystick.h>
                    107: #endif
                    108: #endif
                    109: 
                    110: #ifdef __NeXT__
                    111: #define S_IRUSR S_IREAD
                    112: #define S_IWUSR S_IWRITE
                    113: #define S_IXUSR S_IEXEC
                    114: #define S_ISDIR(val) (S_IFDIR & val)
                    115: struct utimbuf
                    116: {
                    117:     time_t actime;
                    118:     time_t modtime;
                    119: };
                    120: #endif
                    121: 
                    122: #if defined(__SASC) && defined(AMIGA)
                    123: #include <sys/types.h>
                    124: #include <sys/stat.h>
                    125: #include <dirent.h>
                    126: #include <stdio.h>
                    127: #include <fcntl.h>
                    128: #include <time.h>
                    129: 
                    130: int mkdir(const char *);
                    131: int rmdir(const char *);
                    132: 
                    133: #define S_ISDIR(m)     (m & S_IFDIR)
                    134: #define S_IRUSR                ~S_IREAD
                    135: #define S_IWUSR                ~(S_IWRITE|S_IDELETE)
                    136: #define S_IXUSR                ~S_IEXECUTE
                    137: 
                    138: typedef unsigned short        mode_t;
                    139: 
                    140: #define strcasecmp stricmp
                    141: #define chip rhubarb
                    142: #endif
                    143: 
                    144: #ifdef __DOS__
                    145: #include <pc.h>
                    146: #include <io.h>
                    147: #else
                    148: #undef O_BINARY
                    149: #define O_BINARY 0
                    150: #endif
                    151: 
                    152: /* If char has more then 8 bits, good night. */
                    153: typedef unsigned char UBYTE;
                    154: typedef signed char BYTE;
                    155: typedef struct {UBYTE RGB[3];} RGB;
                    156: 
                    157: #if SIZEOF_SHORT == 2
                    158: typedef unsigned short UWORD;
                    159: typedef short WORD;
                    160: #elif SIZEOF_INT == 2
                    161: typedef unsigned int UWORD;
                    162: typedef int WORD;
                    163: #else
                    164: #error No 2 byte type, you lose.
                    165: #endif
                    166: 
                    167: #if SIZEOF_INT == 4
                    168: typedef unsigned int ULONG;
                    169: typedef int LONG;
                    170: #elif SIZEOF_LONG == 4
                    171: typedef unsigned long ULONG;
                    172: typedef long LONG;
                    173: #else
                    174: #error No 4 byte type, you lose.
                    175: #endif
                    176: typedef ULONG CPTR;
                    177: 
                    178: #undef INT_64BIT
                    179: 
                    180: #if SIZEOF_LONG_LONG == 8
                    181: #define INT_64BIT long long
                    182: #elif SIZEOF_LONG == 8
                    183: #define INT_64BIT long
                    184: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.