Changeset de7ec29 in nscp


Ignore:
Timestamp:
08/19/10 14:11:37 (3 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2
Children:
291548e
Parents:
497b779
Message:

Fixed some unix incompatibility issues

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r497b779 rde7ec29  
    262262  get_filename_component(CURRENT_MODULE_PATH ${CURRENT_MODULE} PATH) 
    263263  get_filename_component(CURRENT_MODULE_NAME ${CURRENT_MODULE_PATH} NAME) 
     264  SET (BUILD_MODULE 0) 
    264265  include(${CURRENT_MODULE}) 
    265266  IF(BUILD_MODULE) 
  • build.cmake

    r184d575 rde7ec29  
    2424ELSE(WIN32) 
    2525 
    26 SET(INC_BOOST_INCLUDEDIR "/usr/include/") 
     26SET(INC_OPENSSL_INCLUDEDIR "/usr/include/") 
    2727 
    2828ENDIF(WIN32) 
  • include/error_impl_unix.hpp

    rd05c3f0 rde7ec29  
    22#include <unicode_char.hpp> 
    33#include <string> 
     4#include <strEx.h> 
     5 
     6using namespace nscp::helpers; 
    47 
    58namespace error { 
     
    811    static std::wstring from_system(int dwError) { 
    912      char buf [1024]; 
    10       return to_wstring(::strerror_r(dwError, buf, sizeof (buf))); 
     13      return nscp::helpers::to_wstring(::strerror_r(dwError, buf, sizeof (buf))); 
    1114    } 
    1215    static std::wstring from_module(std::wstring module, unsigned long dwError) { 
     
    4649    } 
    4750    static std::string last_error_ansi(int dwLastError = -1) { 
    48       return to_string(::error::format::from_system(dwLastError)); 
     51      return nscp::helpers::to_string(::error::format::from_system(dwLastError)); 
    4952    } 
    5053  }; 
  • include/nscapi/settings.hpp

    r497b779 rde7ec29  
    4747      } 
    4848      virtual void notify(nscapi::core_wrapper* core_, std::wstring path, std::wstring key) const { 
    49         T value = boost::lexical_cast<T>(core_->getSettingsString(path, key, default_value_as_text_)); 
     49        T value = boost::lexical_cast<T>(core_->getSettingsString(path, key, typed_key<T>::default_value_as_text_)); 
    5050        update_target(&value); 
    5151      } 
     
    5959      } 
    6060      virtual void notify(nscapi::core_wrapper* core_, std::wstring path, std::wstring key) const { 
    61         std::wstring val = core_->getSettingsString(path, key, default_value_as_text_); 
     61        std::wstring val = core_->getSettingsString(path, key, typed_key<T>::default_value_as_text_); 
    6262        T value = boost::lexical_cast<T>(core_->expand_path(val)); 
    6363        update_target(&value); 
     
    6868    public: 
    6969      typed_int_value(const T& v) : typed_key<T>(v), default_value_as_int_(boost::lexical_cast<int>(v)) {} 
    70       typed_key* default_value(const T& v) { 
     70      typed_key<T>* default_value(const T& v) { 
    7171        typed_key<T>::default_value(v); 
    7272        default_value_as_int_ = boost::lexical_cast<int>(v); 
     
    9191      } 
    9292      virtual void notify(nscapi::core_wrapper* core_, std::wstring path, std::wstring key) const { 
    93         T value = static_cast<T>(core_->getSettingsInt(path, key, default_value_as_int_)==1); 
     93        T value = static_cast<T>(core_->getSettingsInt(path, key, typed_int_value<T>::default_value_as_int_)==1); 
    9494        update_target(&value); 
    9595      } 
  • include/strEx.h

    r497b779 rde7ec29  
    680680 
    681681    static int compare( const char_type* s1, const char_type* s2, size_t n ) { 
     682#ifdef WIN32 
    682683      return memicmp( s1, s2, n ); 
    683       // if available on your compiler, 
    684       //  otherwise you can roll your own 
     684#else 
     685      while (n-- && eq(*s1, *s2)) 
     686        ++s1, ++s2; 
     687      return lt(*s2, *s1) - lt(*s1, *s2); 
     688#endif 
    685689    } 
    686690 
     
    831835  else  \ 
    832836  strEx::replace(format, key, _T("0")); 
    833  
     837#ifdef WIN32 
    834838  inline std::wstring format_time_delta(struct tm *mtm, std::wstring format = _T("%Y years %m months %d days %H hours %M minutes")) { 
    835839    // "Date: %Y-%m-%d %H:%M:%S" 
     
    861865    return format_time_delta(static_cast<time_t>(filetime), format); 
    862866  } 
     867endif 
    863868 
    864869#ifdef _DEBUG 
  • modules/CheckEventLog/module.cmake

    r497b779 rde7ec29  
     1IF(WIN32) 
    12SET (BUILD_MODULE 1) 
    2  
    3  
     3ENDIF(WIN32) 
  • modules/CheckSystem/module.cmake

    r497b779 rde7ec29  
     1IF(WIN32) 
    12SET (BUILD_MODULE 1) 
    2  
    3  
     3ENDIF(WIN32) 
Note: See TracChangeset for help on using the changeset viewer.