| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | #ifdef WIN32 |
|---|
| 14 | #ifndef _CONFIG_WIN32_H |
|---|
| 15 | #define _CONFIG_WIN32_H |
|---|
| 16 | |
|---|
| 17 | #include <process.h> |
|---|
| 18 | #include <malloc.h> |
|---|
| 19 | #include <stdio.h> |
|---|
| 20 | #include <memory.h> |
|---|
| 21 | #include <errno.h> |
|---|
| 22 | #include <math.h> |
|---|
| 23 | #include <stdlib.h> |
|---|
| 24 | #include <string.h> |
|---|
| 25 | #ifndef MUSICA_IPV6 |
|---|
| 26 | #include <winsock2.h> |
|---|
| 27 | #endif |
|---|
| 28 | |
|---|
| 29 | #ifdef HAVE_IPv6 |
|---|
| 30 | #ifdef MUSICA_IPV6 |
|---|
| 31 | #include <winsock6.h> |
|---|
| 32 | #else |
|---|
| 33 | #include <ws2ip6.h> |
|---|
| 34 | #endif |
|---|
| 35 | |
|---|
| 36 | #endif |
|---|
| 37 | #ifndef MUSICA_IPV6 |
|---|
| 38 | #include <ws2tcpip.h> |
|---|
| 39 | #endif |
|---|
| 40 | |
|---|
| 41 | #include <mmreg.h> |
|---|
| 42 | #include <msacm.h> |
|---|
| 43 | #include <mmsystem.h> |
|---|
| 44 | #include <windows.h> |
|---|
| 45 | #include <io.h> |
|---|
| 46 | #include <process.h> |
|---|
| 47 | #include <fcntl.h> |
|---|
| 48 | #include <time.h> |
|---|
| 49 | |
|---|
| 50 | typedef int ttl_t; |
|---|
| 51 | typedef unsigned fd_t; |
|---|
| 52 | typedef unsigned char byte; |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | typedef u_char uint8_t; |
|---|
| 59 | typedef u_short uint16_t; |
|---|
| 60 | typedef u_long uint32_t; |
|---|
| 61 | typedef char int8_t; |
|---|
| 62 | typedef short int16_t; |
|---|
| 63 | typedef long int32_t; |
|---|
| 64 | typedef __int64 int64_t; |
|---|
| 65 | typedef unsigned long in_addr_t; |
|---|
| 66 | |
|---|
| 67 | #ifndef TRUE |
|---|
| 68 | #define FALSE 0 |
|---|
| 69 | #define TRUE 1 |
|---|
| 70 | #endif |
|---|
| 71 | |
|---|
| 72 | #define USERNAMELEN 8 |
|---|
| 73 | #define WORDS_SMALLENDIAN 1 |
|---|
| 74 | |
|---|
| 75 | #define NEED_INET_ATON |
|---|
| 76 | |
|---|
| 77 | #include <time.h> |
|---|
| 78 | #include "audio_types.h" |
|---|
| 79 | #include "usleep.h" |
|---|
| 80 | |
|---|
| 81 | #define srand48 lbl_srandom |
|---|
| 82 | #define lrand48 lbl_random |
|---|
| 83 | |
|---|
| 84 | #ifdef NDEBUG |
|---|
| 85 | #define assert(x) if ((x) == 0) fprintf(stderr, "%s:%u: failed assertion\n", __FILE__, __LINE__) |
|---|
| 86 | #else |
|---|
| 87 | #include <assert.h> |
|---|
| 88 | #endif |
|---|
| 89 | |
|---|
| 90 | #define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000) |
|---|
| 91 | #define IN_MULTICAST(i) IN_CLASSD(i) |
|---|
| 92 | |
|---|
| 93 | typedef char *caddr_t; |
|---|
| 94 | typedef int ssize_t; |
|---|
| 95 | |
|---|
| 96 | typedef struct iovec { |
|---|
| 97 | caddr_t iov_base; |
|---|
| 98 | ssize_t iov_len; |
|---|
| 99 | } iovec_t; |
|---|
| 100 | |
|---|
| 101 | struct msghdr { |
|---|
| 102 | caddr_t msg_name; |
|---|
| 103 | int msg_namelen; |
|---|
| 104 | struct iovec *msg_iov; |
|---|
| 105 | int msg_iovlen; |
|---|
| 106 | caddr_t msg_accrights; |
|---|
| 107 | int msg_accrightslen; |
|---|
| 108 | }; |
|---|
| 109 | |
|---|
| 110 | #define MAXHOSTNAMELEN 256 |
|---|
| 111 | |
|---|
| 112 | #define _SYS_NMLN 9 |
|---|
| 113 | struct utsname { |
|---|
| 114 | char sysname[_SYS_NMLN]; |
|---|
| 115 | char nodename[_SYS_NMLN]; |
|---|
| 116 | char release[_SYS_NMLN]; |
|---|
| 117 | char version[_SYS_NMLN]; |
|---|
| 118 | char machine[_SYS_NMLN]; |
|---|
| 119 | }; |
|---|
| 120 | |
|---|
| 121 | struct timezone { |
|---|
| 122 | int tz_minuteswest; |
|---|
| 123 | int tz_dsttime; |
|---|
| 124 | }; |
|---|
| 125 | |
|---|
| 126 | typedef DWORD pid_t; |
|---|
| 127 | typedef DWORD uid_t; |
|---|
| 128 | typedef DWORD gid_t; |
|---|
| 129 | |
|---|
| 130 | #if defined(__cplusplus) |
|---|
| 131 | extern "C" { |
|---|
| 132 | #endif |
|---|
| 133 | |
|---|
| 134 | int uname(struct utsname *); |
|---|
| 135 | int getopt(int, char * const *, const char *); |
|---|
| 136 | int strncasecmp(const char *, const char*, int len); |
|---|
| 137 | int srandom(int); |
|---|
| 138 | int random(void); |
|---|
| 139 | double drand48(); |
|---|
| 140 | int gettimeofday(struct timeval *p, struct timezone *z); |
|---|
| 141 | unsigned long gethostid(void); |
|---|
| 142 | uid_t getuid(void); |
|---|
| 143 | gid_t getgid(void); |
|---|
| 144 | int getpid(void); |
|---|
| 145 | int nice(int); |
|---|
| 146 | int usleep(unsigned int); |
|---|
| 147 | time_t time(time_t *); |
|---|
| 148 | |
|---|
| 149 | const char * w32_make_version_info(char * rat_verion); |
|---|
| 150 | |
|---|
| 151 | #define strcasecmp _stricmp |
|---|
| 152 | #define strncasecmp _strnicmp |
|---|
| 153 | |
|---|
| 154 | int RegGetValue(HKEY *, char *, char*, char*, int); |
|---|
| 155 | void ShowMessage(int level, char *msg); |
|---|
| 156 | |
|---|
| 157 | #define bcopy(from,to,len) memcpy(to,from,len) |
|---|
| 158 | |
|---|
| 159 | #if defined(__cplusplus) |
|---|
| 160 | } |
|---|
| 161 | #endif |
|---|
| 162 | |
|---|
| 163 | #define ECONNREFUSED WSAECONNREFUSED |
|---|
| 164 | #define ENETUNREACH WSAENETUNREACH |
|---|
| 165 | #define EHOSTUNREACH WSAEHOSTUNREACH |
|---|
| 166 | #define EWOULDBLOCK WSAEWOULDBLOCK |
|---|
| 167 | |
|---|
| 168 | #define M_PI 3.14159265358979323846 |
|---|
| 169 | |
|---|
| 170 | #endif |
|---|
| 171 | #endif |
|---|