The following commit has been merged in the master branch:
commit 55eb6f3163420dd14c5a9e5aadfa3b314378a187
Author: Guillem Jover <[email protected]>
Date:   Sun Oct 4 03:40:10 2009 +0200

    libcompat: Define offsetof only if the system does not have it
    
    Due to <compat.h> being included first, offsetof was being defined
    always to the local version.

diff --git a/configure.ac b/configure.ac
index feab876..52f019c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,6 +97,7 @@ DPKG_C_ATTRIBUTE
 # Checks for library functions.
 DPKG_FUNC_VA_COPY
 DPKG_FUNC_C99_SNPRINTF
+DPKG_CHECK_DECL([offsetof], [stddef.h])
 DPKG_CHECK_DECL([WCOREDUMP], [sys/wait.h])
 DPKG_CHECK_COMPAT_FUNCS([getopt getopt_long obstack_free \
                          strnlen strerror strsignal \
diff --git a/lib/compat/compat.h b/lib/compat/compat.h
index 7e99d05..c78ff65 100644
--- a/lib/compat/compat.h
+++ b/lib/compat/compat.h
@@ -3,7 +3,7 @@
  * compat.h - system compatibility declarations
  *
  * Copyright © 1995 Ian Jackson <[email protected]>
- * Copyright © 2008 Guillem Jover <[email protected]>
+ * Copyright © 2008, 2009 Guillem Jover <[email protected]>
  *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as
@@ -27,7 +27,7 @@
 extern "C" {
 #endif
 
-#ifndef offsetof
+#ifndef HAVE_OFFSETOF
 #define offsetof(st, m) ((size_t)&((st *)NULL)->m)
 #endif
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to