[Bug 154718] kdemultimedia doesn't build on NetBSD
Michael Pyne
mpyne at purinchu.net
Thu Jan 3 23:12:49 GMT 2008
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=154718
mpyne purinchu net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From mpyne purinchu net 2008-01-04 00:12 -------
I've committed a fix for this as of revision 756952.
Here's the commit message and diff:
----------------
Fix bug 154718 (kdemultimedia doesn't build on NetBSD) with patches submitted by Mark Davies and tweaked a bit by myself.
Ended up simply replacing the 10 line preprocessor crap about htonl with a
simple #include <arpa/inet.h> which the Linux, NetBSD, and FreeBSD man pages
available to me all agree is where htonl is defined.
BUG:154718
-----------------
Index: plat_freebsd.c
===================================================================
--- plat_freebsd.c (revision 756951)
+++ plat_freebsd.c (revision 756952)
@ -51,17 +51,31 @
# include <sys/scsiio.h>
# include "/sys/scsi/scsi_all.h"
# include "/sys/scsi/scsi_cd.h"
+
#elif defined(__NetBSD__)
-#include <sys/scsiio.h>
-#include <dev/scsipi/scsipi_cd.h>
-#else
+
+# include <sys/scsiio.h>
+# include <dev/scsipi/scsipi_cd.h>
+
+/* Fix http://bugs.kde.org/show_bug.cgi?id=154718 by wrapping calls to removed
+ * functions with their replacements in NetBSD 3.0
+ */
+# if __NetBSD_Version__ >= 299000900 /* 2.99.9 */
+# include <sys/statvfs.h>
+# define statfs statvfs
+# define fstatfs fstatvfs
+# endif
+
+#else /* Not OpenBSD, not NetBSD, therefore (probably) FreeBSD */
+
# define LEFT_PORT 0
# define RIGHT_PORT 1
# if __FreeBSD_version < 300000
# include <scsi.h>
# endif
-#endif
+#endif /* if defined(__OpenBSD__) */
+
#include "include/wm_struct.h"
#include "include/wm_platform.h"
#include "include/wm_cdrom.h"
@ -507,5 +521,5 @
return 0;
}
-#endif
+#endif /* If FreeBSD or NetBSD */
Index: cdda.c
===================================================================
--- cdda.c (revision 756951)
+++ cdda.c (revision 756952)
@ -20,6 +20,7 @
#include <string.h>
#include <sys/poll.h>
#include <sys/wait.h>
+#include <arpa/inet.h> /* For htonl(3) */
#include <stdio.h>
#include <unistd.h>
#include "include/wm_config.h"
@ -75,20 +76,6 @
u_32 channels;
};
-/* had to change #ifdef to #if -> see wm_cdda.h */
-#ifdef __FreeBSD__
-/* Phungus not with htonl on FreeBSD */
-#include <sys/param.h>
-#else
-#if WM_BIG_ENDIAN
-# ifndef htonl
-# define htonl(x) (x)
-# endif
-#else
-extern unsigned long htonl(unsigned long);
-#endif
-#endif
-
static int cdda_status(struct wm_drive *d, int oldmode,
int *mode, int *frame, int *track, int *ind)
{
More information about the kde-multimedia
mailing list