This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] sunrpc/rpc/types.h: Fix OS X build problem.
- From: Jia Liu <proljc at gmail dot com>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: Abdoulaye Walsimou Gaye <awg at embtoolkit dot org>, libc-alpha at sourceware dot org
- Date: Fri, 6 Sep 2013 12:00:22 +0800
- Subject: Re: [PATCH] sunrpc/rpc/types.h: Fix OS X build problem.
- Authentication-results: sourceware.org; auth=none
- References: <1378366884-29968-1-git-send-email-proljc at gmail dot com> <201309052113 dot 43854 dot vapier at gentoo dot org> <CAJBMM-taJkjusWpGabdNSa0m-wDjbY7T6VF6Dzee4F+Xb-jJbg at mail dot gmail dot com> <201309052330 dot 31744 dot vapier at gentoo dot org>
Hi Mike,
On Fri, Sep 6, 2013 at 11:30 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Thursday 05 September 2013 23:23:06 Jia Liu wrote:
>> Hi Mike,
>>
>> On Fri, Sep 6, 2013 at 9:13 AM, Mike Frysinger <vapier@gentoo.org> wrote:
>> > On Thursday 05 September 2013 09:39:00 Jia Liu wrote:
>> >> Is this code looks OK?
>> >>
>> >> #if defined ( __APPLE_CC__ ) || defined( __FreeBSD__ )
>> >> # define __u_char_defined
>> >> #endif
>>
>> I modify the code into this:
>>
>> #if defined __APPLE_CC__ || defined __FreeBSD__
>> # define __u_char_defined
>> #endif
>>
>> and made a test, it still get the same error.
>
> where did you put the code ? it should have been right above the line:
> #ifndef __u_char_defined
>
> you might have to also add in your new snippet:
> # define __daddr_t_defined
Thank you, I put
#if !defined __APPLE_CC__ && !defined __FreeBSD__
above
#ifndef __u_char_defined
will be right.
here is the code:
=============style A=============:
@@ -69,6 +69,7 @@ typedef unsigned long rpcport_t;
#include <sys/types.h>
#endif
+#if !defined __APPLE_CC__ && !defined __FreeBSD__
#ifndef __u_char_defined
typedef __u_char u_char;
typedef __u_short u_short;
@@ -79,11 +80,14 @@ typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
# define __u_char_defined
#endif
+#endif
+#if !defined __APPLE_CC__ && !defined __FreeBSD__
#ifndef __daddr_t_defined
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
# define __daddr_t_defined
#endif
+#endif
#include <sys/time.h>
#include <sys/param.h>
=============style B=============:
@@ -69,7 +69,7 @@ typedef unsigned long rpcport_t;
#include <sys/types.h>
#endif
-#ifndef __u_char_defined
+#if !defined __u_char_defined && !defined __APPLE_CC__ && !defined __FreeBSD__
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
@@ -79,7 +79,7 @@ typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
# define __u_char_defined
#endif
-#ifndef __daddr_t_defined
+#if !defined __daddr_t_defined && !defined __APPLE_CC__ && !defined __FreeBSD__
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
# define __daddr_t_defined
Which one do you prefer to?
> -mike
Regards,
Jia