Changeset - 7664202b38dc
[Not reviewed]
0 5 0
Jan Kaluza - 14 years ago 2011-09-07 14:19:10
hanzz.k@gmail.com
Allow compilation without sqlite/mysql
5 files changed with 22 insertions and 3 deletions:
0 comments (0 inline, 0 general)
include/transport/mysqlbackend.h
Show inline comments
 
@@ -20,6 +20,8 @@
 

	
 
#pragma once
 

	
 
#ifdef WITH_MYSQL
 

	
 
#include <string>
 
#include <map>
 
#include "Swiften/Swiften.h"
 
@@ -147,3 +149,5 @@ class MySQLBackend : public StorageBackend
 
};
 

	
 
}
 

	
 
#endif
include/transport/sqlite3backend.h
Show inline comments
 
@@ -20,6 +20,8 @@
 

	
 
#pragma once
 

	
 
#ifdef WITH_SQLITE
 

	
 
#include <string>
 
#include <map>
 
#include "Swiften/Swiften.h"
 
@@ -115,3 +117,5 @@ class SQLite3Backend : public StorageBackend
 
};
 

	
 
}
 

	
 
#endif
spectrum/src/main.cpp
Show inline comments
 
@@ -107,6 +107,7 @@ int main(int argc, char **argv)
 
 
	StorageBackend *storageBackend = NULL;
 
 
#ifdef WITH_SQLITE
 
	if (CONFIG_STRING(&config, "database.type") == "sqlite3") {
 
		storageBackend = new SQLite3Backend(&config);
 
		if (!storageBackend->connect()) {
 
@@ -114,15 +115,17 @@ int main(int argc, char **argv)
 
			return -1;
 
		}
 
	}
 
/*
 
	else if (CONFIG_STRING(&config, "database.type") == "mysql") {
 
#endif
 
#ifdef WITH_MYSQL
 
	if (CONFIG_STRING(&config, "database.type") == "mysql") {
 
		storageBackend = new MySQLBackend(&config);
 
		if (!storageBackend->connect()) {
 
			std::cerr << "Can't connect to database.\n";
 
			return -1;
 
		}
 
	}
 
*/
 
#endif
 
 
	UserManager userManager(&transport, &userRegistry, storageBackend);
 
	UserRegistration *userRegistration = NULL;
 
	if (storageBackend) {
src/mysqlbackend.cpp
Show inline comments
 
@@ -18,6 +18,8 @@
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
 
 */
 

	
 
#ifdef WITH_MYSQL
 

	
 
#include "transport/mysqlbackend.h"
 
#include <boost/bind.hpp>
 
#include "log4cxx/logger.h"
 
@@ -468,3 +470,5 @@ void MySQLBackend::commitTransaction() {
 
}
 

	
 
}
 

	
 
#endif
src/sqlite3backend.cpp
Show inline comments
 
@@ -18,6 +18,8 @@
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
 
 */
 

	
 
#ifdef WITH_SQLITE
 

	
 
#include "transport/sqlite3backend.h"
 
#include <boost/bind.hpp>
 
#include "log4cxx/logger.h"
 
@@ -434,3 +436,5 @@ void SQLite3Backend::commitTransaction() {
 
}
 

	
 
}
 

	
 
#endif
0 comments (0 inline, 0 general)