[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: BUG REPORT: Website META Language 2.0.2200007241800 (22-Jun-2000)



On Mon, Jul 24, 2000 at 10:39:44PM +0200, Rolf Herzog wrote:

> PROBLEM DESCRIPTION:
> wml 2.0.2 and higher (snapshot) doesn't compile with ActivePerl 5.6 build 616.
> The build stopped with this error message:
> 
> eperl_perl5.c: In function `Perl5_XSInit':
> eperl_perl5.c:58: `my_perl' undeclared (first use in this function)
> eperl_perl5.c:58: (Each undeclared identifier is reported only once
> eperl_perl5.c:58: for each function it appears in.)
> eperl_perl5.c:58: warning: passing arg 3 of `Perl_newXS' from incompatible pointer type
> eperl_perl5.c: In function `Perl5_ForceUnbufferedStdout':
> eperl_perl5.c:70: `my_perl' undeclared (first use in this function)
> eperl_perl5.c: In function `Perl5_SetScalar':
> eperl_perl5.c:98: `my_perl' undeclared (first use in this function)
> make[2]: *** [eperl_perl5.o] Error 1
> make[2]: Leaving directory `/usr/local/src/wml-2.0.2/wml_backend/p3_eperl'
> make[1]: *** [all] Error 1
> make[1]: Leaving directory `/usr/local/src/wml-2.0.2/wml_backend'
> make: *** [all] Error 1
> 
> After I applied this patch, all worked fine.
> 
> --- /usr/local/src/wml-2.0.2/wml_backend/p3_eperl/eperl_perl5.h Tue Jun  8 12:12
> :53 1999
> +++ eperl_perl5.h       Mon Jul 24 22:02:29 2000
> @@ -39,7 +39,8 @@
>  /*  first include the standard Perl 
>      includes designed for embedding   */
>  #include <EXTERN.h>
> -#include <perl.h>                 
> +#include <perl.h>  
> +#include <XSUB.h>               
>  #include "ppport.h"
[...]

Indeed, it works, but compilation produce warnings, and it will cause
trouble on some Perl installations.
You may try the patch below, i believe it works, but i have to slightly
modify it to make it work with all Perl flavours, which is a pain.

--- eperl_main.c	2000/07/01 15:27:02	1.4
+++ eperl_main.c	2000/07/25 22:13:14
@@ -1056,9 +1056,6 @@
     perl_construct(my_perl); 
     /* perl_destruct_level = 1; */
 
-    /*  initialise the Perl Locale environment  */
-    perl_init_i18nl10n(1); /* Macro defined in eperl_perl5.h */
-
     /*  create command line...  */
     myargc = 0;
     /*  - program name and possible -T -w options */
@@ -1126,10 +1123,10 @@
     }
 
     /*  Set the previously remembered Perl 5 scalars (option -d) */
-    Perl5_SetRememberedScalars();
+    Perl5_SetRememberedScalars(aTHX);
 
     /*  Force unbuffered I/O */
-    Perl5_ForceUnbufferedStdout();
+    Perl5_ForceUnbufferedStdout(aTHX);
 
     /*  NOW IT IS TIME to evaluate/execute the script!!! */
     rc = perl_run(my_perl);
--- eperl_perl5.c	1999/06/08 07:20:42	1.6
+++ eperl_perl5.c	2000/07/25 21:45:55
@@ -41,14 +41,14 @@
 
 #ifdef HAVE_PERL_DYNALOADER
 
-extern void boot_DynaLoader _((CV* cv));
+extern void boot_DynaLoader _((pTHX_ CV* cv));
 
 /*
 **
 **  the Perl XS init function for dynamic library loading
 **
 */
-void Perl5_XSInit(void)
+void Perl5_XSInit(pTHX)
 {
    char *file = __FILE__;
    /* dXSUB_SYS; */
@@ -64,7 +64,7 @@
 **  Force Perl to use unbuffered I/O
 **
 */
-void Perl5_ForceUnbufferedStdout(void)
+void Perl5_ForceUnbufferedStdout(pTHX)
 {
     dTHR;
     IoFLAGS(GvIOp(PL_defoutgv)) |= IOf_FLUSH; /* $|=1 */
@@ -92,13 +92,13 @@
 **  sets a Perl scalar variable
 **
 */
-void Perl5_SetScalar(char *pname, char *vname, char *vvalue)
+void Perl5_SetScalar(pTHX_ char *pname, char *vname, char *vvalue)
 {
     dTHR;
     ENTER;
     save_hptr(&PL_curstash); 
     PL_curstash = gv_stashpv(pname, TRUE);
-    sv_setpv(perl_get_sv(vname, TRUE), vvalue);
+    sv_setpv(perl_get_sv(aTHX_ vname, TRUE), vvalue);
     LEAVE;
     return;
 }
@@ -129,7 +129,7 @@
     return;
 }
 
-void Perl5_SetRememberedScalars(void) 
+void Perl5_SetRememberedScalars(pTHX) 
 {
     char ca[1024];
     char *cp;
@@ -139,7 +139,7 @@
         strcpy(ca, Perl5_RememberedScalars[i]);
         cp = strchr(ca, '=');
         *cp++ = '\0';
-        Perl5_SetScalar("main", ca, cp);
+        Perl5_SetScalar(aTHX_ "main", ca, cp);
     }
 }
 
--- eperl_perl5.h	1999/06/08 10:12:53	1.5
+++ eperl_perl5.h	2000/07/25 21:27:13
@@ -42,7 +42,25 @@
 #include <perl.h>                 
 #include "ppport.h"
 
+#ifndef aTHX
+#  define aTHX
+#  define aTHX_
+#  define pTHX void
+#  define pTHX_
+#endif
+
+/* eperl_perl5.c */
+/*  These prototypes can no longer be included in eperl_proto.h because
+    pTHX argument has been introduced in Perl 5.6.0  */
+extern void Perl5_XSInit(pTHX);
+extern void Perl5_ForceUnbufferedStdout(pTHX);
+extern char **Perl5_SetEnvVar(char **env, char *str);
+extern void Perl5_SetScalar(pTHX_ char *pname, char *vname, char *vvalue);
+extern char *Perl5_RememberedScalars[1024];
+extern void Perl5_RememberScalar(char *str);
+extern void Perl5_SetRememberedScalars(pTHX);
 
+
 /*  try to adjust for PerlIO handling  */
 #ifdef USE_PERLIO
 #undef  fwrite
@@ -65,8 +83,6 @@
 #ifndef WITH_THR
 #define PL_defoutgv defoutgv
 #endif
-
-#include "ppport.h"
 
 #endif /* EPERL_PERL5_H */
 /*EOF*/
--- eperl_proto.h	2000/07/01 15:27:02	1.3
+++ eperl_proto.h	2000/07/25 20:33:33
@@ -57,15 +57,6 @@
 extern struct option options[];
 extern int main(int argc, char **argv, char **env);
 
-/* eperl_perl5.c */
-extern void Perl5_XSInit(void);
-extern void Perl5_ForceUnbufferedStdout(void);
-extern char **Perl5_SetEnvVar(char **env, char *str);
-extern void Perl5_SetScalar(char *pname, char *vname, char *vvalue);
-extern char *Perl5_RememberedScalars[1024];
-extern void Perl5_RememberScalar(char *str);
-extern void Perl5_SetRememberedScalars(void);
-
 /* eperl_parse.c */
 extern char *ePerl_begin_delimiter;
 extern char *ePerl_end_delimiter;

-- 
Denis Barbier
WML Maintainer
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com