fix bugs for linux build
This commit is contained in:
parent
25872b11b8
commit
97e45a64ea
5 changed files with 16 additions and 9 deletions
|
|
@ -64,6 +64,7 @@ namespace fc {
|
||||||
value(value&& m );
|
value(value&& m );
|
||||||
value(const value& m );
|
value(const value& m );
|
||||||
|
|
||||||
|
value(const char* c );
|
||||||
value(char* c );
|
value(char* c );
|
||||||
value(int8_t );
|
value(int8_t );
|
||||||
value(int16_t );
|
value(int16_t );
|
||||||
|
|
@ -76,8 +77,6 @@ namespace fc {
|
||||||
value(double );
|
value(double );
|
||||||
value(float );
|
value(float );
|
||||||
value(bool );
|
value(bool );
|
||||||
/// initialize an object with a single key/value pair
|
|
||||||
value(const fc::string&, const value& v );
|
|
||||||
value(fc::string&& );
|
value(fc::string&& );
|
||||||
value(fc::string& );
|
value(fc::string& );
|
||||||
value(const fc::string& );
|
value(const fc::string& );
|
||||||
|
|
@ -86,6 +85,13 @@ namespace fc {
|
||||||
value(const object& o );
|
value(const object& o );
|
||||||
value(object& o );
|
value(object& o );
|
||||||
|
|
||||||
|
/// initialize an object with a single key/value pair
|
||||||
|
value(const fc::string&, const value& v );
|
||||||
|
template<typename T>
|
||||||
|
value(const fc::string& s, const T& v ) {
|
||||||
|
set( s, v );
|
||||||
|
}
|
||||||
|
|
||||||
value(fc::vector<value>&& a );
|
value(fc::vector<value>&& a );
|
||||||
value(fc::vector<value>& a );
|
value(fc::vector<value>& a );
|
||||||
value(const fc::vector<value>& a );
|
value(const fc::vector<value>& a );
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,10 @@
|
||||||
#include <fc/console_defines.h>
|
#include <fc/console_defines.h>
|
||||||
#include <fc/log.hpp>
|
#include <fc/log.hpp>
|
||||||
#include <fc/value_cast.hpp>
|
#include <fc/value_cast.hpp>
|
||||||
#include <fc/console_appender.hpp>
|
|
||||||
#include <fc/file_appender.hpp>
|
|
||||||
|
|
||||||
|
|
||||||
namespace fc {
|
namespace fc {
|
||||||
|
|
||||||
static fc::spin_lock appender_spinlock;
|
|
||||||
std::unordered_map<std::string,appender::ptr>& get_appender_map() {
|
std::unordered_map<std::string,appender::ptr>& get_appender_map() {
|
||||||
static std::unordered_map<std::string,appender::ptr> lm;
|
static std::unordered_map<std::string,appender::ptr> lm;
|
||||||
return lm;
|
return lm;
|
||||||
|
|
@ -25,7 +22,6 @@ namespace fc {
|
||||||
return lm;
|
return lm;
|
||||||
}
|
}
|
||||||
appender::ptr appender::get( const fc::string& s ) {
|
appender::ptr appender::get( const fc::string& s ) {
|
||||||
scoped_lock<spin_lock> lock(appender_spinlock);
|
|
||||||
return get_appender_map()[s];
|
return get_appender_map()[s];
|
||||||
}
|
}
|
||||||
bool appender::register_appender( const fc::string& type, const appender_factory::ptr& f )
|
bool appender::register_appender( const fc::string& type, const appender_factory::ptr& f )
|
||||||
|
|
@ -45,6 +41,4 @@ namespace fc {
|
||||||
return ap;
|
return ap;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool reg_console_appender = appender::register_appender<console_appender>( "console" );
|
|
||||||
static bool reg_file_appender = appender::register_appender<file_appender>( "file" );
|
|
||||||
} // namespace fc
|
} // namespace fc
|
||||||
|
|
|
||||||
|
|
@ -86,13 +86,13 @@ namespace fc {
|
||||||
void logger::set_name( const fc::string& n ) { my->_name = n; }
|
void logger::set_name( const fc::string& n ) { my->_name = n; }
|
||||||
const fc::string& logger::name()const { return my->_name; }
|
const fc::string& logger::name()const { return my->_name; }
|
||||||
|
|
||||||
static fc::spin_lock logger_spinlock;
|
|
||||||
std::unordered_map<std::string,logger>& get_logger_map() {
|
std::unordered_map<std::string,logger>& get_logger_map() {
|
||||||
static std::unordered_map<std::string,logger> lm;
|
static std::unordered_map<std::string,logger> lm;
|
||||||
return lm;
|
return lm;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger logger::get( const fc::string& s ) {
|
logger logger::get( const fc::string& s ) {
|
||||||
|
static fc::spin_lock logger_spinlock;
|
||||||
scoped_lock<spin_lock> lock(logger_spinlock);
|
scoped_lock<spin_lock> lock(logger_spinlock);
|
||||||
return get_logger_map()[s];
|
return get_logger_map()[s];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@
|
||||||
#include <fc/filesystem.hpp>
|
#include <fc/filesystem.hpp>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <fc/console_appender.hpp>
|
||||||
|
#include <fc/file_appender.hpp>
|
||||||
|
|
||||||
namespace fc {
|
namespace fc {
|
||||||
std::unordered_map<std::string,logger>& get_logger_map();
|
std::unordered_map<std::string,logger>& get_logger_map();
|
||||||
|
|
@ -16,6 +18,8 @@ namespace fc {
|
||||||
}
|
}
|
||||||
bool configure_logging( const logging_config& cfg )
|
bool configure_logging( const logging_config& cfg )
|
||||||
{
|
{
|
||||||
|
static bool reg_console_appender = appender::register_appender<console_appender>( "console" );
|
||||||
|
static bool reg_file_appender = appender::register_appender<file_appender>( "file" );
|
||||||
get_logger_map().clear();
|
get_logger_map().clear();
|
||||||
get_appender_map().clear();
|
get_appender_map().clear();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -436,6 +436,9 @@ value::value( value&& m ) {
|
||||||
value::value( const value& m ){
|
value::value( const value& m ){
|
||||||
gh(m.holder)->copy_helper(holder._store._data);
|
gh(m.holder)->copy_helper(holder._store._data);
|
||||||
}
|
}
|
||||||
|
value::value( const char* c ) {
|
||||||
|
new (holder) detail::value_holder_impl<fc::string>( c );
|
||||||
|
}
|
||||||
value::value( char* c ) {
|
value::value( char* c ) {
|
||||||
new (holder) detail::value_holder_impl<fc::string>( c );
|
new (holder) detail::value_holder_impl<fc::string>( c );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue