4f62f8691c
from Bjorn Sandell <biorn@dce.chalmers.se> and from NetBSD
69 lines
1.6 KiB
Plaintext
69 lines
1.6 KiB
Plaintext
$OpenBSD: patch-interface_utils_h,v 1.3 2002/09/16 13:35:52 lebel Exp $
|
|
--- interface/utils.h.orig Thu Apr 20 00:41:04 2000
|
|
+++ interface/utils.h Sat Sep 7 20:59:41 2002
|
|
@@ -1,4 +1,16 @@
|
|
+#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 */
|
|
+#endif
|
|
#include <stdio.h>
|
|
#include <errno.h>
|
|
#include <string.h>
|
|
@@ -13,6 +25,7 @@ static inline int bigendianp(void){
|
|
return(1);
|
|
}
|
|
|
|
+#if !defined(__OpenBSD__)
|
|
static inline int32_t swap32(int32_t x){
|
|
return((((u_int32_t)x & 0x000000ffU) << 24) |
|
|
(((u_int32_t)x & 0x0000ff00U) << 8) |
|
|
@@ -24,6 +37,7 @@ static inline int16_t swap16(int16_t x){
|
|
return((((u_int16_t)x & 0x00ffU) << 8) |
|
|
(((u_int16_t)x & 0xff00U) >> 8));
|
|
}
|
|
+#endif /* !defined(__OpenBSD__) */
|
|
|
|
#if BYTE_ORDER == LITTLE_ENDIAN
|
|
|
|
@@ -112,6 +126,7 @@ static void cderror(cdrom_drive *d,const
|
|
break;
|
|
case CDDA_MESSAGE_FORGETIT:
|
|
default:
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
@@ -127,6 +142,7 @@ static void cdmessage(cdrom_drive *d,con
|
|
break;
|
|
case CDDA_MESSAGE_FORGETIT:
|
|
default:
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
@@ -169,6 +185,7 @@ static void idperror(int messagedest,cha
|
|
break;
|
|
case CDDA_MESSAGE_FORGETIT:
|
|
default:
|
|
+ break;
|
|
}
|
|
}
|
|
if(malloced)free(buffer);
|
|
@@ -205,6 +222,7 @@ static void idmessage(int messagedest,ch
|
|
break;
|
|
case CDDA_MESSAGE_FORGETIT:
|
|
default:
|
|
+ break;
|
|
}
|
|
}
|
|
if(malloced)free(buffer);
|