From 9072b0c98ba4f9412885a1a32002ee7214fd3dc0 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 30 Jan 2014 03:36:23 +0000 Subject: Attempting to fix OSX compatibility, it's not 100%, but it builds and most things seem to work. We've also tested against LLVM. --- src/stable/minicron.cpp | 2 +- src/stable/random.h | 2 +- src/stable/sharedcore.h | 2 +- src/stable/string.cpp | 16 ++++++++++++++++ src/stable/string.h | 4 ++++ 5 files changed, 23 insertions(+), 3 deletions(-) (limited to 'src/stable') diff --git a/src/stable/minicron.cpp b/src/stable/minicron.cpp index 2f7e868..9d98682 100644 --- a/src/stable/minicron.cpp +++ b/src/stable/minicron.cpp @@ -317,7 +317,7 @@ time_t Bu::MiniCron::TimerBasic::nextTime() if( tLast == -1 ) tLast = time( NULL ); - Bu::String::const_iterator i = sSpec.begin(); + Bu::String::const_iterator i = const_cast(sSpec).begin(); switch( lex( i ) ) { case tokDaily: diff --git a/src/stable/random.h b/src/stable/random.h index b02c9e5..6dc3b45 100644 --- a/src/stable/random.h +++ b/src/stable/random.h @@ -8,11 +8,11 @@ #define BU_RANDOM_H #include "bu/singleton.h" +#include "bu/randombase.h" #include namespace Bu { - class RandomBase; class Random : public Bu::Singleton { friend class Bu::Singleton; diff --git a/src/stable/sharedcore.h b/src/stable/sharedcore.h index be60588..e79c3d6 100644 --- a/src/stable/sharedcore.h +++ b/src/stable/sharedcore.h @@ -104,7 +104,7 @@ namespace Bu Shell clone() const { Shell s( dynamic_cast(*this) ); - s._hardCopy(); + dynamic_cast<_SharedType &>(s)._hardCopy(); return s; } diff --git a/src/stable/string.cpp b/src/stable/string.cpp index bf3aac0..1ceaec1 100644 --- a/src/stable/string.cpp +++ b/src/stable/string.cpp @@ -173,6 +173,17 @@ Bu::String::String( const Bu::String::const_iterator &s, append( s, e ); } +Bu::String::String( const Bu::String::iterator &s ) +{ + append( s ); +} + +Bu::String::String( const Bu::String::iterator &s, + const Bu::String::iterator &e ) +{ + append( s, e ); +} + Bu::String::~String() { } @@ -317,6 +328,11 @@ void Bu::String::append( const const_iterator &s, const const_iterator &e ) } } +void Bu::String::append( const iterator &s, const iterator &e ) +{ + append( const_iterator( s ), const_iterator( e ) ); +} + void Bu::String::prepend( const String & sData ) { prepend( sData.getStr(), sData.getSize() ); diff --git a/src/stable/string.h b/src/stable/string.h index 3f8452d..bd1fe6c 100644 --- a/src/stable/string.h +++ b/src/stable/string.h @@ -569,6 +569,8 @@ namespace Bu String( long nSize ); String( const const_iterator &s ); String( const const_iterator &s, const const_iterator &e ); + String( const iterator &s ); + String( const iterator &s, const iterator &e ); virtual ~String(); /** @@ -646,6 +648,8 @@ namespace Bu */ void append( const const_iterator &s, const const_iterator &e ); + void append( const iterator &s, const iterator &e ); + /** * Prepend another String to this one. *@param sData (String &) The String to prepend. -- cgit v1.2.3