source: trunk/toolchain/eglibc/patches/2.12/110-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; 
    6969#endif 
    7070 
    7171#ifndef __u_char_defined 
    72 typedef __u_char u_char; 
    73 typedef __u_short u_short; 
    74 typedef __u_int u_int; 
    75 typedef __u_long u_long; 
    76 typedef __quad_t quad_t; 
    77 typedef __u_quad_t u_quad_t; 
    78 typedef __fsid_t fsid_t; 
     72typedef unsigned char u_char; 
     73typedef unsigned short u_short; 
     74typedef unsigned int u_int; 
     75typedef unsigned long u_long; 
     76#if __WORDSIZE == 64 
     77typedef long int quad_t; 
     78typedef unsigned long int u_quad_t; 
     79#elif defined __GLIBC_HAVE_LONG_LONG 
     80typedef long long int quad_t; 
     81typedef unsigned long long int u_quad_t; 
     82#endif 
     83typedef u_quad_t fsid_t; 
    7984# define __u_char_defined 
    8085#endif 
    81 #ifndef __daddr_t_defined 
    82 typedef __daddr_t daddr_t; 
    83 typedef __caddr_t caddr_t; 
     86#if !defined(__daddr_t_defined) && defined(linux) 
     87typedef long int daddr_t; 
     88typedef char *caddr_t; 
    8489# define __daddr_t_defined 
    8590#endif 
    8691 
  • libc/sunrpc/rpc_main.c

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