Dan Sugalski:
# At 09:37 AM 10/24/2001 -0700, Brent Dax wrote:
# >It's probably a problem.  Configure.pl creates a macro
# >HAS_HEADER_SYSTIME in config.h--why isn't Parrot respecting it?
#
# Parrot bug. I'll go fix unless someone beats me to it.

Patch below my sig fixes this; however, after this I get another, more
insidious set of errors:





cl -O1 -MD -Z7 -DDEBUGGING -DWIN32 -D_CONSOLE -DNO_STRICT  -DPERL_IMPLIC
IT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_READFIX -I./include -o
vtable_ops.o
bj -c vtable_ops.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9254 for
80x86
Copyright (C) Microsoft Corporation 1984-2001. All rights reserved.

vtable_ops.c
vtable_ops.c(37) : error C2296: '+' : illegal, left operand has type
'add_method_t'
vtable_ops.c(43) : error C2296: '+' : illegal, left operand has type
'subtract_method_t'
vtable_ops.c(49) : error C2296: '+' : illegal, left operand has type
'multiply_method_t'
vtable_ops.c(55) : error C2296: '+' : illegal, left operand has type
'divide_method_t'
vtable_ops.c(61) : error C2296: '+' : illegal, left operand has type
'modulus_method_t'
vtable_ops.c(67) : error C2296: '+' : illegal, left operand has type
'concatenate_method_t'
NMAKE : fatal error U1077: 'cl' : return code '0x2'

I guess that's cl being picky about casts.  Changing the definition for
add_p_p_p to:

        AUTO_OP add (p, p, p) {
                ((op_func_t)((INTVAL)$2->vtable->add_1 +
(INTVAL)$3->vtable->num_type))($2,$3,$1);
        }

gets rid of its error.  I don't know how to automate that, though.  I've
looked through ops2c.pl, Parrot::Op, and Parrot::OpsFile without any
luck.

Anyway, I think the patch below will work for the first problem.  Apply
and enjoy.

--Brent Dax
[EMAIL PROTECTED]
Configure pumpking for Perl 6

When I take action, I'm not going to fire a $2 million missile at a $10
empty tent and hit a camel in the butt.
    --Dubya



--- core.ops.orig       Wed Oct 24 07:54:54 2001
+++ core.ops    Wed Oct 24 13:06:48 2001
@@ -3,8 +3,11 @@
 */

 #include <math.h>
-#include <sys/time.h>

+#ifdef HAS_HEADER_SYSTIME
+       #include <sys/time.h>
+#endif
+
 =head1 NAME

 core.ops
@@ -95,9 +98,19 @@
 =cut

 AUTO_OP time(n) {
+#ifdef HAS_HEADER_SYSTIME
+
   struct timeval t;
   gettimeofday(&t, NULL);
   $1 = (FLOATVAL)t.tv_sec + ((FLOATVAL)t.tv_usec / 1000000.0);
+
+#else
+
+  /* Win32 doesn't have gettimeofday or <sys/time.h>, so just use
normal time w/o microseconds
+     XXX Is there a Win32 equivalent to gettimeofday? */
+  $1 = (FLOATVAL)time(NULL);
+
+#endif
 }



Reply via email to