# New Ticket Created by  Jürgen Bömmels 
# Please include the string:  [perl #23022]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=23022 >


The new timer.pmc introduces a struct timer_t. This collides with the
timer_t in /usr/include/time.h

Renaming timer_t to parrot_timer_t makes parrot compile again.


-- attachment  1 ------------------------------------------------------
url: http://rt.perl.org/rt2/attach/61177/45177/536d16/timer.diff

Index: classes/timer.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/timer.pmc,v
retrieving revision 1.2
diff -u -r1.2 timer.pmc
--- classes/timer.pmc	17 Jul 2003 06:53:07 -0000	1.2
+++ classes/timer.pmc	17 Jul 2003 09:50:29 -0000
@@ -75,7 +75,7 @@
     TIMER_STATE_FIRE
 } parrot_timer_state_t;
 
-typedef struct timer_t {
+typedef struct parrot_timer_t {
     int flags;
     int ticks;
     int value;
@@ -86,21 +86,21 @@
 	void *c_code;
     } handler;
     PMC *self;
-    struct timer_t *next;
-    struct timer_t *prev;
-} timer_t;
+    struct parrot_timer_t *next;
+    struct parrot_timer_t *prev;
+} parrot_timer_t;
 
 /* XXX next 2 should probably go into interpreter */
 /* linked list of running timers */
-static timer_t *rtimer = 0;
+static parrot_timer_t *rtimer = 0;
 /* handle of system timer */
 static void *handle = (void *) -1;
 
 /* add timer to running */
 static void
-add_timer(timer_t *t)
+add_timer(parrot_timer_t *t)
 {
-    timer_t *next = rtimer;
+    parrot_timer_t *next = rtimer;
     rtimer = t;
     t->next = next;
     if (next) {
@@ -111,9 +111,9 @@
 }
 
 static int
-timer_is_running(timer_t *tp)
+timer_is_running(parrot_timer_t *tp)
 {
-    timer_t *t;
+    parrot_timer_t *t;
     /* be paranoid, check run lis too */
     for (t = rtimer; t; t = t->next)
 	if (t == tp)
@@ -123,10 +123,10 @@
 
 /* del timer from running */
 static void
-del_timer(timer_t *t)
+del_timer(parrot_timer_t *t)
 {
-    timer_t *next = t->next;
-    timer_t *prev = t->prev;
+    parrot_timer_t *next = t->next;
+    parrot_timer_t *prev = t->prev;
 
     if (!timer_is_running(t))
 	return;
@@ -161,7 +161,7 @@
 recalc_ticks(void)
 {
     UINTVAL ms, oms;
-    timer_t *t;
+    parrot_timer_t *t;
 
     oms = get_sys_timer_ms(handle);
     t = rtimer;
@@ -206,7 +206,7 @@
 static void
 do_alarm_handler(void)
 {
-    timer_t *t;
+    parrot_timer_t *t;
     UINTVAL ms;
     int recalc = 0;
 
@@ -248,7 +248,7 @@
     }
 
     void init() {
-	timer_t *t = mem_sys_allocate_zeroed(sizeof(timer_t));
+	parrot_timer_t *t = mem_sys_allocate_zeroed(sizeof(parrot_timer_t));
 	t->state = TIMER_STATE_NEW;
 	t->self = SELF;
 	SELF->cache.struct_val = t;
@@ -288,7 +288,7 @@
     }
 
     void destroy() {
-	timer_t *t = SELF->cache.struct_val;
+	parrot_timer_t *t = SELF->cache.struct_val;
 	del_timer(t);
 	mem_sys_free(t);
     }
@@ -298,7 +298,7 @@
     }
 
     INTVAL get_integer_keyed_int(INTVAL key) {
-	timer_t *t = SELF->cache.struct_val;
+	parrot_timer_t *t = SELF->cache.struct_val;
 
 	switch(key) {
 	    case TIMER_SEC:
@@ -321,7 +321,7 @@
     }
 
     FLOATVAL get_number_keyed_int(INTVAL key) {
-	timer_t *t = SELF->cache.struct_val;
+	parrot_timer_t *t = SELF->cache.struct_val;
 
 	switch(key) {
 	    case TIMER_NSEC:
@@ -332,12 +332,12 @@
     }
 
     void set_integer_native(INTVAL value) {
-	timer_t *t = SELF->cache.struct_val;
+	parrot_timer_t *t = SELF->cache.struct_val;
 	t->handler.pasm_code = value;
     }
 
     void set_integer_keyed_int(INTVAL key, INTVAL value) {
-	timer_t *t = SELF->cache.struct_val;
+	parrot_timer_t *t = SELF->cache.struct_val;
 
 	switch(key) {
 	    case TIMER_SEC:
@@ -370,7 +370,7 @@
     }
 
     void* invoke(void *next) {
-	timer_t *t = SELF->cache.struct_val;
+	parrot_timer_t *t = SELF->cache.struct_val;
 	if (!timer_is_running(t)) {
 	    add_timer(t);
 	    recalc_ticks();
@@ -379,7 +379,7 @@
     }
 
     void set_number_keyed_int(INTVAL key, FLOATVAL value) {
-	timer_t *t = SELF->cache.struct_val;
+	parrot_timer_t *t = SELF->cache.struct_val;
 
 	switch(key) {
 	    case TIMER_NSEC:
-- 
Juergen Boemmels                        [EMAIL PROTECTED]
Fachbereich Physik                      Tel: ++49-(0)631-205-2817
Universitaet Kaiserslautern             Fax: ++49-(0)631-205-3906
PGP Key fingerprint = 9F 56 54 3D 45 C1 32 6F  23 F6 C7 2F 85 93 DD 47

Reply via email to