summaryrefslogtreecommitdiff
path: root/audio/cdparanoia/patches/patch-cc
blob: 318cdf0048bf33cd058890e4387341e82ae1d127 (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
$NetBSD: patch-cc,v 1.6 2006/09/03 17:13:30 ben Exp $

--- interface/utils.h.orig	2000-04-19 15:41:04.000000000 -0700
+++ interface/utils.h
@@ -1,4 +1,23 @@
+#ifdef __linux__
 #include <endian.h>
+#endif
+#ifdef __NetBSD__
+#include <sys/param.h>
+#if __NetBSD_Version__ >= 104010000
+#include <sys/endian.h>
+#else
+#include <machine/endian.h>
+#include <machine/bswap.h>
+#endif
+#include <err.h>	/* XXX */
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
+#include <machine/endian.h>
+#endif
+#if defined(__APPLE__) && defined(__MACH__)
+#include <stdint.h>
+#include <machine/endian.h>
+#define STDERR_FILENO 2
+#endif
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
@@ -14,15 +33,27 @@ static inline int bigendianp(void){
 }
 
 static inline int32_t swap32(int32_t x){
+#if defined(__APPLE__) && defined(__MACH__)
+  return((((uint32_t)x & 0x000000ffU) << 24) | 
+	 (((uint32_t)x & 0x0000ff00U) <<  8) | 
+	 (((uint32_t)x & 0x00ff0000U) >>  8) | 
+	 (((uint32_t)x & 0xff000000U) >> 24));
+#else
   return((((u_int32_t)x & 0x000000ffU) << 24) | 
 	 (((u_int32_t)x & 0x0000ff00U) <<  8) | 
 	 (((u_int32_t)x & 0x00ff0000U) >>  8) | 
 	 (((u_int32_t)x & 0xff000000U) >> 24));
+#endif
 }
 
 static inline int16_t swap16(int16_t x){
+#if defined(__APPLE__) && defined(__MACH__)
+  return((((uint16_t)x & 0x00ffU) <<  8) | 
+	 (((uint16_t)x & 0xff00U) >>  8));
+#else
   return((((u_int16_t)x & 0x00ffU) <<  8) | 
 	 (((u_int16_t)x & 0xff00U) >>  8));
+#endif
 }
 
 #if BYTE_ORDER == LITTLE_ENDIAN
@@ -112,6 +143,7 @@ static void cderror(cdrom_drive *d,const
       break;
     case CDDA_MESSAGE_FORGETIT:
     default:
+      break;
     }
   }
 }
@@ -127,6 +159,7 @@ static void cdmessage(cdrom_drive *d,con
       break;
     case CDDA_MESSAGE_FORGETIT:
     default:
+      break;
     }
   }
 }
@@ -169,6 +202,7 @@ static void idperror(int messagedest,cha
       break;
     case CDDA_MESSAGE_FORGETIT:
     default:
+      break;
     }
   }
   if(malloced)free(buffer);
@@ -205,6 +239,7 @@ static void idmessage(int messagedest,ch
       break;
     case CDDA_MESSAGE_FORGETIT:
     default:
+      break;
     }
   }
   if(malloced)free(buffer);