Skip to content
Snippets Groups Projects
  1. Feb 22, 2019
  2. Feb 11, 2019
  3. Feb 09, 2019
  4. Feb 06, 2019
  5. Feb 05, 2019
  6. Feb 04, 2019
  7. Feb 02, 2019
  8. Jan 18, 2019
  9. Jan 16, 2019
  10. Dec 17, 2018
  11. Dec 16, 2018
  12. Dec 15, 2018
    • Nat Goodspeed's avatar
      SL-10153: auto name{expression} declares an initializer_list · 4a136572
      Nat Goodspeed authored
      instead of a variable of type decltype(expression).
      
      Using SHGetKnownFolderPath(FOLDERID_Fonts) in LLFontGL::getFontPathSystem()
      requires new Windows #include files.
      
      A variable with a constructor can't be declared within the braces of a switch
      statement, even outside any of its case clauses.
      4a136572
  13. Dec 14, 2018
    • Nat Goodspeed's avatar
    • Nat Goodspeed's avatar
      SL-10153: Review and rationalize fetching paths from environment. · c4096f67
      Nat Goodspeed authored
      Use LLStringUtil::getenv() or getoptenv() whenever we fetch a string that will
      be used as a pathname.
      
      Use LLFile::tmpdir() instead of getenv("TEMP").
      
      As an added extra-special bonus, finally clean up $TMP/llcontrol-test-zzzzzz
      directories that have been accumulating every time we run a local build!
      c4096f67
    • Nat Goodspeed's avatar
      SL-10153: Fix previous commit for non-Windows systems. · 132e708f
      Nat Goodspeed authored
      Move Windows-flavored llstring_getoptenv() to Windows-specific section of
      llstring.cpp.
      
      boost::optional type must be stated explicitly to initialize with a value.
      
      On platforms where llwchar is the same as wchar_t, LLWString is the same as
      std::wstring, so ll_convert specializations for std::wstring would duplicate
      those for LLWString. Defend against that.
      
      The compilers we use don't like 'return condition? { expr } : {}', in which we
      hope to construct and return an instance of the declared return type without
      having to restate the type. It works to use an explicit 'if' statement.
      132e708f
    • Nat Goodspeed's avatar
      SL-10153: Introduce ll_convert, windows_message() templates. · 9ffcafb6
      Nat Goodspeed authored
      Add ll_convert<TO, FROM> template, used as (e.g.):
      ll_convert<std::string>(value_of_some_other_string_type);
      There is no generic template implementation -- the template exists solely to
      provide generic aliases for a bewildering family of llstring.h string-
      conversion functions with highly-specific names. There's a generic
      implementation, though, for the degenerate case where FROM and TO are
      identical.
      
      Add ll_convert<> specialization aliases for most of the string-conversion
      functions declared in llstring.h, including the Windows-specific ones
      involving llutf16string and std::wstring.
      
      Add a mini-lecture in llstring.h about appropriate use of string types on
      Windows.
      
      Add LL_WCHAR_T_NATIVE llpreprocessor.h macro so we can detect whether to
      provide separate conversions for llutf16string and std::wstring, or whether
      those would collide because the types are identical.
      
      Add inline ll_convert_wide_to_string(const std::wstring&) overloads so caller
      isn't required to call arg.c_str(), which naturally permits an ll_convert
      alias.
      
      Add ll_convert_wide_to_wstring(), ll_convert_wstring_to_wide() as placeholders
      for converting between Windows std::wstring and Linden LLWString, with
      corresponding ll_convert aliases. We don't yet have library code to perform
      such conversions officially; for now, just copy characters.
      
      Add LLStringUtil::getenv(key) and getoptenv(key) functions. The latter returns
      boost::optional<string_type> in case the caller needs to detect absence of a
      given environment variable rather than simply accepting a default value.
      Naturally getenv(), which accepts a default, is implemented using getoptenv().
      getoptenv(), in turn, is implemented using an underlying llstring_getoptenv().
      
      On Windows, llstring_getoptenv() returns boost::optional<std::wstring> (based
      on GetEnvironmentVariableW()), whereas elsewhere, llstring_getoptenv() returns
      boost::optional<std::string> (based on classic Posix getenv()).
      
      The beauty of generic ll_convert is that the portable LLStringUtilBase<T>::
      getoptenv() template can call the platform-specific llstring_getoptenv() and
      transparently perform whatever conversion is necessary to return the desired
      string_type.
      
      Add windows_message<T>(error) template, with an overload that implicitly calls
      GetLastError(). We provide a single concrete windows_message<std::wstring>()
      implementation because that's what we get from Windows FormatMessageW() --
      everything else is a generic conversion to the desired target string type.
      
      This obviates llprocess.cpp's previous WindowsErrorString() implementation --
      reimplement using windows_message<std::string>().
      9ffcafb6
  14. Dec 13, 2018
  15. Dec 11, 2018
  16. Dec 10, 2018
  17. Dec 08, 2018
Loading