cvs commit: modperl-2.0/src/modules/perl modperl_perl_includes.h

2001-11-06 Thread dougm

dougm   01/11/06 19:14:54

  Modified:lib/Apache ParseSource.pm
   lib/ModPerl TypeMap.pm WrapXS.pm
   src/modules/perl modperl_perl_includes.h
  Log:
  add logic so we can avoid dTHX; usage in modperl-only functions that have a pTHX_
  
  Revision  ChangesPath
  1.32  +7 -2  modperl-2.0/lib/Apache/ParseSource.pm
  
  Index: ParseSource.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- ParseSource.pm2001/10/21 05:04:27 1.31
  +++ ParseSource.pm2001/11/07 03:14:54 1.32
  @@ -2,7 +2,7 @@
   
   use strict;
   use Apache::Build ();
  -use Config ();
  +use Config;
   
   our $VERSION = '0.02';
   
  @@ -60,7 +60,12 @@
   my $c = C::Scan->new(filename => $self->{scan_filename});
   
   $c->set(includeDirs => $self->includes);
  -$c->set(Defines => '-DCORE_PRIVATE -DMP_SOURCE_SCAN');
  +
  +my $defines = '-DCORE_PRIVATE -DMP_SOURCE_SCAN';
  +unless ($Config{useithreads} and $Config{useithreads} eq 'define') {
  +$defines .= ' -DMP_SOURCE_SCAN_NEED_ITHREADS';
  +}
  +$c->set(Defines => $defines);
   
   bless $c, 'Apache::ParseSource::Scan';
   }
  
  
  
  1.12  +18 -0 modperl-2.0/lib/ModPerl/TypeMap.pm
  
  Index: TypeMap.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TypeMap.pm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TypeMap.pm2001/10/07 19:22:49 1.11
  +++ TypeMap.pm2001/11/07 03:14:54 1.12
  @@ -194,12 +194,29 @@
   return [ map $self->map_arg($_), @$args ]
   }
   
  +#this is needed for modperl-only functions
  +#unlike apache/apr functions which are remapped to a mpxs_ function
  +sub thx_fixup {
  +my($self, $func) = @_;
  +
  +my $first = $func->{args}->[0];
  +
  +return unless $first;
  +
  +if ($first->{type} =~ /^PerlInterpreter/) {
  +shift @{ $func->{args} };
  +$func->{thx} = 1;
  +}
  +}
  +
   sub map_function {
   my($self, $func) = @_;
   
   my $map = $self->function_map->{ $func->{name} };
   return unless $map;
   
  +$self->thx_fixup($func);
  +
   return unless $self->can_map($map, $func->{return_type},
map $_->{type}, @{ $func->{args} });
   my $mf = {
  @@ -208,6 +225,7 @@
 $func->{return_type} || 'void'),
  args=> $self->map_args($func),
  perl_name   => $map->{name},
  +   thx => $func->{thx},
   };
   
   for (qw(dispatch argspec orig_args prefix)) {
  
  
  
  1.34  +2 -2  modperl-2.0/lib/ModPerl/WrapXS.pm
  
  Index: WrapXS.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/WrapXS.pm,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- WrapXS.pm 2001/10/22 17:20:11 1.33
  +++ WrapXS.pm 2001/11/07 03:14:54 1.34
  @@ -113,8 +113,8 @@
   $attrs
   EOF
   
  -if ($dispatch || $orig_args) {
  -my $thx = "";
  +if ($dispatch || $orig_args || $func->{thx}) {
  +my $thx = $func->{thx} ? 'aTHX_ ' : "";
   
   if ($dispatch) {
   $thx = 'aTHX_ ' if $dispatch =~ /^mpxs_/i;
  
  
  
  1.8   +5 -0  modperl-2.0/src/modules/perl/modperl_perl_includes.h
  
  Index: modperl_perl_includes.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_includes.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- modperl_perl_includes.h   2001/10/21 22:11:34 1.7
  +++ modperl_perl_includes.h   2001/11/07 03:14:54 1.8
  @@ -24,6 +24,11 @@
*/
   #   undef __attribute__
   #   define __attribute__(arg)
  +
  +#   ifdef MP_SOURCE_SCAN_NEED_ITHREADS
  +/* just need to have pTHX_ defined for proper prototypes */
  +#  define USE_ITHREADS
  +#   endif
   #endif
   
   #include "EXTERN.h"
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_perl_includes.h

2001-09-25 Thread dougm

dougm   01/09/25 10:30:32

  Modified:lib/Apache ParseSource.pm
   src/modules/perl modperl_perl_includes.h
  Log:
  C::Scan does not properly remove __attribute__ within
  function prototypes; so we just rip them all out via cpp
  
  Revision  ChangesPath
  1.28  +1 -1  modperl-2.0/lib/Apache/ParseSource.pm
  
  Index: ParseSource.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- ParseSource.pm2001/09/25 16:33:30 1.27
  +++ ParseSource.pm2001/09/25 17:30:31 1.28
  @@ -60,7 +60,7 @@
   my $c = C::Scan->new(filename => $self->{scan_filename});
   
   $c->set(includeDirs => $self->includes);
  -$c->set(Defines => '-DCORE_PRIVATE');
  +$c->set(Defines => '-DCORE_PRIVATE -DMP_SOURCE_SCAN');
   
   bless $c, 'Apache::ParseSource::Scan';
   }
  
  
  
  1.5   +8 -0  modperl-2.0/src/modules/perl/modperl_perl_includes.h
  
  Index: modperl_perl_includes.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_includes.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- modperl_perl_includes.h   2001/03/15 01:26:18 1.4
  +++ modperl_perl_includes.h   2001/09/25 17:30:32 1.5
  @@ -18,6 +18,14 @@
   #   define PERL_CORE
   #endif
   
  +#ifdef MP_SOURCE_SCAN
  +/* XXX: C::Scan does not properly remove __attribute__ within
  + * function prototypes; so we just rip them all out via cpp
  + */
  +#   undef __attribute__
  +#   define __attribute__(arg)
  +#endif
  +
   #include "EXTERN.h"
   #include "perl.h"
   #include "XSUB.h"
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_perl_includes.h

2001-01-21 Thread dougm

dougm   01/01/21 10:19:57

  Modified:lib/Apache Build.pm
   src/modules/perl modperl_perl_includes.h
  Log:
  make runnable with uselargefiles
  
  Revision  ChangesPath
  1.27  +11 -6 modperl-2.0/lib/Apache/Build.pm
  
  Index: Build.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- Build.pm  2001/01/04 07:23:17 1.26
  +++ Build.pm  2001/01/21 18:19:56 1.27
  @@ -23,7 +23,8 @@
   my $build = $self->build_config;
   my $apxs;
   my @trys = ($Apache::Build::APXS,
  - $build->{MP_APXS});
  +$build->{MP_APXS},
  +$ENV{MP_APXS});
   
   unless (IS_MOD_PERL_BUILD) {
#if we are building mod_perl via apxs, apxs should already be known
  @@ -120,7 +121,7 @@
   sub ccopts {
   my($self) = @_;
   
  -ExtUtils::Embed::ccopts() . $self->ap_ccopts;
  +$self->strip_lfs(ExtUtils::Embed::ccopts()) . $self->ap_ccopts;
   }
   
   sub perl_config {
  @@ -788,10 +789,14 @@
   "@includes";
   }
   
  -sub ccflags {
  -my $self = shift;
  -my $cflags = $Config{'ccflags'};
  -join ' ', $cflags, $self->apxs('-q' => 'CFLAGS');
  +#XXX:
  +sub strip_lfs {
  +my($self, $cflags) = @_;
  +return $cflags unless $Config{uselargefiles};
  +my $lf = $Config{ccflags_uselargefiles}
  +  || '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64';
  +$cflags =~ s/$lf//;
  +$cflags;
   }
   
   sub define {
  
  
  
  1.3   +12 -4 modperl-2.0/src/modules/perl/modperl_perl_includes.h
  
  Index: modperl_perl_includes.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_includes.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- modperl_perl_includes.h   2001/01/18 18:45:57 1.2
  +++ modperl_perl_includes.h   2001/01/21 18:19:56 1.3
  @@ -1,5 +1,5 @@
  -#ifndef MODPERL_PERL_INCLUDES
  -#define MODPERL_PERL_INCLUDES
  +#ifndef MODPERL_PERL_INCLUDES_H
  +#define MODPERL_PERL_INCLUDES_H
   
   /* header files for Perl */
   
  @@ -8,8 +8,16 @@
   #endif
   
   #define PERLIO_NOT_STDIO 0
  -#define PERL_CORE
   
  +/*
  + * sizeof(struct PerlInterpreter) changes #ifdef USE_LARGE_FILES
  + * apache-2.0 cannot be compiled with lfs because of sendfile.h
  + * the PERL_CORE optimization is a no-no in this case
  + */
  +#if defined(USE_ITHREADS) && !defined(USE_LARGE_FILES)
  +#   define PERL_CORE
  +#endif
  +
   #include "EXTERN.h"
   #include "perl.h"
   #include "XSUB.h"
  @@ -31,4 +39,4 @@
   #undef dNOOP
   #define dNOOP extern int __attribute__ ((unused)) Perl___notused
   
  -#endif /* MODPERL_PERL_INCLUDES */
  +#endif /* MODPERL_PERL_INCLUDES_H */
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_perl_includes.h

2001-01-18 Thread dougm

dougm   01/01/18 10:45:58

  Modified:src/modules/perl modperl_perl_includes.h
  Log:
  avoid namespace collision
  
  Revision  ChangesPath
  1.2   +8 -0  modperl-2.0/src/modules/perl/modperl_perl_includes.h
  
  Index: modperl_perl_includes.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_includes.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- modperl_perl_includes.h   2001/01/06 02:52:03 1.1
  +++ modperl_perl_includes.h   2001/01/18 18:45:57 1.2
  @@ -20,6 +20,14 @@
   #   endif
   #endif
   
  +/* avoiding namespace collisions */
  +
  +#ifdef list
  +#   undef list
  +#endif
  +
  +/* avoiding -Wall warning */
  +
   #undef dNOOP
   #define dNOOP extern int __attribute__ ((unused)) Perl___notused