Commit Graph

64 Commits (5b97823db6f7cec6569ef893499cf48f4a889e67)

Author SHA1 Message Date
Rye 2b44464a14 Fix up windows build error in GHA 2025-08-28 06:08:13 -04:00
Rye a455d3ee7d Introduce build system and preprocessor support for ARM64 2025-02-11 05:04:08 -05:00
Ansariel Hiller 74205607b7
Clean up Windows build (#2562)
* APR_DECLARE_STATIC and APU_DECLARE_STATIC gets already defined in APR.cmake
* Move both _CRT_SECURE_NO_WARNINGS and _WINSOCK_DEPRECATED_NO_WARNINGS definitions to 00-Common.cmake
* Always define WIN32_LEAN_AND_MEAN and include subset of Windows API by default
* Remove llwin32headerslean.h and remove unnecessary WIN32_LEAN_AND_MEAN definition handling in llwin32headers.h
* Clean up includes of Windows API headers
* Get rid of workaround to link against IPHLPAPI.lib in lluuid.cpp - this seems to have been an issue in the past that has been fixed
2024-09-13 17:28:48 +03:00
Andrey Lihatskiy cd5d35ddab
Merge pull request #1945 from Ansariel/develop_msvc7
Remove ancient MSVC7 code
2024-07-09 00:43:36 +03:00
Ansariel 499a717f62 Remove ancient MSVC7 code 2024-07-08 20:46:45 +02:00
Ansariel 9fdca96f8b Re-enable compiler warnings C4244 and C4396 except for lltracerecording.h and llunittype.h for now 2024-07-08 20:27:14 +02:00
Ansariel 9f6b8484df Re-enable compiler warnings C4127, C4512 & C4706
Disable particular CRT and WinSock API warnings for functions Microsoft considers unsafe/deprecated
2024-06-11 01:56:08 +03:00
Ansariel c0fad3028f Re-enable compiler warnings C4018, C4100, C4231 and C4506 2024-06-10 16:42:43 +02:00
Ansariel b42f9d836b Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings 2024-06-01 15:49:26 +02:00
Ansariel c082f6f67a Re-enable compiler warning C4800 (performance warning) 2024-05-30 13:11:50 +02:00
Andrey Lihatskiy 1b68f71348 #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed 2024-04-29 07:56:09 +03:00
Nat Goodspeed af5c5a994b SL-16207: Update llstring.h handling of different string types.
In llpreprocessor.h, consider the case of clang on Windows: #define
LL_WCHAR_T_NATIVE there as well as for the Microsoft compiler with /Zc:wchar_t
switch.

In stdtypes.h, inject a LLWCHAR_IS_WCHAR_T symbol to allow the preprocessor to
make decisions about when the types are identical.

llstring.h's conversion logic deals with three types of wide strings
(LLWString, std::wstring and utf16string) based on three types of wide char
(llwchar, wchar_t and U16, respectively). Sometimes they're three distinct
types, sometimes wchar_t is identical to llwchar and sometimes wchar_t is
identical to U16. Rationalize the three cases using ll_convert_u16_alias() and
new ll_convert_wstr_alias() macros.

stringize.h was directly calling wstring_to_utf8str() and utf8str_to_wstring(),
which was producing errors with VS 2019 clang since there isn't actually a
wstring_to_utf8str(std::wstring) overload. Use ll_convert<std::string>()
instead, since that redirects to the relevant ll_convert_wide_to_string()
function. (And now you see why we've been trying to migrate to the uniform
ll_convert<target>() wrapper!) Similarly, call ll_convert<std::wstring>()
instead of a two-step conversion from utf8str_to_wstring(), producing LLWString,
then a character-by-character copy from LLWString to std::wstring. That
isn't even correct: on Windows, we should be encoding from UTF32 to UTF16.
2021-10-27 13:01:37 -04:00
Dave Houlton 7cd076c796 DRTVWR-510 remove all LL_SOLARIS conditionals 2020-10-08 17:16:22 -06:00
Nat Goodspeed 939d350548 SL-793: Add LL_PRETTY_FUNCTION macro wrapping __PRETTY_FUNCTION__
which is, of course, different in Visual Studio (__FUNCSIG__).

Use LL_PRETTY_FUNCTION in DEBUG output instead of plain __FUNCTION__.
2020-03-25 18:39:20 -04: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 ed891c60de SL-821: Add LL_TO_WSTRING() macro to llpreprocessor.h.
Also use existing LL_TO_STRING() macro to stringize LL_VIEWER_CHANNEL in
llversioninfo.cpp and its tests.
2018-05-17 05:33:14 -04:00
Nat Goodspeed ae0b3149ba DRTVWR-418: Fix a round of compile errors surfaced by -std=c++11.
These are mostly things that were in fact erroneous, but accepted by older
compilers.

This changeset has not yet been built with Visual Studio 2013 or Linux gcc,
even with -std=c++11.

This changeset has not been built *without* -std=c++11. It should be used in
conjunction with a corresponding change to LL_BUILD_DARWIN_BASE_SWITCHES in
viewer-build-variables/variables.

This is a work in progress. We do not assert that this changeset completes the
work needed to turn on -std=c++11, even on the Mac.
2017-02-23 16:49:49 -05:00
Nat Goodspeed f5e9839627 DRTVWR-418: Replace preprocessor tests for Windows-specific _M_AMD64
with tests on ADDRESS_SIZE, which is now set on the compiler command line.
2016-11-16 15:39:00 -05:00
Nicky a590d1c63a Windows z64: Disable warning 4267 via llpreprocessor rather than cmake files
(transplanted from 165fa5852652a1da005cf3b2201c192f028efd43)
2016-04-24 12:51:26 +02:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Cinder 6df6aef621 OPEN-282 - Define LL_THREAD_LOCAL for our platforms in order to unify TLS support 2014-11-19 22:27:36 -07:00
Richard Linden cbe397ad13 changed fast timer over to using macro
another attempt to move mem stat into base class
2013-09-05 14:04:13 -07:00
Richard Linden a7aed07a5b broke out llunit.h into llunittype.h and llunits.h for unit declarations
changed unit declarations macros to make a lot more sense
2013-08-27 13:41:19 -07:00
Richard Linden e1c09b9b59 fixed eol type 2013-08-26 18:21:19 -07:00
Richard Linden 662d6a1771 added compile time warnings to use of deprecated llinfos, llwarns, etc. 2013-08-26 10:51:08 -07:00
Richard Linden ea45b8acd2 BUILDFIX: refactored decltype out into traits class 2013-08-19 14:17:17 -07:00
Richard Linden 296ec41e16 BUILDFIX: abstracted decltype into macro LLTYPEOF for temporary
gcc 4.1/4.2 support
2013-08-19 11:57:33 -07:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Richard Linden 5a14a67e06 converted a bunch of narrowing implicit conversions to explicit 2012-02-01 13:03:46 -08:00
Richard Linden d089e6c264 bumped up MSVC warning level to 3 to catch more stuff that gcc catches 2011-11-28 19:16:49 -08:00
Oz Linden 06b0d72efa Change license from GPL to LGPL (version 2.1) 2010-08-13 07:24:57 -04:00
Tofu Linden cbe647786f We already have a LL_FORCE_INLINE in llpreprocessor.h, don't re-invent it for llfasttimers.h.
Also define LL_LIKELY/LL_UNLIKELY with a warning about its micro-optimizey nature, and use it to annotate llasserts (i.e. make llassert() lower-overhead and thus more attractive, even in inner-ish loops.)
2010-01-25 14:25:58 -08:00
James Cook 7d3b3cc474 Linker optimization - use "extern template" for commonly regenerated templates
Also replaced many duplicate calls to LLViewerCamera::getInstance() with local pointer.
Reviewed with Ambroff
2009-11-30 14:41:52 -08:00
James Cook 491cbc5de6 Suppress MSVC warning about extern template for linker optimization 2009-11-28 23:50:14 -08:00
Bryan O'Sullivan 699eac4ee3 Switch some files to Unix line endings 2009-11-18 17:52:03 -08:00
Loren Shih 95cbf689f3 merge
--HG--
branch : avatar-pipeline
2009-11-16 11:05:33 -05:00
Loren Shih 59eb2815bf merge
--HG--
branch : avatar-pipeline
2009-11-13 18:28:27 -05:00
richard 8c90e4d468 DEV-42747 - lltreeiterators_test.cpp broken on Windows
reviewed by Nat
2009-11-12 13:54:30 -08:00
Loren Shih 0dd9871012 merge
--HG--
branch : avatar-pipeline
2009-11-03 14:02:02 -05:00
brad kittenbrink 50247533f9 Merged latest viewer/login-api with latest viewer/viewer-20 2009-10-07 17:51:28 -07:00
James Cook ada0f4fa22 Merge inspectors UI project, gooey-4, into viewer-2 trunk. Added new tooltips to 3D avatars, 2D avatar names, and 3D objects. Refactors tooltips and text boxes, line editors, and text editors. Breaks LLExpandableTextBox, but a fix is coming.
Resolved conflicts in lltexteditor.cpp, llchatitemscontainerctrl.cpp, llchatmsgbox.cpp, llfloaterbuycurrency.cpp, llnearbychat.cpp, floater_buy_currency.xml, and ru/strings.xml

Merging revisions 134925-135157 of svn+ssh://svn.lindenlab.com/svn/linden/branches/gooey/gooey-4 into C:\source\viewer-2.0.0-3, respecting ancestry
2009-10-03 23:40:28 +00:00
Nat Goodspeed a1c69da326 QAR-1619: Fix Windows link errors when building INTEGRATION_TEST_lllazy.
The problem arose because we were setting LL_COMMON_BUILD in
llcommon/CMakeLists.txt, not only for the library build itself but also for
its LL_ADD_INTEGRATION_TEST tests. This told all the headers compiled into the
INTEGRATION_TEST_lllazy executable that the executable was providing all the
llcommon symbols, rather than importing them.
The solution is to switch to the llcommon_EXPORTS symbol automagically defined
by CMake when building the llcommon shared library itself.
2009-09-03 16:50:44 -04:00
brad kittenbrink a7efd0d8dd Merged in viewer-2.0.0-3 changes up through r129050. Boost got clobbered so I'll need to rebuild that, plus a couple other minor clenaups. 2009-07-30 19:39:08 -07:00
palmer@eniac54.lindenlab.com 1af41b3ba7 Fixes to build on linux for DEV-35401.
Moves libllcommon.so to a staging dir for unit tests to work
and gets rid of LL_COMMON_API in forward declarations
2009-07-30 18:52:34 -07:00
Mark Palange 0274c1f2b1 Merged work for DEV-2066 (and formerly QAR-1538) in Viewer 2.
merged all changes, post copy, from the following branches:
linden/brachnes/enable-o-v
user/cg/qar-1538
user/mani/viewer2-enable-o-v
2009-07-16 17:54:58 +00:00
brad kittenbrink c1d59f0260 Windows now links to shared apr when LLCOMMON_LINK_SHARED is on. 2009-07-02 14:40:05 -04:00
Brad Kittenbrink 01d390825a DEV-27646 dll linkage for login module.
Ok, finally got this to a point where it doesn't break the build and I can check
in. llcommon can be built as a shared library (disabled but can be enabled with
cmake cache var LLCOMMON_LINK_SHARED.

reviewed by Mani on tuesday (I still need to get his suggested changes
re-reviewed)
2009-05-22 23:27:16 +00:00
Adam Moss e188badaf2 QAR-1177 maint-viewer-12 + uploadfees-viewer combo mergeme
svn merge -r108355:109316
svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/maint-viewer-12-uploadfees-qa108314

Whew.
2009-02-03 17:56:26 +00:00
Aaron Brashears e3cf284388 Result of svn merge -r107256:107258 svn+ssh://svn/svn/user/phoenix/license_2009_merge into trunk. QAR-1165 2009-01-08 00:05:06 +00:00
Bryan O'Sullivan 9db949eec3 svn merge -r88066:88786 svn+ssh://svn.lindenlab.com/svn/linden/branches/cmake-9-merge
dataserver-is-deprecated
for-fucks-sake-whats-with-these-commit-markers
2008-06-02 21:14:31 +00:00