--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: __unused in libbsd. workaround for #522773 (linux) and #522774 (libc)
- From: Robert Millan <rmh@debian.org>
- Date: Sat, 25 Jun 2011 19:06:48 +0200
- Message-id: <20110625170648.25899.5914.reportbug@aybabtu.com>
Package: libbsd-dev
Version: 0.3.0-1
Severity: wishlist
Tags: patch
User: debian-bsd@lists.debian.org
Usertags: kfreebsd
This patch implements a workaround for __unused name collision with Linux and
Glibc. The trick is to define __unused only when in overlay mode, and then
provide replacements for broken headers using the overlay.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: kfreebsd-amd64 (x86_64)
Kernel: kFreeBSD 8.2-1-amd64
Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libbsd-dev depends on:
ii libbsd0 0.3.0-1 utility functions from BSD systems
libbsd-dev recommends no packages.
libbsd-dev suggests no packages.
-- no debconf information
diff -Nur libbsd-0.3.0/include/bsd/aio.h libbsd-0.3.0.new/include/bsd/aio.h
--- libbsd-0.3.0/include/bsd/aio.h 1970-01-01 01:00:00.000000000 +0100
+++ libbsd-0.3.0.new/include/bsd/aio.h 2011-06-25 18:54:20.398388435 +0200
@@ -0,0 +1,3 @@
+#undef __unused
+#include_next <aio.h>
+#include <sys/cdefs.h>
diff -Nur libbsd-0.3.0/include/bsd/asm/stat.h libbsd-0.3.0.new/include/bsd/asm/stat.h
--- libbsd-0.3.0/include/bsd/asm/stat.h 1970-01-01 01:00:00.000000000 +0100
+++ libbsd-0.3.0.new/include/bsd/asm/stat.h 2011-06-25 18:58:50.515051926 +0200
@@ -0,0 +1,3 @@
+#undef __unused
+#include_next <asm/stat.h>
+#include <sys/cdefs.h>
diff -Nur libbsd-0.3.0/include/bsd/bits/stat.h libbsd-0.3.0.new/include/bsd/bits/stat.h
--- libbsd-0.3.0/include/bsd/bits/stat.h 1970-01-01 01:00:00.000000000 +0100
+++ libbsd-0.3.0.new/include/bsd/bits/stat.h 2011-06-25 18:54:20.398388435 +0200
@@ -0,0 +1,3 @@
+#undef __unused
+#include_next <bits/stat.h>
+#include <sys/cdefs.h>
diff -Nur libbsd-0.3.0/include/bsd/bits/utmp.h libbsd-0.3.0.new/include/bsd/bits/utmp.h
--- libbsd-0.3.0/include/bsd/bits/utmp.h 1970-01-01 01:00:00.000000000 +0100
+++ libbsd-0.3.0.new/include/bsd/bits/utmp.h 2011-06-25 18:54:20.398388435 +0200
@@ -0,0 +1,3 @@
+#undef __unused
+#include_next <bits/utmp.h>
+#include <sys/cdefs.h>
diff -Nur libbsd-0.3.0/include/bsd/bits/utmpx.h libbsd-0.3.0.new/include/bsd/bits/utmpx.h
--- libbsd-0.3.0/include/bsd/bits/utmpx.h 1970-01-01 01:00:00.000000000 +0100
+++ libbsd-0.3.0.new/include/bsd/bits/utmpx.h 2011-06-25 18:54:20.398388435 +0200
@@ -0,0 +1,3 @@
+#undef __unused
+#include_next <bits/utmpx.h>
+#include <sys/cdefs.h>
diff -Nur libbsd-0.3.0/include/bsd/linux/icmp.h libbsd-0.3.0.new/include/bsd/linux/icmp.h
--- libbsd-0.3.0/include/bsd/linux/icmp.h 1970-01-01 01:00:00.000000000 +0100
+++ libbsd-0.3.0.new/include/bsd/linux/icmp.h 2011-06-25 18:58:53.870548764 +0200
@@ -0,0 +1,3 @@
+#undef __unused
+#include_next <linux/icmp.h>
+#include <sys/cdefs.h>
diff -Nur libbsd-0.3.0/include/bsd/linux/sysctl.h libbsd-0.3.0.new/include/bsd/linux/sysctl.h
--- libbsd-0.3.0/include/bsd/linux/sysctl.h 1970-01-01 01:00:00.000000000 +0100
+++ libbsd-0.3.0.new/include/bsd/linux/sysctl.h 2011-06-25 18:58:58.855057851 +0200
@@ -0,0 +1,3 @@
+#undef __unused
+#include_next <linux/sysctl.h>
+#include <sys/cdefs.h>
diff -Nur libbsd-0.3.0/include/bsd/netdb.h libbsd-0.3.0.new/include/bsd/netdb.h
--- libbsd-0.3.0/include/bsd/netdb.h 1970-01-01 01:00:00.000000000 +0100
+++ libbsd-0.3.0.new/include/bsd/netdb.h 2011-06-25 18:54:20.398388435 +0200
@@ -0,0 +1,3 @@
+#undef __unused
+#include_next <netdb.h>
+#include <sys/cdefs.h>
diff -Nur libbsd-0.3.0/include/bsd/sys/cdefs.h libbsd-0.3.0.new/include/bsd/sys/cdefs.h
--- libbsd-0.3.0/include/bsd/sys/cdefs.h 2011-05-28 10:58:26.000000000 +0200
+++ libbsd-0.3.0.new/include/bsd/sys/cdefs.h 2011-06-25 19:01:26.494054843 +0200
@@ -24,9 +24,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LIBBSD_SYS_CDEFS_H
-#define LIBBSD_SYS_CDEFS_H
-
#ifdef LIBBSD_OVERLAY
#include_next <sys/cdefs.h>
#else
@@ -43,11 +40,13 @@
#define _SYS_CDEFS_H
#endif
+#ifndef LIBBSD_GCC_VERSION
#ifdef __GNUC__
#define LIBBSD_GCC_VERSION (__GNUC__ << 8 | __GNUC_MINOR__)
#else
#define LIBBSD_GCC_VERSION 0
#endif
+#endif
#ifndef __dead2
# if LIBBSD_GCC_VERSION >= 0x0207
@@ -83,8 +82,8 @@
/* Linux headers define a struct with a member names __unused.
* Debian bugs: #522773 (linux), #522774 (libc).
- * Disable for now. */
-#if 0
+ * Enable only in overlay mode, where this can be worked around. */
+#ifdef LIBBSD_OVERLAY
#ifndef __unused
# if LIBBSD_GCC_VERSION >= 0x0300
# define __unused __attribute__((unused))
@@ -137,5 +136,3 @@
#ifndef __COPYRIGHT
# define __COPYRIGHT(x)
#endif
-
-#endif
--- End Message ---