equal
deleted
inserted
replaced
21 |
21 |
22 #include <stdio.h> |
22 #include <stdio.h> |
23 #include <stdlib.h> |
23 #include <stdlib.h> |
24 #include <stdint.h> |
24 #include <stdint.h> |
25 #include <stdarg.h> |
25 #include <stdarg.h> |
26 #include <syslog.h> |
|
27 #include <string.h> |
26 #include <string.h> |
28 #include <errno.h> |
27 #include <errno.h> |
29 |
28 |
30 #ifndef _WIN32 |
29 #ifndef _WIN32 |
31 #include <pthread.h> |
30 #include <pthread.h> |
|
31 #include <syslog.h> |
32 #else |
32 #else |
33 #include <process.h> |
33 #include <process.h> |
|
34 #define syslog(x,y) fprintf(stderr,y) |
|
35 #define LOG_INFO 6 |
|
36 #define LOG_ERR 3 |
34 #endif |
37 #endif |
35 |
38 |
36 #include "al.h" |
39 #include "al.h" |
37 #include "errlib.h" |
40 #include "errlib.h" |
38 |
41 |
39 |
42 |
|
43 /*control debug verbosity*/ |
40 #ifdef TRACE |
44 #ifdef TRACE |
41 #ifndef DEBUG |
45 #ifndef DEBUG |
42 #define DEBUG |
46 #define DEBUG |
43 #endif |
47 #endif |
44 #endif |
48 #endif |
65 # define msleep(t) usleep((t) * 1000) |
69 # define msleep(t) usleep((t) * 1000) |
66 # endif |
70 # endif |
67 #endif |
71 #endif |
68 #endif /* _SLEEP_H */ |
72 #endif /* _SLEEP_H */ |
69 |
73 |
|
74 |
70 /* check compiler requirements */ /*FIXME*/ |
75 /* check compiler requirements */ /*FIXME*/ |
71 #if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) |
76 #if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) |
72 #warning __BIG_ENDIAN__ or __LITTLE_ENDIAN__ not found, going to set __LITTLE_ENDIAN__ as default |
77 #warning __BIG_ENDIAN__ or __LITTLE_ENDIAN__ not found, going to set __LITTLE_ENDIAN__ as default |
73 #define __LITTLE_ENDIAN__ 1 |
78 #define __LITTLE_ENDIAN__ 1 |
74 //#error Do not know the endianess of this architecture |
79 //#error Do not know the endianess of this architecture |
79 #ifdef HAVE_BYTESWAP_H |
84 #ifdef HAVE_BYTESWAP_H |
80 #include <byteswap.h> |
85 #include <byteswap.h> |
81 #else |
86 #else |
82 #define bswap_16(x) ((((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8)) |
87 #define bswap_16(x) ((((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8)) |
83 #define bswap_32(x) ((((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | \ |
88 #define bswap_32(x) ((((x) & 0xFF000000) >> 24) | (((x) & 0x00FF0000) >> 8) | \ |
84 (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24) ) |
89 (((x) & 0x0000FF00) << 8) | (((x) & 0x000000FF) << 24) ) |
85 #endif /* HAVE_BYTESWAP_H */ |
90 #endif /* HAVE_BYTESWAP_H */ |
86 |
91 |
87 /* swap numbers accordingly to architecture automatically */ |
92 /* swap numbers accordingly to architecture automatically */ |
88 #ifdef __LITTLE_ENDIAN__ |
93 #ifdef __LITTLE_ENDIAN__ |
89 #define ENDIAN_LITTLE_32(x) x |
94 #define ENDIAN_LITTLE_32(x) x |