aboutsummaryrefslogtreecommitdiff
path: root/audio/timidity/files/patch-af
blob: c1610885e266fffa8d9501e126d5891dd1852c88 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
*** config.h.orig	Sat Jun  1 07:54:49 1996
--- config.h	Sat Sep 18 15:32:38 1999
***************
*** 217,222 ****
--- 217,238 ----
  # endif
  #endif /* linux */
  
+ #ifdef __FreeBSD__
+ #include <errno.h>
+ #include <machine/endian.h>
+ #if BYTE_ORDER == LITTLE_ENDIAN
+ #undef BIG_ENDIAN
+ #undef PDP_ENDIAN
+ #elif BYTE_ORDER == BIG_ENDIAN
+ #undef LITTLE_ENDIAN
+ #undef PDP_ENDIAN
+ #else
+ # error No valid byte sex defined
+ #endif
+ #define USE_LDEXP
+ #define PI M_PI
+ #endif
+ 
  /* Win32 on Intel machines */
  #ifdef __WIN32__
  #  define LITTLE_ENDIAN
***************
*** 254,266 ****
--- 270,292 ----
  #ifdef LITTLE_ENDIAN
  #define LE_SHORT(x) x
  #define LE_LONG(x) x
+ #if defined(__FreeBSD__) && !defined(__alpha__)
+ #define BE_SHORT(x) __byte_swap_word(x)
+ #define BE_LONG(x) __byte_swap_long(x)
+ #else
  #define BE_SHORT(x) XCHG_SHORT(x)
  #define BE_LONG(x) XCHG_LONG(x)
+ #endif
  #else
  #define BE_SHORT(x) x
  #define BE_LONG(x) x
+ #ifdef __FreeBSD__
+ #define LE_SHORT(x) __byte_swap_word(x)
+ #define LE_LONG(x) __byte_swap_long(x)
+ #else
  #define LE_SHORT(x) XCHG_SHORT(x)
  #define LE_LONG(x) XCHG_LONG(x)
+ #endif
  #endif
  
  #define MAX_AMPLIFICATION 800