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

Re: wml-2.0.2 on solaris



On Mon, Aug 14, 2000 at 02:26:12PM +0200, F. Heinrichmeyer wrote:

> Hello i tried to install wml-2.0.2 on solaris (with perl-5.6):
> 
> there was a silli problem with curses, so i left out iselect ...
> but this one is more serious:
> 
> make[2]: Entering directory
> `/vu/vu-et/public/wml-2.0.2/wml_backend/p3_eperl'
> cc -O -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
> -D_FILE_OFFSET_BITS=64
> -I/usr/local/lib/perl5/5.6.0/sun4-solaris-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
> 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)
> 
> Hmmm...

Perl threads have a very changing nature, and it is very hard to write
portable code. I wrote this patch weeks ago, but it has never been
incorporated, because i am not sure it won't break compilations with
older Perl versions.

-- 
Denis Barbier
WML Maintainer
--- ORIG/wml_backend/p3_eperl/eperl_main.c	Sun Jul 30 01:34:53 2000
+++ NEW/wml_backend/p3_eperl/eperl_main.c	Wed Jul 26 00:13:14 2000
@@ -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);
--- ORIG/wml_backend/p3_eperl/eperl_perl5.c	Sun Jul 30 01:34:53 2000
+++ NEW/wml_backend/p3_eperl/eperl_perl5.c	Tue Jul 25 23:45:55 2000
@@ -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);
     }
 }
 
diff -ur ../../src/wml_backend/p3_eperl/eperl_perl5.h ./eperl_perl5.h
--- ORIG/wml_backend/p3_eperl/eperl_perl5.h	Sun Jul 30 01:34:53 2000
+++ NEW/wml_backend/p3_eperl/eperl_perl5.h	Tue Jul 25 23:27:13 2000
@@ -42,6 +42,24 @@
 #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
@@ -65,8 +83,6 @@
 #ifndef WITH_THR
 #define PL_defoutgv defoutgv
 #endif
-
-#include "ppport.h"
 
 #endif /* EPERL_PERL5_H */
 /*EOF*/
--- ORIG/wml_backend/p3_eperl/eperl_proto.h	Sun Jul 30 01:34:53 2000
+++ NEW/wml_backend/p3_eperl/eperl_proto.h	Tue Jul 25 22:33:33 2000
@@ -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;
--- ORIG/wml_backend/p3_eperl/ppport.h	Sun Jul 30 01:34:53 2000
+++ NEW/wml_backend/p3_eperl/ppport.h	Tue Jul 25 23:45:30 2000
@@ -38,9 +38,9 @@
 
 /* To verify whether ppport.h is needed for your module, and whether any
    special defines should be used, ppport.h can be run through Perl to check
-   your source code. Simply say:
+   your source code. Simply say: (quotes are to preserve C comments)
    
-   	perl -x ppport.h *.c *.h *.xs foo/*.c [etc]
+   	perl -x ppport.h *.c *.h *.xs foo"/"*.c [etc]
    
    The result will be a list of patches suggesting changes that should at
    least be acceptable, if not necessarily the most efficient solution, or a
@@ -158,7 +158,7 @@
 #define PERL_BCDVERSION ((PERL_REVISION * 0x1000000L) + (PERL_VERSION * 0x1000L) + PERL_SUBVERSION)
 
 #ifndef ERRSV
-#	define ERRSV perl_get_sv("@",FALSE)
+#	define ERRSV perl_get_sv(aTHX_ "@",FALSE)
 #endif
 
 #if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))