[cairo-commit] roadster/src db.c,1.1.1.1,1.2
Carl Worth
commit at pdx.freedesktop.org
Fri Feb 18 13:44:35 PST 2005
Committed by: cworth
Update of /cvs/cairo/roadster/src
In directory gabe:/tmp/cvs-serv31699/src
Modified Files:
db.c
Log Message:
* src/db.c:
(db_init, db_deinit): Wrap all mysql_embed-related code in #if
HAVE_MYSQL_EMBED.
Index: db.c
===================================================================
RCS file: /cvs/cairo/roadster/src/db.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- db.c 18 Feb 2005 04:22:56 -0000 1.1.1.1
+++ db.c 18 Feb 2005 21:44:33 -0000 1.2
@@ -22,10 +22,15 @@
*/
#include <mysql.h>
-#include <mysql_embed.h>
+
+#if HAVE_MYSQL_EMBED
+# include <mysql_embed.h>
+#endif
+
#include <stdlib.h>
#include <gtk/gtk.h>
#include <stdio.h>
+#include <string.h>
#include "../include/db.h"
#include "../include/mainwindow.h"
@@ -199,19 +204,23 @@
// call once on program start-up
void db_init()
{
+#if HAVE_MYSQL_EMBED
// Initialize the embedded server
// NOTE: if not linked with libmysqld, this call will do nothing (but will succeed)
if(mysql_server_init(0, NULL, NULL) != 0) {
g_print("mysql_server_init failed\n");
return;
}
+#endif
}
// call once on program shut-down
void db_deinit()
{
+#if HAVE_MYSQL_EMBED
// Close embedded server if present
mysql_server_end();
+#endif
}
/******************************************************
More information about the cairo-commit
mailing list