source: trunk/toolchain/eglibc/patches/2.13/100-fix_cross_rpcgen.patch @ 27359

Last change on this file since 27359 was 27359, checked in by nbd, 5 years ago

eglibc: fix portability issues rpcgen and zic, fixes compile on darwin

File size: 2.0 KB
  • libc/sunrpc/proto.h

    a b void add_type(int len, const char *type) 
    5656   $build's C library and $host's GLIBC.  */ 
    5757#ifdef _CROSS_RPCGEN_ 
    5858 
     59#undef stpcpy 
     60 
    5961/* Rather then defining _GNU_SOURCE before including $build's <string.h> 
    6062   we just declare stpcpy here.  */ 
    6163extern char *stpcpy (char *, const char *); 
    6264 
    63 /* Use $build's i18n support as we can't use $host's.  */ 
    64 #define _(X) (gettext (X)) 
     65/* Do not use i18n support  */ 
     66#define _(X) (X) 
    6567 
    6668/* rpcgen sources check for __GNU_LIBRARY__ to tweak for GLIBC code 
    6769   that rpcgen generates.  The proper fix would be to rename all those checks 
  • libc/sunrpc/rpc/types.h

    a b typedef unsigned long rpcport_t; 
    7070#endif 
    7171 
    7272#ifndef __u_char_defined 
    73 typedef __u_char u_char; 
    74 typedef __u_short u_short; 
    75 typedef __u_int u_int; 
    76 typedef __u_long u_long; 
    77 typedef __quad_t quad_t; 
    78 typedef __u_quad_t u_quad_t; 
    79 typedef __fsid_t fsid_t; 
     73typedef unsigned char u_char; 
     74typedef unsigned short u_short; 
     75typedef unsigned int u_int; 
     76typedef unsigned long u_long; 
     77#if __WORDSIZE == 64 
     78typedef long int quad_t; 
     79typedef unsigned long int u_quad_t; 
     80#elif defined __GLIBC_HAVE_LONG_LONG 
     81typedef long long int quad_t; 
     82typedef unsigned long long int u_quad_t; 
     83#endif 
     84typedef u_quad_t fsid_t; 
    8085# define __u_char_defined 
    8186#endif 
    82 #ifndef __daddr_t_defined 
    83 typedef __daddr_t daddr_t; 
    84 typedef __caddr_t caddr_t; 
     87#if !defined(__daddr_t_defined) && defined(linux) 
     88typedef long int daddr_t; 
     89typedef char *caddr_t; 
    8590# define __daddr_t_defined 
    8691#endif 
    8792 
  • libc/sunrpc/rpc_main.c

    a b mkfile_output (struct commandline *cmd) 
    997997        abort (); 
    998998      temp = rindex (cmd->infile, '.'); 
    999999      cp = stpcpy (mkfilename, "Makefile."); 
    1000       if (temp != NULL) 
    1001         *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0'; 
    1002       else 
     1000      if (temp != NULL) { 
     1001        strncpy(cp, cmd->infile, temp - cmd->infile); 
     1002        cp[temp - cmd->infile - 1] = 0; 
     1003      } else 
    10031004        stpcpy (cp, cmd->infile); 
    10041005 
    10051006    } 
Note: See TracBrowser for help on using the repository browser.