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

Re: WML under Windows...



On Sun, Jun 09, 2002 at 08:46:43PM +1000, Darryl Smith wrote:
> Sorry... The editor copied more than I thought... Anyway I am getting
> the following errors...
> 
> I have got gFont, and with a slight modification I have got all the
> other passes to run. P3 is the one that will not run. 
> 
> $ make
> gcc -g -O2 -O2 -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing
> -I/usr/local/include
> -I/usr/lib/perl5/5.6.1/cygwin-multi/CORE -I. -c eperl_perl5.c
> 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
[snip]

Hi Darryl,

could you try this patch and let me know if it works for you?

It would be wonderful if someone with good knowledge of Perl threads
could review ePerl sources.

-- 
Denis Barbier
WML Maintainer
Index: eperl_main.c
===================================================================
RCS file: /home/barbier/Projets/Wml/cvs/wml/wml_backend/p3_eperl/eperl_main.c,v
retrieving revision 1.9
diff -u -u -r1.9 eperl_main.c
--- eperl_main.c	2001/10/28 22:57:40	1.9
+++ eperl_main.c	2002/06/19 22:53:12
@@ -1051,6 +1051,10 @@
     }
     IO_redirect_stderr(er);
 
+    /*  now allocate the Perl interpreter  */
+    my_perl = perl_alloc();   
+    perl_construct(my_perl); 
+
     /*  initialise the Perl Locale environment  */
 #if AC_perl_vnum < 500400
     perl_init_i18nl14n(1); /* Perl 5.003 or lower */
@@ -1058,9 +1062,6 @@
     perl_init_i18nl10n(1); /* Perl 5.004 or higher */
 #endif
 
-    /*  now allocate the Perl interpreter  */
-    my_perl = perl_alloc();   
-    perl_construct(my_perl); 
     /* perl_destruct_level = 1; */
 
     /*  create command line...  */
@@ -1130,10 +1131,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);
Index: eperl_perl5.c
===================================================================
RCS file: /home/barbier/Projets/Wml/cvs/wml/wml_backend/p3_eperl/eperl_perl5.c,v
retrieving revision 1.12
diff -u -u -r1.12 eperl_perl5.c
--- eperl_perl5.c	2001/03/10 21:47:45	1.12
+++ eperl_perl5.c	2002/06/19 22:51:36
@@ -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)
 {
 #if AC_perl_vnum < 500476
     IoFLAGS(GvIOp(defoutgv)) |= IOf_FLUSH; /* $|=1 */
@@ -96,7 +96,7 @@
 **  sets a Perl scalar variable
 **
 */
-void Perl5_SetScalar(char *pname, char *vname, char *vvalue)
+void Perl5_SetScalar(pTHX_ char *pname, char *vname, char *vvalue)
 {
 #if AC_perl_vnum >= 500476
     dTHR;
@@ -140,7 +140,7 @@
     return;
 }
 
-void Perl5_SetRememberedScalars(void) 
+void Perl5_SetRememberedScalars(pTHX) 
 {
     char ca[1024];
     char *cp;
@@ -150,7 +150,7 @@
         strcpy(ca, Perl5_RememberedScalars[i]);
         cp = strchr(ca, '=');
         *cp++ = '\0';
-        Perl5_SetScalar("main", ca, cp);
+        Perl5_SetScalar(aTHX_ "main", ca, cp);
     }
 }
 
Index: eperl_proto.h
===================================================================
RCS file: /home/barbier/Projets/Wml/cvs/wml/wml_backend/p3_eperl/eperl_proto.h,v
retrieving revision 1.8
diff -u -u -r1.8 eperl_proto.h
--- eperl_proto.h	2001/03/10 21:47:45	1.8
+++ eperl_proto.h	2002/06/19 22:06:33
@@ -37,6 +37,8 @@
 
 /*_BEGIN_PROTO_*/
 
+#include "eperl_perl5.h"
+
 /* eperl_main.c */
 extern int mode;
 extern char *allowed_file_ext[];
@@ -58,13 +60,13 @@
 extern int main(int argc, char **argv, char **env);
 
 /* eperl_perl5.c */
-extern void Perl5_XSInit(void);
-extern void Perl5_ForceUnbufferedStdout(void);
+extern void Perl5_XSInit(pTHX);
+extern void Perl5_ForceUnbufferedStdout(pTHX);
 extern char **Perl5_SetEnvVar(char **env, char *str);
-extern void Perl5_SetScalar(char *pname, char *vname, char *vvalue);
+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(void);
+extern void Perl5_SetRememberedScalars(pTHX);
 
 /* eperl_parse.c */
 extern char *ePerl_begin_delimiter;