Christian Ney wrote:
Hi list!
Please forgive me if this has been addressed before, but I couldn't find
anything like that within the recent discussions:
I just talked to keanne on the IRC-channel who had problems compiling
dbmail (1.2.9) using MySQL 4.1.0-alpha as DB-backend. He couldn't
compile it cause the MySQL-headers define an extern list "list_reverse",
thats also used in the dbmail-sources (at least for 1.2.X it seems).
The error messages look like this:
/usr/local/include/mysql/my_list.h:34: error: conflicting types for
`list_reverse'
list.h:43: error: previous declaration of `list_reverse'
Looking at the 2.0-rc8-sources, I found this one is already fixed by
renaming the dbmail-struct to "dbmail_list_reverse".
In this case, I prepared a small patch for dbmail 1.2.9 that also
renames this struct within dbmail. You find it attached and additionally
online at http://linux.roothell.org/dbmail/
It worked for keanne, so perhaps this could be useful for others too.
P.S.: This is my first C-patch ever, so please be kind to me. ;)
Hi,
you're right. This has been taken care of in 2.0, not in 1.2.x. I'll fix
that right away. The cause of the problem is that the mysql library
exports the list_reverse() function. They should of course export
mysql_list_reverse()...
Expect the fix in a little while (a few hours) from now (11:00 Central
European Time)
Ilja
------------------------------------------------------------------------
diff -ruN dbmail-1.2.9.orig/imapcommands.c dbmail-1.2.9/imapcommands.c
--- dbmail-1.2.9.orig/imapcommands.c 2004-01-04 20:33:44.000000000 +0100
+++ dbmail-1.2.9/imapcommands.c 2004-09-07 09:39:22.961853262 +0200
@@ -1844,7 +1844,7 @@
}
}
- fetch_list.start = list_reverse(fetch_list.start);
+ fetch_list.start = dbmail_list_reverse(fetch_list.start);
/* now fetch results for each msg */
endptr = args[0];
diff -ruN dbmail-1.2.9.orig/list.c dbmail-1.2.9/list.c
--- dbmail-1.2.9.orig/list.c 2003-03-17 17:04:08.000000000 +0100
+++ dbmail-1.2.9/list.c 2004-09-07 09:38:11.888386534 +0200
@@ -42,11 +42,15 @@
/*
- * list_reverse()
+ * dbmail_list_reverse()
*
* reverse the order of a linked list
+ *
+ * Changed by Christian Ney
+ * renamed list_reverse to "dbmail_list_reverse
+ * to avoid conflicts with my_list.h coming from mysql
*/
-struct element* list_reverse(struct element *start)
+struct element* dbmail_list_reverse(struct element *start)
{
struct element *newstart;
@@ -56,7 +60,7 @@
if (!start->nextnode)
return start; /* nothing to reverse */
- newstart = list_reverse(start->nextnode); /* reverse rest of list */
+ newstart = dbmail_list_reverse(start->nextnode); /* reverse rest of list */
start->nextnode->nextnode = start;
start->nextnode = NULL; /* terminate list */
diff -ruN dbmail-1.2.9.orig/list.h dbmail-1.2.9/list.h
--- dbmail-1.2.9.orig/list.h 2003-03-17 17:04:08.000000000 +0100
+++ dbmail-1.2.9/list.h 2004-09-07 09:38:45.267969921 +0200
@@ -40,6 +40,11 @@
long list_totalnodes(struct list *tlist);
void list_showlist(struct list *tlist);
void list_init(struct list *tlist);
-struct element* list_reverse(struct element *start);
+ /*
+ * Changed by Christian Ney
+ * renamed list_reverse to "dbmail_list_reverse
+ * to avoid conflicts with my_list.h coming from mysql
+ */
+struct element* dbmail_list_reverse(struct element *start);
#endif
diff -ruN dbmail-1.2.9.orig/rfcmsg.c dbmail-1.2.9/rfcmsg.c
--- dbmail-1.2.9.orig/rfcmsg.c 2003-10-24 11:21:30.000000000 +0200
+++ dbmail-1.2.9/rfcmsg.c 2004-09-07 09:39:12.055623031 +0200
@@ -74,11 +74,11 @@
}
/* reverse this list */
- msg->children.start = list_reverse(msg->children.start);
+ msg->children.start = dbmail_list_reverse(msg->children.start);
/* reverse header items */
- msg->mimeheader.start = list_reverse(msg->mimeheader.start);
- msg->rfcheader.start = list_reverse(msg->rfcheader.start);
+ msg->mimeheader.start = dbmail_list_reverse(msg->mimeheader.start);
+ msg->rfcheader.start = dbmail_list_reverse(msg->rfcheader.start);
}
/*
------------------------------------------------------------------------
_______________________________________________
Dbmail mailing list
Dbmail@dbmail.org
https://mailman.fastxs.nl/mailman/listinfo/dbmail
--
Ilja Booij
IC&S B.V.
Stadhouderslaan 57
3583 JD Utrecht
www.ic-s.nl
T algemeen: 030 6355730
T direct: 030 6355739
F: 030 6355731
E: [EMAIL PROTECTED]