Commit Graph

118 Commits (8e2adbcde79d0586fba20fecb3a4eae5aa3ff8dd)

Author SHA1 Message Date
Ansariel 93f1998a47 Merge branch 'DRTVWR-525' of https://bitbucket.org/lindenlab/viewer 2021-01-08 23:06:41 +01:00
Ansariel a962d1a2c3 Fix build on anything but Windows 2020-11-14 20:16:39 +01:00
Nicky 45d588d50e FIRE-20337; Step one. Make sure windows correctly formats numbers by
using wide strings for format operations.
2020-11-14 17:00:17 +01:00
Dave Houlton 7cd076c796 DRTVWR-510 remove all LL_SOLARIS conditionals 2020-10-08 17:16:22 -06:00
Nat Goodspeed cbbe655f27 DRTVWR-476: Eliminate snprintf_hack::snprintf(). Use MS snprintf().
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l?view=vs-2017
"Beginning with the UCRT in Visual Studio 2015 and Windows 10, snprintf is no
longer identical to _snprintf. The snprintf function behavior is now C99
standard compliant."

In other words, VS 2015 et ff. snprintf() now promises to nul-terminate the
buffer even in the overflow case, which is what snprintf_hack::snprintf() was
for.

This removal was motivated by ambiguous-call errors generated by VS 2017 for
library snprintf() vs. snprintf_hack::snprintf().
2020-03-25 16:12:45 -04:00
Nicky 73affdca83 Merge with phoenix-firestorm-lgpl 2019-09-15 17:25:48 +02:00
Ansariel 8dfb7d571e Merge viewer-neko 2019-04-24 21:05:58 +02:00
andreykproductengine 29f0a7808f SL-10930 LLStringUtil pointlessly scan the string 2019-04-16 21:58:22 +03:00
Ansariel b75b1eb789 Merge viewer-vs2017 2019-03-31 01:37:56 +01:00
Ansariel 8b6392c0aa Merge viewer-bugsplat 2018-12-16 13:04:08 +01:00
Nat Goodspeed 4a13657285 SL-10153: auto name{expression} declares an initializer_list
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.
2018-12-15 09:13:24 -05:00
Nat Goodspeed 3c53f8abde SL-10153: VS 2013 isn't so fond of ?: involving std::string. 2018-12-14 16:00:09 -05:00
Nat Goodspeed 132e708fec SL-10153: Fix previous commit for non-Windows systems.
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.
2018-12-14 12:01:51 -05:00
Nat Goodspeed 9ffcafb64b SL-10153: Introduce ll_convert, windows_message() templates.
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>().
2018-12-14 10:48:43 -05:00
Nat Goodspeed 4e894eb2a7 SL-10153: Improve ll_convert_string_to_wide() and its converse.
Instead of returning a wchar_t* and requiring the caller to delete it later,
return a std::basic_string<wchar_t> that's self-cleaning. If the caller wants
a wchar_t*, s/he can call c_str() on the returned string.

Default the code_page parameter to CP_UTF8, since we try to be really
consistent about using UTF-8 encoding for all our internal std::strings.
2018-12-11 20:48:20 -05:00
Nat Goodspeed 23fea97db1 DRTVWR-476: Eliminate snprintf_hack::snprintf(). Use MS snprintf().
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l?view=vs-2017
"Beginning with the UCRT in Visual Studio 2015 and Windows 10, snprintf is no
longer identical to _snprintf. The snprintf function behavior is now C99
standard compliant."

In other words, VS 2015 et ff. snprintf() now promises to nul-terminate the
buffer even in the overflow case, which is what snprintf_hack::snprintf() was
for.

This removal was motivated by ambiguous-call errors generated by VS 2017 for
library snprintf() vs. snprintf_hack::snprintf().
2018-10-24 16:26:05 -04:00
Ansariel 02f6ce9964 Merge Firestorm LGPL 2018-05-30 22:43:01 +02:00
Kitty Barnett 976285bd8c Merged with RLVa ancestor (should have been a null merge) 2018-05-26 13:26:06 +02:00
Brad Payne (Vir Linden) e36745eb98 merge 2018-01-17 16:06:27 +00:00
Ansariel 4ff01e5361 Merge axon 2017-10-11 20:28:21 +02:00
Brad Payne (Vir Linden) 36c4424213 SL-808 - more work on arc display. area calculations still have some issues, especially for animated objects. 2017-10-03 22:26:00 +01:00
Oz Linden 01e0b78c59 merge changes for DRTVWR-439 2017-08-16 15:43:58 -04:00
Mnikolenko Productengine 65208b7741 MAINT-7488 FIXED [Windows] Viewer crashes when pasting empty string from clipboard 2017-06-16 17:46:12 +03:00
Mnikolenko Productengine eeddfe3a25 MAINT-7488 FIXED [Windows] Viewer crashes when pasting empty string from clipboard 2017-06-16 17:46:12 +03:00
Nat Goodspeed fe64db61d6 Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2017-05-22 21:30:26 -04:00
Ansariel 95fcf065c1 Merge viewer-bear 2017-04-19 21:43:58 +02:00
mnikolenko c27dbc6214 MAINT-6404 FIXED When pasting text with mac linebreak into a notecard, it shouldn't be removed 2017-04-03 02:21:18 +03:00
Nat Goodspeed bcb4f2900b DRTVWR-418: operator comparison methods should be const.
clang has started to reject our non-const comparison operator methods used
within standard algorithms.
2016-12-20 11:01:17 -05:00
Kitty Barnett 4a07c81196 Make string splitting code generally available so it can be reused elsehwere
--HG--
branch : RLVa
2016-12-07 19:57:54 +01:00
Kitty Barnett 4503a28aee Merged with RLVa fixes 2016-12-03 17:13:17 +01:00
Kitty Barnett c07bfee1f2 Added the @list and @stopim IM queries
--HG--
branch : RLVa
2016-11-20 21:03:32 +01:00
Ansariel a0c3f3346b Merge Firestorm LGPL 2016-07-01 13:52:45 +02:00
Tonya Souther cc4ef52b97 Build fixes for C++11 on OS X. Includes several rebuilt libraries. 2016-06-21 15:57:18 -05:00
Ansariel c43be9d39b Merge viewer-lynx 2016-06-15 10:04:29 +02:00
andreykproductengine 1adfaa081f MAINT-6446 Correct password length handling 2016-06-01 16:56:04 +03:00
Ansariel 2797c5938a Merge Firestorm LGPL 2016-04-05 10:47:23 +02:00
Oz Linden 9be58e915a merge with 4.0.3-release 2016-04-04 15:53:09 -04:00
Ansariel 3192fe832f Merge viewer-quickgraphics 2016-03-08 01:41:31 +01:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Nicky c218e524b2 Merge - Step 1; Still enough to do. 2015-10-26 20:20:13 +01:00
Rider Linden ddb63e7fb7 Initial checkin for uploading via coroutine. 2015-06-30 17:11:10 -07:00
Tank_Master 8863d9beaf Compile fixes 2014-06-09 23:27:05 -07:00
Richard Linden 98aabdc176 merge with release 2014-04-07 19:09:40 -07:00
Aura Linden 00aa2fee6d Fixes from Windows build including utf-16 to utf-8 conversions. 2014-01-15 21:24:55 -08:00
Richard Linden e40065f82c BUILDFIX: #include and dependency cleanup 2013-07-19 15:03:05 -07:00
Richard Linden 0a96b47663 merge with viewer-release 2013-06-05 19:05:43 -07:00
Gilbert Gonzales 892f3cdd2c CHUI-967: fix display of % escapes in chat 2013-05-22 06:26:54 -04:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Richard Linden 9d77e030d9 SH-3406 WIP convert fast timers to lltrace system
cleaning up build
moved most includes of windows.h to llwin32headers.h to disable min/max macros, etc
streamlined Time class and consolidated functionality in BlockTimer class
llfasttimer is no longer included via llstring.h, so had to add it manually in several places
2012-11-14 23:52:27 -08:00
Oz Linden 4397516ca5 merge changes for DRTVWR-168 2012-06-21 17:50:41 -04:00