 |
YDLIDAR SDK
V1.3.6
|
64 #if defined(__linux__) || defined(_DARWIN) 76 typedef unsigned char uint8_t;
78 typedef unsigned short uint16_t;
79 typedef short int16_t;
80 typedef unsigned int uint32_t;
85 typedef int socklen_t;
89 typedef unsigned long long int uint64_t;
90 typedef long long int int64_t;
91 #elif (__WORDSIZE == 32) 93 typedef long long int int64_t;
95 typedef unsigned long long int uint64_t;
96 #elif (__WORDSIZE == 64) 104 #define UINT8_MAX (UCHAR_MAX) 107 #define UINT16_MAX (USHRT_MAX) 110 #define UINT32_MAX (ULONG_MAX) 114 #define SIZE_MAX (18446744073709551615UL) 117 #define SIZE_MAX (4294967295U) 123 #define ssize_t size_t 126 #define __small_endian 129 #define __attribute__(x) 142 #define htonll(x) (x) 143 #define ntohll(x) (x) 145 #define htonll(x) ((((uint64)htonl(x)) << 32) + htonl(x >> 32)) 146 #define ntohll(x) ((((uint64)ntohl(x)) << 32) + ntohl(x >> 32)) 159 #define ACCEPT(a,b,c) accept(a,b,c) 160 #define CONNECT(a,b,c) connect(a,b,c) 161 #define CLOSE(a) closesocket(a) 162 #define READ(a,b,c) read(a,b,c) 163 #define RECV(a,b,c,d) recv(a, (char *)b, c, d) 164 #define RECVFROM(a,b,c,d,e,f) recvfrom(a, (char *)b, c, d, (sockaddr *)e, (int *)f) 165 #define RECV_FLAGS MSG_WAITALL 166 #define SELECT(a,b,c,d,e) select((int32_t)a,b,c,d,e) 167 #define SEND(a,b,c,d) send(a, (const char *)b, (int)c, d) 168 #define SENDTO(a,b,c,d,e,f) sendto(a, (const char *)b, (int)c, d, e, f) 170 #define SENDFILE(a,b,c,d) sendfile(a, b, c, d) 171 #define SET_SOCKET_ERROR(x,y) errno=y 172 #define SOCKET_ERROR_INTERUPT EINTR 173 #define SOCKET_ERROR_TIMEDOUT EAGAIN 174 #define WRITE(a,b,c) write(a,b,c) 175 #define WRITEV(a,b,c) Writev(b, c) 176 #define GETSOCKOPT(a,b,c,d,e) getsockopt(a,b,c,(char *)d, (int *)e) 177 #define SETSOCKOPT(a,b,c,d,e) setsockopt(a,b,c,(char *)d, (int)e) 178 #define GETHOSTBYNAME(a) gethostbyname(a) 179 #define IOCTLSOCKET(a, b, c) ioctlsocket(a,b,(u_long*)c) 182 #if defined(__linux__) || defined(_DARWIN) 183 #define ACCEPT(a,b,c) accept(a,b,c) 184 #define CONNECT(a,b,c) connect(a,b,c) 185 #define CLOSE(a) close(a) 186 #define READ(a,b,c) read(a,b,c) 187 #define RECV(a,b,c,d) recv(a, (void *)b, c, d) 188 #define RECVFROM(a,b,c,d,e,f) recvfrom(a, (char *)b, c, d, (sockaddr *)e, f) 189 #define RECV_FLAGS MSG_WAITALL 190 #define SELECT(a,b,c,d,e) select(a,b,c,d,e) 191 #define SEND(a,b,c,d) send(a, (const int8_t *)b, c, d) 192 #define SENDTO(a,b,c,d,e,f) sendto(a, (const int8_t *)b, c, d, e, f) 194 #define SENDFILE(a,b,c,d) sendfile(a, b, c, d) 195 #define SET_SOCKET_ERROR(x,y) errno=y 196 #define SOCKET_ERROR_INTERUPT EINTR 197 #define SOCKET_ERROR_TIMEDOUT EAGAIN 198 #define WRITE(a,b,c) write(a,b,c) 199 #define WRITEV(a,b,c) writev(a, b, c) 200 #define GETSOCKOPT(a,b,c,d,e) getsockopt((int)a,(int)b,(int)c,(void *)d,(socklen_t *)e) 201 #define SETSOCKOPT(a,b,c,d,e) setsockopt((int)a,(int)b,(int)c,(const void *)d,(int)e) 202 #define GETHOSTBYNAME(a) gethostbyname(a) 203 #define IOCTLSOCKET(a, b, c) ioctl(a,b,c) 212 #define STRUCT_STAT struct stat 213 #define LSTAT(x,y) lstat(x,y) 214 #define FILE_HANDLE FILE * 215 #define CLEARERR(x) clearerr(x) 216 #define FCLOSE(x) fclose(x) 217 #define FEOF(x) feof(x) 218 #define FERROR(x) ferror(x) 219 #define FFLUSH(x) fflush(x) 220 #define FILENO(s) fileno(s) 221 #define FOPEN(x,y) fopen(x, y) 223 #define FSTAT(s, st) fstat(FILENO(s), st) 225 #define STAT_BLK_SIZE(x) ((x).st_blksize) 234 #define GET_CLOCK_COUNT(x) QueryPerformanceCounter((LARGE_INTEGER *)x) 236 #define GET_CLOCK_COUNT(x) gettimeofday(x, NULL) 240 #define STRTOULL(x) _atoi64(x) 242 #define STRTOULL(x) strtoull(x, NULL, 10) 246 #define SNPRINTF _snprintf 247 #define PRINTF printf 248 #define VPRINTF vprintf 249 #define FPRINTF fprintf 251 #define SNPRINTF snprintf 252 #define PRINTF printf 253 #define VPRINTF vprintf 254 #define FPRINTF fprintf