libc/glibc: workaround for autoconf'ed define of caddr_t
authorEsben Haabendal <eha@dev.doredevelopment.dk>
Wed Apr 06 20:15:23 2011 +0200 (2011-04-06)
changeset 2379372245834071
parent 2378 fa3c0b3cebf6
child 2380 40fe96dff39e
libc/glibc: workaround for autoconf'ed define of caddr_t

When building canadian cross compiler, I have some trouble with
configure defining caddr_t as a macro, like:
#define caddr_t char *

When combined with the types.h where caddr_t is protected together
with daddr_t, the typedef of caddr_t breaks.

This patch works around it by protecting the caddr_t typedef
specifically.

I am uncertain as to the real cause and solution to this :-(

Signed-off-by: Esben Haabendal <eha@dev.doredevelopment.dk>
patches/glibc/2.10.1/910-typedef-caddr.patch
patches/glibc/2.11.1/910-typedef-caddr.patch
patches/glibc/2.11/910-typedef-caddr.patch
patches/glibc/2.12.1/910-typedef-caddr.patch
patches/glibc/2.12.2/910-typedef-caddr.patch
patches/glibc/2.9/910-typedef-caddr.patch
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.10.1/910-typedef-caddr.patch	Wed Apr 06 20:15:23 2011 +0200
     1.3 @@ -0,0 +1,28 @@
     1.4 +diff -urN glibc-2.10.1-orig/posix/sys/types.h glibc-2.10.1/posix/sys/types.h
     1.5 +--- glibc-2.10.1-orig/posix/sys/types.h	2010-12-13 11:47:26.000000000 +0100
     1.6 ++++ glibc-2.10.1/posix/sys/types.h	2011-03-29 14:16:00.374064708 +0200
     1.7 +@@ -114,7 +114,10 @@
     1.8 + #ifdef	__USE_BSD
     1.9 + # ifndef __daddr_t_defined
    1.10 + typedef __daddr_t daddr_t;
    1.11 ++#  if ! defined(caddr_t) && ! defined(__caddr_t_defined)
    1.12 + typedef __caddr_t caddr_t;
    1.13 ++#   define __caddr_t_defined
    1.14 ++#  endif
    1.15 + #  define __daddr_t_defined
    1.16 + # endif
    1.17 + #endif
    1.18 +diff -urN glibc-2.10.1-orig/sunrpc/rpc/types.h glibc-2.10.1/sunrpc/rpc/types.h
    1.19 +--- glibc-2.10.1-orig/sunrpc/rpc/types.h	2010-12-13 11:47:26.000000000 +0100
    1.20 ++++ glibc-2.10.1/sunrpc/rpc/types.h	2011-03-29 14:16:32.988910439 +0200
    1.21 +@@ -80,7 +80,10 @@
    1.22 + #endif
    1.23 + #ifndef __daddr_t_defined
    1.24 + typedef __daddr_t daddr_t;
    1.25 ++# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
    1.26 + typedef __caddr_t caddr_t;
    1.27 ++#  define __caddr_t_defined
    1.28 ++# endif
    1.29 + # define __daddr_t_defined
    1.30 + #endif
    1.31 + 
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/patches/glibc/2.11.1/910-typedef-caddr.patch	Wed Apr 06 20:15:23 2011 +0200
     2.3 @@ -0,0 +1,28 @@
     2.4 +diff -urN glibc-2.11.1-orig/posix/sys/types.h glibc-2.11.1/posix/sys/types.h
     2.5 +--- glibc-2.11.1-orig/posix/sys/types.h	2010-12-13 11:47:26.000000000 +0100
     2.6 ++++ glibc-2.11.1/posix/sys/types.h	2011-03-29 14:16:00.374064708 +0200
     2.7 +@@ -114,7 +114,10 @@
     2.8 + #ifdef	__USE_BSD
     2.9 + # ifndef __daddr_t_defined
    2.10 + typedef __daddr_t daddr_t;
    2.11 ++#  if ! defined(caddr_t) && ! defined(__caddr_t_defined)
    2.12 + typedef __caddr_t caddr_t;
    2.13 ++#   define __caddr_t_defined
    2.14 ++#  endif
    2.15 + #  define __daddr_t_defined
    2.16 + # endif
    2.17 + #endif
    2.18 +diff -urN glibc-2.11.1-orig/sunrpc/rpc/types.h glibc-2.11.1/sunrpc/rpc/types.h
    2.19 +--- glibc-2.11.1-orig/sunrpc/rpc/types.h	2010-12-13 11:47:26.000000000 +0100
    2.20 ++++ glibc-2.11.1/sunrpc/rpc/types.h	2011-03-29 14:16:32.988910439 +0200
    2.21 +@@ -80,7 +80,10 @@
    2.22 + #endif
    2.23 + #ifndef __daddr_t_defined
    2.24 + typedef __daddr_t daddr_t;
    2.25 ++# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
    2.26 + typedef __caddr_t caddr_t;
    2.27 ++#  define __caddr_t_defined
    2.28 ++# endif
    2.29 + # define __daddr_t_defined
    2.30 + #endif
    2.31 + 
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/patches/glibc/2.11/910-typedef-caddr.patch	Wed Apr 06 20:15:23 2011 +0200
     3.3 @@ -0,0 +1,28 @@
     3.4 +diff -urN glibc-2.11-orig/posix/sys/types.h glibc-2.11/posix/sys/types.h
     3.5 +--- glibc-2.11-orig/posix/sys/types.h	2010-12-13 11:47:26.000000000 +0100
     3.6 ++++ glibc-2.11/posix/sys/types.h	2011-03-29 14:16:00.374064708 +0200
     3.7 +@@ -114,7 +114,10 @@
     3.8 + #ifdef	__USE_BSD
     3.9 + # ifndef __daddr_t_defined
    3.10 + typedef __daddr_t daddr_t;
    3.11 ++#  if ! defined(caddr_t) && ! defined(__caddr_t_defined)
    3.12 + typedef __caddr_t caddr_t;
    3.13 ++#   define __caddr_t_defined
    3.14 ++#  endif
    3.15 + #  define __daddr_t_defined
    3.16 + # endif
    3.17 + #endif
    3.18 +diff -urN glibc-2.11-orig/sunrpc/rpc/types.h glibc-2.11/sunrpc/rpc/types.h
    3.19 +--- glibc-2.11-orig/sunrpc/rpc/types.h	2010-12-13 11:47:26.000000000 +0100
    3.20 ++++ glibc-2.11/sunrpc/rpc/types.h	2011-03-29 14:16:32.988910439 +0200
    3.21 +@@ -80,7 +80,10 @@
    3.22 + #endif
    3.23 + #ifndef __daddr_t_defined
    3.24 + typedef __daddr_t daddr_t;
    3.25 ++# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
    3.26 + typedef __caddr_t caddr_t;
    3.27 ++#  define __caddr_t_defined
    3.28 ++# endif
    3.29 + # define __daddr_t_defined
    3.30 + #endif
    3.31 + 
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/patches/glibc/2.12.1/910-typedef-caddr.patch	Wed Apr 06 20:15:23 2011 +0200
     4.3 @@ -0,0 +1,28 @@
     4.4 +diff -urN glibc-2.12.1-orig/posix/sys/types.h glibc-2.12.1/posix/sys/types.h
     4.5 +--- glibc-2.12.1-orig/posix/sys/types.h	2010-12-13 11:47:26.000000000 +0100
     4.6 ++++ glibc-2.12.1/posix/sys/types.h	2011-03-29 14:16:00.374064708 +0200
     4.7 +@@ -114,7 +114,10 @@
     4.8 + #ifdef	__USE_BSD
     4.9 + # ifndef __daddr_t_defined
    4.10 + typedef __daddr_t daddr_t;
    4.11 ++#  if ! defined(caddr_t) && ! defined(__caddr_t_defined)
    4.12 + typedef __caddr_t caddr_t;
    4.13 ++#   define __caddr_t_defined
    4.14 ++#  endif
    4.15 + #  define __daddr_t_defined
    4.16 + # endif
    4.17 + #endif
    4.18 +diff -urN glibc-2.12.1-orig/sunrpc/rpc/types.h glibc-2.12.1/sunrpc/rpc/types.h
    4.19 +--- glibc-2.12.1-orig/sunrpc/rpc/types.h	2010-12-13 11:47:26.000000000 +0100
    4.20 ++++ glibc-2.12.1/sunrpc/rpc/types.h	2011-03-29 14:16:32.988910439 +0200
    4.21 +@@ -80,7 +80,10 @@
    4.22 + #endif
    4.23 + #ifndef __daddr_t_defined
    4.24 + typedef __daddr_t daddr_t;
    4.25 ++# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
    4.26 + typedef __caddr_t caddr_t;
    4.27 ++#  define __caddr_t_defined
    4.28 ++# endif
    4.29 + # define __daddr_t_defined
    4.30 + #endif
    4.31 + 
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/patches/glibc/2.12.2/910-typedef-caddr.patch	Wed Apr 06 20:15:23 2011 +0200
     5.3 @@ -0,0 +1,28 @@
     5.4 +diff -urN glibc-2.12.2-orig/posix/sys/types.h glibc-2.12.2/posix/sys/types.h
     5.5 +--- glibc-2.12.2-orig/posix/sys/types.h	2010-12-13 11:47:26.000000000 +0100
     5.6 ++++ glibc-2.12.2/posix/sys/types.h	2011-03-29 14:16:00.374064708 +0200
     5.7 +@@ -114,7 +114,10 @@
     5.8 + #ifdef	__USE_BSD
     5.9 + # ifndef __daddr_t_defined
    5.10 + typedef __daddr_t daddr_t;
    5.11 ++#  if ! defined(caddr_t) && ! defined(__caddr_t_defined)
    5.12 + typedef __caddr_t caddr_t;
    5.13 ++#   define __caddr_t_defined
    5.14 ++#  endif
    5.15 + #  define __daddr_t_defined
    5.16 + # endif
    5.17 + #endif
    5.18 +diff -urN glibc-2.12.2-orig/sunrpc/rpc/types.h glibc-2.12.2/sunrpc/rpc/types.h
    5.19 +--- glibc-2.12.2-orig/sunrpc/rpc/types.h	2010-12-13 11:47:26.000000000 +0100
    5.20 ++++ glibc-2.12.2/sunrpc/rpc/types.h	2011-03-29 14:16:32.988910439 +0200
    5.21 +@@ -80,7 +80,10 @@
    5.22 + #endif
    5.23 + #ifndef __daddr_t_defined
    5.24 + typedef __daddr_t daddr_t;
    5.25 ++# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
    5.26 + typedef __caddr_t caddr_t;
    5.27 ++#  define __caddr_t_defined
    5.28 ++# endif
    5.29 + # define __daddr_t_defined
    5.30 + #endif
    5.31 + 
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/patches/glibc/2.9/910-typedef-caddr.patch	Wed Apr 06 20:15:23 2011 +0200
     6.3 @@ -0,0 +1,28 @@
     6.4 +diff -urN glibc-2.9-orig/posix/sys/types.h glibc-2.9/posix/sys/types.h
     6.5 +--- glibc-2.9-orig/posix/sys/types.h	2010-12-13 11:47:26.000000000 +0100
     6.6 ++++ glibc-2.9/posix/sys/types.h	2011-03-29 14:16:00.374064708 +0200
     6.7 +@@ -114,7 +114,10 @@
     6.8 + #ifdef	__USE_BSD
     6.9 + # ifndef __daddr_t_defined
    6.10 + typedef __daddr_t daddr_t;
    6.11 ++#  if ! defined(caddr_t) && ! defined(__caddr_t_defined)
    6.12 + typedef __caddr_t caddr_t;
    6.13 ++#   define __caddr_t_defined
    6.14 ++#  endif
    6.15 + #  define __daddr_t_defined
    6.16 + # endif
    6.17 + #endif
    6.18 +diff -urN glibc-2.9-orig/sunrpc/rpc/types.h glibc-2.9/sunrpc/rpc/types.h
    6.19 +--- glibc-2.9-orig/sunrpc/rpc/types.h	2010-12-13 11:47:26.000000000 +0100
    6.20 ++++ glibc-2.9/sunrpc/rpc/types.h	2011-03-29 14:16:32.988910439 +0200
    6.21 +@@ -80,7 +80,10 @@
    6.22 + #endif
    6.23 + #ifndef __daddr_t_defined
    6.24 + typedef __daddr_t daddr_t;
    6.25 ++# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
    6.26 + typedef __caddr_t caddr_t;
    6.27 ++#  define __caddr_t_defined
    6.28 ++# endif
    6.29 + # define __daddr_t_defined
    6.30 + #endif
    6.31 +