perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-2.0/xs/APR/PerlIO apr_perlio.c
Date Fri, 10 Oct 2003 19:47:12 GMT
stas        2003/10/10 12:47:12

  Modified:    xs/APR/PerlIO apr_perlio.c
  Log:
  perl 5.6.x with -Duseperlio works with PerlIO*, not FILE*. prevent
  incompatible type compilation warnings, by using the right type based on
  whether perlio is enabled or not
  
  Revision  Changes    Path
  1.35      +12 -6     modperl-2.0/xs/APR/PerlIO/apr_perlio.c
  
  Index: apr_perlio.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -u -r1.34 -r1.35
  --- apr_perlio.c	22 Sep 2003 17:43:41 -0000	1.34
  +++ apr_perlio.c	10 Oct 2003 19:47:12 -0000	1.35
  @@ -516,12 +516,18 @@
                                        type);
   }
   
  -#else /* NOT PERLIO_LAYERS (5.6.1) */
  +#else /* defined(PERLIO_LAYERS) (5.6.x) */
   
  -static FILE *apr_perlio_apr_file_to_FILE(pTHX_ apr_file_t *file,
  -                                         apr_perlio_hook_e type)
  +#ifdef USE_PERLIO /* 5.6.x + -Duseperlio */
  +#define MP_IO_TYPE PerlIO
  +#else
  +#define MP_IO_TYPE FILE
  +#endif
  +
  +static MP_IO_TYPE *apr_perlio_apr_file_to_PerlIO(pTHX_ apr_file_t *file,
  +                                                 apr_perlio_hook_e type)
   {
  -    FILE *retval;
  +    MP_IO_TYPE *retval;
       char *mode;
       int fd;
       apr_os_file_t os_file;
  @@ -580,12 +586,12 @@
       switch (type) {
         case APR_PERLIO_HOOK_WRITE:
           IoIFP(GvIOp(gv)) = IoOFP(GvIOp(gv)) =
  -            apr_perlio_apr_file_to_FILE(aTHX_ file, type);
  +            apr_perlio_apr_file_to_PerlIO(aTHX_ file, type);
           IoFLAGS(GvIOp(gv)) |= IOf_FLUSH;
           IoTYPE(GvIOp(gv)) = IoTYPE_WRONLY;
           break;
         case APR_PERLIO_HOOK_READ:
  -        IoIFP(GvIOp(gv)) = apr_perlio_apr_file_to_FILE(aTHX_ file, type);
  +        IoIFP(GvIOp(gv)) = apr_perlio_apr_file_to_PerlIO(aTHX_ file, type);
           IoTYPE(GvIOp(gv)) = IoTYPE_RDONLY;
           break;
       };
  
  
  

Mime
View raw message