44 |
|
#include <string.h> |
45 |
|
#include <signal.h> |
46 |
|
|
47 |
+ |
#ifdef HAVE_PTHREADS |
48 |
+ |
# include <pthread.h> |
49 |
+ |
#endif |
50 |
+ |
|
51 |
|
#ifdef HAVE_FCNTL_H |
52 |
|
# include <fcntl.h> |
53 |
|
#endif |
143 |
|
**/ |
144 |
|
|
145 |
|
#if defined(__GNUC__) |
146 |
< |
#if defined(__x86_64__) |
146 |
> |
#if defined(__x86_64__) || defined(__i386__) |
147 |
|
// Linux/AMD64 currently has no asm optimized bswap_32() in <byteswap.h> |
148 |
|
#define opt_bswap_32 do_opt_bswap_32 |
149 |
|
static inline uint32 do_opt_bswap_32(uint32 x) |
188 |
|
((x & 0x000000ff) << 24) ); |
189 |
|
} |
190 |
|
|
191 |
+ |
#if defined(__i386__) |
192 |
+ |
#define opt_bswap_64 do_opt_bswap_64 |
193 |
+ |
static inline uint64 do_opt_bswap_64(uint64 x) |
194 |
+ |
{ |
195 |
+ |
return (bswap_32(x >> 32) | (((uint64)bswap_32((uint32)x)) << 32)); |
196 |
+ |
} |
197 |
+ |
#endif |
198 |
+ |
|
199 |
|
#ifdef opt_bswap_64 |
200 |
|
#undef bswap_64 |
201 |
|
#define bswap_64 opt_bswap_64 |
360 |
|
extern uint64 GetTicks_usec(void); |
361 |
|
extern void Delay_usec(uint32 usec); |
362 |
|
|
363 |
+ |
#if defined(HAVE_PTHREADS) || (defined(__linux__) && defined(__powerpc__)) |
364 |
|
// Setup pthread attributes |
365 |
|
extern void Set_pthread_attr(pthread_attr_t *attr, int priority); |
366 |
+ |
#endif |
367 |
|
|
368 |
|
// Various definitions |
369 |
|
typedef struct rgb_color { |