From: Jonathan W. <co...@co...> - 2004-08-11 14:44:47
|
> From: Jonathan Wakely [mailto:jw...@mi...] > > I've downloaded the 4.1.3 sources and that fix won't work, > SHUTDOWN_DEFAULT is an enum, not a macro > (bah! who uses all-caps for enums?!) > > but something like this should work ok: > > #if MYSQL_VERSION_ID >= 40103 > bool suc = !(mysql_shutdown(m_sharedptr_connection.obj(), > SHUTDOWN_DEFAULT)); > #else > bool suc = !(mysql_shutdown(m_sharedptr_connection.obj())); > #endif For the record ... I considered making the signature of Connection::shutdown() vary depending on the MySQL version (so you could pass in an enum_shutdown_level if compiling against 4.1.3 or higher) I decided against it for several reasons, including * Would make the mysqlcppapi API different depending what headers you compile it against. This seems like a recipe for ODR violations. (Might not be an issue since the libmysqlclient ABI changed anyway) * There's currently only one value for that enum, so no point in allowing different values to be passed in. If alternative shutdown arguments are added in the future mysqlcppapi might support them, but not right now. jon -- "In times like these, it helps to recall that there have always been times like these." - Paul Harvey |