Automated merge with ssh://bitbucket.org/lindenlab/viewer-release

master
Nat Goodspeed 2017-02-03 09:54:52 -05:00
commit 434f0e161a
122 changed files with 2601 additions and 5874 deletions

View File

@ -17,6 +17,8 @@ build-darwin-*
build-vc80/
build-vc100/
build-vc120/
build-vc120-32/
build-vc120-64/
indra/build-vc[0-9]*
indra/CMakeFiles
indra/lib/mono/1.0/*.dll

View File

@ -3,36 +3,18 @@
# Please refer to:
# https://wiki.secondlife.com/wiki/Automated_Build_System
# Global setting for now....
Darwin.symbolfiles = "newview/Release/secondlife-symbols-darwin.tar.bz2"
CYGWIN.symbolfiles = "newview/Release/secondlife-symbols-windows.tar.bz2"
Linux.symbolfiles = "newview/secondlife-symbols-linux.tar.bz2"
# Variants (NOTE: 'Release' must be last for uploads to work correctly)
variants = "RelWithDebInfo Release"
# Use Public Upload Locations
public_build = true
build_docs = true
# disable all Debug builds (RelWithDebInfo is sufficient)
build_CYGWIN_Debug = false
build_Linux_Debug = false
build_Darwin_Debug = false
build_Debug = false
# enable Doxygen building on Linux for TeamCity (it can be done manually on any platform)
build_Linux_Doxygen = true
# Update Public Inworld Build Status Indicators (setting should mirror "public_build")
email_status_this_is_os = true
# Limit extent of codeticket updates to revisions after...
codeticket_since = 3.3.0-release
# Override build system default toolchain
# Note that this will only affect automated builds.
Linux.distcc_version =
Linux.gcc_version = /usr/bin/gcc-4.6
Linux.cxx_version = /usr/bin/g++-4.6
# Need viewer-build-variables as well as other shared repositories
buildscripts_shared_more_NAMEs="build_variables"
################################################################
#### Examples of how to set the viewer_channel ####
@ -88,5 +70,5 @@ EDU_viewer_channel_suffix = "edu"
# Notifications - to configure email notices use the TeamCity parameter
# setting screen for your project or build configuration to set the
# environment variable 'email' to a space-separated list of email addresses
email=""

File diff suppressed because it is too large Load Diff

181
build.sh
View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# This is the custom build script for the viewer
#
@ -18,7 +18,7 @@
build_dir_Darwin()
{
echo build-darwin-i386
echo build-darwin-x86_64
}
build_dir_Linux()
@ -28,7 +28,7 @@ build_dir_Linux()
build_dir_CYGWIN()
{
echo build-vc120
echo build-vc120-${AUTOBUILD_ADDRSIZE}
}
viewer_channel_suffix()
@ -47,8 +47,8 @@ viewer_channel_suffix()
installer_Darwin()
{
local package_name="$1"
local package_dir="$(build_dir_Darwin ${last_built_variant:-Release})/newview/"
local pattern=".*$(viewer_channel_suffix ${package_name})_[0-9]+_[0-9]+_[0-9]+_[0-9]+_i386\\.dmg\$"
local package_dir="$(build_dir_Darwin)/newview/"
local pattern=".*$(viewer_channel_suffix ${package_name})_[0-9]+_[0-9]+_[0-9]+_[0-9]+_x86_64\\.dmg\$"
# since the additional packages are built after the base package,
# sorting oldest first ensures that the unqualified package is returned
# even if someone makes a qualified name that duplicates the last word of the base name
@ -59,7 +59,7 @@ installer_Darwin()
installer_Linux()
{
local package_name="$1"
local package_dir="$(build_dir_Linux ${last_built_variant:-Release})/newview/"
local package_dir="$(build_dir_Linux)/newview/"
local pattern=".*$(viewer_channel_suffix ${package_name})_[0-9]+_[0-9]+_[0-9]+_[0-9]+_i686\\.tar\\.bz2\$"
# since the additional packages are built after the base package,
# sorting oldest first ensures that the unqualified package is returned
@ -95,14 +95,28 @@ pre_build()
&& [ -r "$master_message_template_checkout/message_template.msg" ] \
&& template_verifier_master_url="-DTEMPLATE_VERIFIER_MASTER_URL=file://$master_message_template_checkout/message_template.msg"
# nat 2016-12-20: disable HAVOK on Mac until we get a 64-bit Mac build.
RELEASE_CRASH_REPORTING=ON
SIGNING=()
if [ "$arch" == "Darwin" ]
then HAVOK=OFF
if [ "$variant" == "Release" ]
then SIGNING=("-DENABLE_SIGNING:BOOL=YES" \
"-DSIGNING_IDENTITY:STRING=Developer ID Application: Linden Research, Inc.")
fi
else HAVOK=ON
fi
"$autobuild" configure --quiet -c $variant -- \
-DPACKAGE:BOOL=ON \
-DUNATTENDED:BOOL=ON \
-DRELEASE_CRASH_REPORTING:BOOL=ON \
-DVIEWER_CHANNEL:STRING="\"$viewer_channel\"" \
-DHAVOK:BOOL="$HAVOK" \
-DRELEASE_CRASH_REPORTING:BOOL="$RELEASE_CRASH_REPORTING" \
-DVIEWER_CHANNEL:STRING="${viewer_channel}" \
-DGRID:STRING="\"$viewer_grid\"" \
-DLL_TESTS:BOOL="$run_tests" \
-DTEMPLATE_VERIFIER_OPTIONS:STRING="$template_verifier_options" $template_verifier_master_url \
"${SIGNING[@]}" \
|| fatal "$variant configuration failed"
end_section "Configure $variant"
@ -112,21 +126,21 @@ package_llphysicsextensions_tpv()
{
begin_section "PhysicsExtensions_TPV"
tpv_status=0
if [ "$variant" = "Release" ]
# nat 2016-12-21: without HAVOK, can't build PhysicsExtensions_TPV.
if [ "$variant" = "Release" -a "${HAVOK:-}" != "OFF" ]
then
llpetpvcfg=$build_dir/packages/llphysicsextensions/autobuild-tpv.xml
"$autobuild" build --quiet --config-file $llpetpvcfg -c Tpv
test -r "$build_dir/packages/llphysicsextensions/autobuild-tpv.xml" || fatal "No llphysicsextensions_tpv autobuild configuration found"
tpvconfig=$(native_path "$build_dir/packages/llphysicsextensions/autobuild-tpv.xml")
"$autobuild" build --quiet --config-file "$tpvconfig" -c Tpv || fatal "failed to build llphysicsextensions_tpv"
# capture the package file name for use in upload later...
PKGTMP=`mktemp -t pgktpv.XXXXXX`
trap "rm $PKGTMP* 2>/dev/null" 0
"$autobuild" package --quiet --config-file $llpetpvcfg --results-file "$(native_path $PKGTMP)"
"$autobuild" package --quiet --config-file "$tpvconfig" --results-file "$(native_path $PKGTMP)" || fatal "failed to package llphysicsextensions_tpv"
tpv_status=$?
if [ -r "${PKGTMP}" ]
then
cat "${PKGTMP}" >> "$build_log"
eval $(cat "${PKGTMP}") # sets autobuild_package_{name,filename,md5}
autobuild_package_filename="$(shell_path "${autobuild_package_filename}")"
. "${PKGTMP}" # sets autobuild_package_{name,filename,md5}
echo "${autobuild_package_filename}" > $build_dir/llphysicsextensions_package
fi
else
@ -142,10 +156,14 @@ build()
local variant="$1"
if $build_viewer
then
begin_section "autobuild $variant"
"$autobuild" build --no-configure -c $variant || fatal "failed building $variant"
echo true >"$build_dir"/build_ok
end_section "autobuild $variant"
begin_section "extensions $variant"
# Run build extensions
if [ $build_ok -eq 0 -a -d ${build_dir}/packages/build-extensions ]
if [ -d ${build_dir}/packages/build-extensions ]
then
for extension in ${build_dir}/packages/build-extensions/*.sh
do
@ -157,10 +175,10 @@ build()
# *TODO: Make this a build extension.
package_llphysicsextensions_tpv || fatal "failed building llphysicsextensions packages"
end_section "extensions $variant"
echo true >"$build_dir"/build_ok
else
echo "Skipping build due to configuration build_viewer=${build_viewer}"
record_event "Skipping build due to configuration build_viewer=${build_viewer}"
echo true >"$build_dir"/build_ok
fi
}
@ -176,13 +194,9 @@ then
exit 1
fi
# Check to see if we're skipping the platform
if ! eval '$build_'"$arch"
then
record_event "building on architecture $arch is disabled"
pass
fi
initialize_build # provided by master buildscripts build.sh
begin_section "autobuild initialize"
# ensure AUTOBUILD is in native path form for child processes
AUTOBUILD="$(native_path "$AUTOBUILD")"
# set "$autobuild" to cygwin path form for use locally in this script
@ -194,7 +208,16 @@ then
fi
# load autobuild provided shell functions and variables
eval "$("$autobuild" --quiet source_environment)"
"$autobuild" --quiet source_environment > "$build_log_dir/source_environment"
begin_section "dump source environment commands"
cat "$build_log_dir/source_environment"
end_section "dump source environment commands"
begin_section "execute source environment commands"
. "$build_log_dir/source_environment"
end_section "execute source environment commands"
end_section "autobuild initialize"
# something about the additional_packages mechanism messes up buildscripts results.py on Linux
# since we don't care about those packages on Linux, just zero it out, yes - a HACK
@ -203,10 +226,9 @@ then
export additional_packages=
fi
# dump environment variables for debugging
begin_section "Environment"
env|sort
end_section "Environment"
python_cmd "$helpers/codeticket.py" addinput "Viewer Channel" "${viewer_channel}"
initialize_version # provided by buildscripts build.sh; sets version id
# Now run the build
succeeded=true
@ -214,9 +236,6 @@ build_processes=
last_built_variant=
for variant in $variants
do
eval '$build_'"$variant" || continue
eval '$build_'"$arch"_"$variant" || continue
# Only the last built arch is available for upload
last_built_variant="$variant"
@ -232,6 +251,9 @@ do
then
begin_section "Build $variant"
build "$variant" "$build_dir"
end_section "Build $variant"
begin_section "post-build $variant"
if `cat "$build_dir/build_ok"`
then
case "$variant" in
@ -239,10 +261,11 @@ do
if [ -r "$build_dir/autobuild-package.xml" ]
then
begin_section "Autobuild metadata"
upload_item docs "$build_dir/autobuild-package.xml" text/xml
python_cmd "$helpers/codeticket.py" addoutput "Autobuild Metadata" "$build_dir/autobuild-package.xml" --mimetype text/xml \
|| fatal "Upload of autobuild metadata failed"
if [ "$arch" != "Linux" ]
then
record_dependencies_graph # defined in buildscripts/hg/bin/build.sh
record_dependencies_graph "$build_dir/autobuild-package.xml" # defined in buildscripts/hg/bin/build.sh
else
record_event "TBD - no dependency graph for linux (probable python version dependency)"
fi
@ -255,12 +278,13 @@ do
if [ -r "$build_dir/doxygen_warnings.log" ]
then
record_event "Doxygen warnings generated; see doxygen_warnings.log"
upload_item log "$build_dir/doxygen_warnings.log" text/plain
python_cmd "$helpers/codeticket.py" addoutput "Doxygen Log" "$build_dir/doxygen_warnings.log" --mimetype text/plain ## TBD
fi
if [ -d "$build_dir/doxygen/html" ]
then
tar -c -f "$build_dir/viewer-doxygen.tar.bz2" --strip-components 3 "$build_dir/doxygen/html"
upload_item docs "$build_dir/viewer-doxygen.tar.bz2" binary/octet-stream
python_cmd "$helpers/codeticket.py" addoutput "Doxygen Tarball" "$build_dir/viewer-doxygen.tar.bz2" \
|| fatal "Upload of doxygen tarball failed"
fi
;;
*)
@ -270,7 +294,8 @@ do
else
record_failure "Build of \"$variant\" failed."
fi
end_section "Build $variant"
end_section "post-build $variant"
else
record_event "configure for $variant failed: build skipped"
fi
@ -290,7 +315,7 @@ then
if $build_viewer_deb && [ "$last_built_variant" == "Release" ]
then
begin_section "Build Viewer Debian Package"
have_private_repo=false
# mangle the changelog
dch --force-bad-version \
--distribution unstable \
@ -320,11 +345,14 @@ then
# upload debian package and create repository
begin_section "Upload Debian Repository"
for deb_file in `/bin/ls ../packages_public/*.deb ../*.deb 2>/dev/null`; do
upload_item debian $deb_file binary/octet-stream
deb_pkg=$(basename "$deb_file" | sed 's,_.*,,')
python_cmd "$helpers/codeticket.py" addoutput "Debian $deb_pkg" $deb_file \
|| fatal "Upload of debian $deb_pkg failed"
done
for deb_file in `/bin/ls ../packages_private/*.deb 2>/dev/null`; do
upload_item debian_private $deb_file binary/octet-stream
have_private_repo=true
deb_pkg=$(basename "$deb_file" | sed 's,_.*,,')
python_cmd "$helpers/codeticket.py" addoutput "Debian $deb_pkg" "$deb_file" --private \
|| fatal "Upload of debian $deb_pkg failed"
done
create_deb_repo
@ -336,14 +364,6 @@ then
mv $build_log_dir/$debian_repo_type $build_log_dir/${debian_repo_type}_pushed
fi
done
if [ $have_private_repo = true ]; then
eval "$python_command \"$redirect\" '\${private_S3PROXY_URL}${S3PREFIX}repo/$repo/rev/$revision/index.html'"\
>"$build_log_dir/private.html" || fatal generating redirect
upload_item global_redirect "$build_log_dir/private.html" text/html
fi
end_section "Upload Debian Repository"
else
@ -359,18 +379,17 @@ if $succeeded
then
if $build_viewer
then
begin_section Upload Installer
begin_section "Uploads"
# Upload installer
package=$(installer_$arch)
if [ x"$package" = x ] || test -d "$package"
then
record_event "??? mystery event $package // $build_coverity"
fatal "No installer found from `pwd`"
succeeded=$build_coverity
else
# Upload base package.
upload_item installer "$package" binary/octet-stream
upload_item quicklink "$package" binary/octet-stream
[ -f $build_dir/summary.json ] && upload_item installer $build_dir/summary.json text/plain
python_cmd "$helpers/codeticket.py" addoutput Installer "$package" \
|| fatal "Upload of installer failed"
# Upload additional packages.
for package_id in $additional_packages
@ -378,32 +397,44 @@ then
package=$(installer_$arch "$package_id")
if [ x"$package" != x ]
then
upload_item installer "$package" binary/octet-stream
upload_item quicklink "$package" binary/octet-stream
python_cmd "$helpers/codeticket.py" addoutput "Installer $package_id" "$package" \
|| fatal "Upload of installer $package_id failed"
else
record_failure "Failed to find additional package for '$package_id'."
fi
done
case "$last_built_variant" in
Release)
# Upload crash reporter files
for symbolfile in $symbolfiles
do
upload_item symbolfile "$build_dir/$symbolfile" binary/octet-stream
done
if [ "$last_built_variant" = "Release" ]
then
# nat 2016-12-22: without RELEASE_CRASH_REPORTING, we have no symbol file.
if [ "${RELEASE_CRASH_REPORTING:-}" != "OFF" ]
then
# Upload crash reporter file
# These names must match the set of VIEWER_SYMBOL_FILE in indra/newview/CMakeLists.txt
case "$arch" in
CYGWIN)
symbolfile="$build_dir/newview/Release/secondlife-symbols-windows-${AUTOBUILD_ADDRSIZE}.tar.bz2"
;;
Darwin)
symbolfile="$build_dir/newview/Release/secondlife-symbols-darwin-${AUTOBUILD_ADDRSIZE}.tar.bz2"
;;
Linux)
symbolfile="$build_dir/newview/Release/secondlife-symbols-linux-${AUTOBUILD_ADDRSIZE}.tar.bz2"
;;
esac
python_cmd "$helpers/codeticket.py" addoutput "Symbolfile" "$symbolfile" \
|| fatal "Upload of symbolfile failed"
fi
# Upload the llphysicsextensions_tpv package, if one was produced
# *TODO: Make this an upload-extension
if [ -r "$build_dir/llphysicsextensions_package" ]
then
llphysicsextensions_package=$(cat $build_dir/llphysicsextensions_package)
upload_item private_artifact "$llphysicsextensions_package" binary/octet-stream
fi
;;
*)
;;
esac
# Upload the llphysicsextensions_tpv package, if one was produced
# *TODO: Make this an upload-extension
if [ -r "$build_dir/llphysicsextensions_package" ]
then
llphysicsextensions_package=$(cat $build_dir/llphysicsextensions_package)
python_cmd "$helpers/codeticket.py" addoutput "Physics Extensions Package" "$llphysicsextensions_package" --private \
|| fatal "Upload of physics extensions package failed"
fi
fi
# Run upload extensions
if [ -d ${build_dir}/packages/upload-extensions ]; then
@ -414,7 +445,7 @@ then
done
fi
fi
end_section Upload Installer
end_section "Uploads"
else
record_event "skipping upload of installer"
fi

View File

@ -48,8 +48,8 @@ Compilation
LL_WINDOWS=1 " "
UNICODE " "
_UNICODE " "
WINVER=0x0501 " "
_WIN32_WINNT=0x0501 " "
WINVER=0x0600 " "
_WIN32_WINNT=0x0600 " "
LL_OS_DRAGDROP_ENABLED=1 " "
LIB_NDOF=1 " "

View File

@ -2,18 +2,32 @@
#
# Compilation options shared by all Second Life components.
#*****************************************************************************
# It's important to realize that CMake implicitly concatenates
# CMAKE_CXX_FLAGS with (e.g.) CMAKE_CXX_FLAGS_RELEASE for Release builds. So
# set switches in CMAKE_CXX_FLAGS that should affect all builds, but in
# CMAKE_CXX_FLAGS_RELEASE or CMAKE_CXX_FLAGS_RELWITHDEBINFO for switches
# that should affect only that build variant.
#
# Also realize that CMAKE_CXX_FLAGS may already be partially populated on
# entry to this file.
#*****************************************************************************
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
include(Variables)
# Portable compilation flags.
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1")
set(CMAKE_CXX_FLAGS_RELEASE
"-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -DNDEBUG")
# We go to some trouble to set LL_BUILD to the set of relevant compiler flags.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}")
# Given that, all the flags you see added below are flags NOT present in
# https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables.
# Before adding new ones here, it's important to ask: can this flag really be
# applied to the viewer only, or should/must it be applied to all 3p libraries
# as well?
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-DLL_RELEASE=1 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
# Portable compilation flags.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DADDRESS_SIZE=${ADDRESS_SIZE}")
# Configure crash reporting
set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
@ -46,26 +60,25 @@ if (WINDOWS)
# http://www.cmake.org/pipermail/cmake/2009-September/032143.html
string(REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP -D_SCL_SECURE_NO_WARNINGS=1"
CACHE STRING "C++ compiler debug options" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /Zo /MD /MP /Ob0 -D_SECURE_STL=0"
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zo"
CACHE STRING "C++ compiler release-with-debug options" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /Zo /MD /MP /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /Zo"
CACHE STRING "C++ compiler release options" FORCE)
# zlib has assembly-language object files incompatible with SAFESEH
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT /IGNORE:4099")
set(CMAKE_CXX_STANDARD_LIBRARIES "")
set(CMAKE_C_STANDARD_LIBRARIES "")
add_definitions(
/DLL_WINDOWS=1
/DNOMINMAX
# /DDOM_DYNAMIC # For shared library colladadom
/DUNICODE
/D_UNICODE
)
add_compile_options(
/GS
/TP
/W3
@ -73,94 +86,41 @@ if (WINDOWS)
/Zc:forScope
/nologo
/Oy-
/Zc:wchar_t-
/arch:SSE2
# /arch:SSE2
/fp:fast
)
# Nicky: x64 implies SSE2
if( ADDRESS_SIZE EQUAL 32 )
add_definitions( /arch:SSE2 )
endif()
# Are we using the crummy Visual Studio KDU build workaround?
if (NOT VS_DISABLE_FATAL_WARNINGS)
add_definitions(/WX)
endif (NOT VS_DISABLE_FATAL_WARNINGS)
# configure Win32 API for Windows Vista+ compatibility
set(WINVER "0x0600" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")
endif (WINDOWS)
if (LINUX)
set(CMAKE_SKIP_RPATH TRUE)
# Here's a giant hack for Fedora 8, where we can't use
# _FORTIFY_SOURCE if we're using a compiler older than gcc 4.1.
add_definitions(-D_FORTIFY_SOURCE=2)
find_program(GXX g++)
mark_as_advanced(GXX)
if (GXX)
execute_process(
COMMAND ${GXX} --version
COMMAND sed "s/^[gc+ ]*//"
COMMAND head -1
OUTPUT_VARIABLE GXX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else (GXX)
set(GXX_VERSION x)
endif (GXX)
# The quoting hack here is necessary in case we're using distcc or
# ccache as our compiler. CMake doesn't pass the command line
# through the shell by default, so we end up trying to run "distcc"
# " g++" - notice the leading space. Ugh.
execute_process(
COMMAND sh -c "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version"
COMMAND sed "s/^[gc+ ]*//"
COMMAND head -1
OUTPUT_VARIABLE CXX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (${GXX_VERSION} STREQUAL ${CXX_VERSION})
add_definitions(-D_FORTIFY_SOURCE=2)
else (${GXX_VERSION} STREQUAL ${CXX_VERSION})
if (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat")
add_definitions(-D_FORTIFY_SOURCE=2)
endif (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat")
endif (${GXX_VERSION} STREQUAL ${CXX_VERSION})
# Let's actually get a numerical version of gxx's version
STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION_NUMBER ${CXX_VERSION})
# Hacks to work around gcc 4.1 TC build pool machines which can't process pragma warning disables
# This is pure rubbish; I wish there was another way.
#
if(${CXX_VERSION_NUMBER} LESS 420)
set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-uninitialized -Wno-unused-variable -Wno-unused-function ${CMAKE_CXX_FLAGS}")
endif (${CXX_VERSION_NUMBER} LESS 420)
if(${CXX_VERSION_NUMBER} GREATER 459)
set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-unused-but-set-variable -Wno-unused-variable ${CMAKE_CXX_FLAGS}")
endif (${CXX_VERSION_NUMBER} GREATER 459)
set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-unused-but-set-variable -Wno-unused-variable ${CMAKE_CXX_FLAGS}")
# gcc 4.3 and above don't like the LL boost and also
# cause warnings due to our use of deprecated headers
if(${CXX_VERSION_NUMBER} GREATER 429)
add_definitions(-Wno-parentheses)
set(CMAKE_CXX_FLAGS "-Wno-deprecated ${CMAKE_CXX_FLAGS}")
endif (${CXX_VERSION_NUMBER} GREATER 429)
# End of hacks.
add_definitions(-Wno-parentheses)
add_definitions(
-DLL_LINUX=1
-D_REENTRANT
)
add_compile_options(
-fexceptions
-fno-math-errno
-fno-strict-aliasing
-fsigned-char
-g
-msse2
-mfpmath=sse
-pthread
@ -170,39 +130,37 @@ if (LINUX)
add_definitions(-DEXTERNAL_TOS)
add_definitions(-DAPPID=secondlife)
add_definitions(-fvisibility=hidden)
# don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The viewer doesn't need to catch SIGCHLD anyway.
add_compile_options(-fvisibility=hidden)
# don't catch SIGCHLD in our base application class for the viewer - some of
# our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The
# viewer doesn't need to catch SIGCHLD anyway.
add_definitions(-DLL_IGNORE_SIGCHLD)
if (WORD_SIZE EQUAL 32)
add_definitions(-march=pentium4)
endif (WORD_SIZE EQUAL 32)
add_definitions(-mfpmath=sse)
#add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2
if (ADDRESS_SIZE EQUAL 32)
add_compile_options(-march=pentium4)
endif (ADDRESS_SIZE EQUAL 32)
#add_compile_options(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2
if (NOT USESYSTEMLIBS)
# this stops us requiring a really recent glibc at runtime
add_definitions(-fno-stack-protector)
add_compile_options(-fno-stack-protector)
# linking can be very memory-hungry, especially the final viewer link
set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory")
endif (NOT USESYSTEMLIBS)
set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}")
endif (LINUX)
if (DARWIN)
add_definitions(-DLL_DARWIN=1)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
set(DARWIN_extra_cstar_flags "-g -Wno-unused-local-typedef -Wno-deprecated-declarations")
set(DARWIN_extra_cstar_flags "-Wno-unused-local-typedef -Wno-deprecated-declarations")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
set(ENABLE_SIGNING TRUE)
set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
## Really?? On developer machines too?
##set(ENABLE_SIGNING TRUE)
##set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
endif (DARWIN)
@ -226,22 +184,17 @@ if (LINUX OR DARWIN)
set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
if (WORD_SIZE EQUAL 32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
elseif (WORD_SIZE EQUAL 64)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
endif (WORD_SIZE EQUAL 32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m${ADDRESS_SIZE}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m${ADDRESS_SIZE}")
endif (LINUX OR DARWIN)
if (USESYSTEMLIBS)
add_definitions(-DLL_USESYSTEMLIBS=1)
if (LINUX AND ${ARCH} STREQUAL "i686")
if (LINUX AND ADDRESS_SIZE EQUAL 32)
add_definitions(-march=pentiumpro)
endif (LINUX AND ${ARCH} STREQUAL "i686")
endif (LINUX AND ADDRESS_SIZE EQUAL 32)
else (USESYSTEMLIBS)
set(${ARCH}_linux_INCLUDES

View File

@ -2,9 +2,17 @@
# Construct the version and copyright information based on package data.
include(Python)
# packages-formatter.py runs autobuild install --versions, which needs to know
# the build_directory, which (on Windows) depends on AUTOBUILD_ADDRSIZE.
# Within an autobuild build, AUTOBUILD_ADDRSIZE is already set. But when
# building in an IDE, it probably isn't. Set it explicitly using
# run_build_test.py.
add_custom_command(OUTPUT packages-info.txt
COMMENT Generating packages-info.txt for the about box
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/../autobuild.xml
DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py > packages-info.txt
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_SOURCE_DIR}/cmake/run_build_test.py -DAUTOBUILD_ADDRSIZE=${ADDRESS_SIZE}
${PYTHON_EXECUTABLE}
${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py "${VIEWER_CHANNEL}" "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}" > packages-info.txt
)

View File

@ -54,7 +54,7 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n
endif ("${VIEWER_VERSION_REVISION}" STREQUAL "")
set(VIEWER_CHANNEL_VERSION_DEFINES
"LL_VIEWER_CHANNEL=\"${VIEWER_CHANNEL}\""
"LL_VIEWER_CHANNEL=${VIEWER_CHANNEL}"
"LL_VIEWER_VERSION_MAJOR=${VIEWER_VERSION_MAJOR}"
"LL_VIEWER_VERSION_MINOR=${VIEWER_VERSION_MINOR}"
"LL_VIEWER_VERSION_PATCH=${VIEWER_VERSION_PATCH}"

View File

@ -30,7 +30,6 @@ set(cmake_SOURCE_FILES
FindFMODEX.cmake
FindGLH.cmake
FindGoogleBreakpad.cmake
FindGooglePerfTools.cmake
FindHUNSPELL.cmake
FindJsonCpp.cmake
FindNDOF.cmake
@ -46,11 +45,8 @@ set(cmake_SOURCE_FILES
GLOD.cmake
## GStreamer010Plugin.cmake
GetPrerequisites_2_8.cmake
## Glui.cmake
Glut.cmake
GoogleBreakpad.cmake
GoogleMock.cmake
GooglePerfTools.cmake
Havok.cmake
Hunspell.cmake
JPEG.cmake
@ -90,7 +86,6 @@ set(cmake_SOURCE_FILES
Prebuilt.cmake
PulseAudio.cmake
Python.cmake
QuickTimePlugin.cmake
TemplateCheck.cmake
Tut.cmake
UI.cmake

View File

@ -6,17 +6,17 @@ SET(DEBUG_PKG_CONFIG "YES")
IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "")
# Guess at architecture-specific system library paths.
if (WORD_SIZE EQUAL 32)
if (ADDRESS_SIZE EQUAL 32)
SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib32 /usr/lib)
SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib32 /usr/local/lib)
SET(PKG_CONFIG_MULTI_GUESS /usr/lib/i386-linux-gnu)
SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/i386-linux-gnu)
else (WORD_SIZE EQUAL 32)
else (ADDRESS_SIZE EQUAL 32)
SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib64 /usr/lib)
SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib64 /usr/local/lib)
SET(PKG_CONFIG_MULTI_GUESS /usr/local/lib/x86_64-linux-gnu)
SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu)
endif (WORD_SIZE EQUAL 32)
endif (ADDRESS_SIZE EQUAL 32)
# Use DPKG architecture, if available.
IF (${DPKG_ARCH})

View File

@ -30,18 +30,6 @@ if(WINDOWS)
#*******************************
# Misc shared libs
set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
set(debug_files
openjpegd.dll
libapr-1.dll
libaprutil-1.dll
libapriconv-1.dll
ssleay32.dll
libeay32.dll
glod.dll
libhunspell.dll
)
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(release_files
openjpeg.dll
@ -54,14 +42,13 @@ if(WINDOWS)
libhunspell.dll
)
if(USE_TCMALLOC)
set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll)
set(release_files ${release_files} libtcmalloc_minimal.dll)
endif(USE_TCMALLOC)
if (FMODEX)
set(debug_files ${debug_files} fmodexL.dll)
set(release_files ${release_files} fmodex.dll)
if(ADDRESS_SIZE EQUAL 32)
set(release_files ${release_files} fmodex.dll)
else(ADDRESS_SIZE EQUAL 32)
set(release_files ${release_files} fmodex64.dll)
endif(ADDRESS_SIZE EQUAL 32)
endif (FMODEX)
#*******************************
@ -175,10 +162,8 @@ elseif(DARWIN)
libaprutil-1.0.dylib
libaprutil-1.dylib
libexception_handler.dylib
libexpat.1.5.2.dylib
libexpat.dylib
${EXPAT_COPY}
libGLOD.dylib
libhunspell-1.3.0.dylib
libndofdev.dylib
)
@ -218,8 +203,7 @@ elseif(LINUX)
libaprutil-1.so.0
libatk-1.0.so
libdb-5.1.so
libexpat.so
libexpat.so.1
${EXPAT_COPY}
libfreetype.so.6.6.2
libfreetype.so.6
libGLOD.so
@ -234,10 +218,6 @@ elseif(LINUX)
libfontconfig.so.1
)
if (USE_TCMALLOC)
set(release_files ${release_files} "libtcmalloc_minimal.so")
endif (USE_TCMALLOC)
if (FMODEX)
set(debug_files ${debug_files} "libfmodexL.so")
set(release_files ${release_files} "libfmodex.so")
@ -294,13 +274,13 @@ set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${debug_src_dir}
"${SHARED_LIB_STAGING_DIR_DEBUG}"
out_targets
${debug_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
#copy_if_different(
# ${debug_src_dir}
# "${SHARED_LIB_STAGING_DIR_DEBUG}"
# out_targets
# ${debug_files}
# )
#set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${release_src_dir}

View File

@ -12,7 +12,7 @@
get_filename_component(current_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
include(${current_dir}/GetPrerequisites_2_8.cmake)
message("Getting recursive dependencies for file: ${BIN_NAME}")
message(STATUS "Getting recursive dependencies for file: ${BIN_NAME}")
set(EXCLUDE_SYSTEM 1)
set(RECURSE 1)
@ -21,7 +21,7 @@ get_filename_component(EXE_PATH ${BIN_NAME} PATH)
get_prerequisites( ${BIN_NAME} RESULTS ${EXCLUDE_SYSTEM} ${RECURSE} "${EXE_PATH}" "${SEARCH_DIRS}" )
foreach(DEP ${RESULTS})
Message("Processing dependency: ${DEP}")
Message(STATUS "Processing dependency: ${DEP}")
get_filename_component(DEP_FILE ${DEP} NAME)
set(DEP_FILES ${DEP_FILES} ${DEP_FILE})
endforeach(DEP)
@ -64,10 +64,10 @@ if(FOUND_FILES)
foreach(FILE ${FOUND_FILES})
get_filename_component(DST_FILE ${FILE} NAME)
set(DST_FILE "${DST_PATH}/${DST_FILE}")
message("Copying ${FILE} to ${DST_FILE}")
message(STATUS "Copying ${FILE} to ${DST_FILE}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FILE} ${DST_FILE}
)
endforeach(FILE ${FOUND_FILES})
endif(FOUND_FILES)
message("Success!")

View File

@ -10,8 +10,14 @@ else (USESYSTEMLIBS)
use_prebuilt_binary(expat)
if (WINDOWS)
set(EXPAT_LIBRARIES libexpatMT)
set(EXPAT_COPY libexpatMT.dll)
else (WINDOWS)
set(EXPAT_LIBRARIES expat)
if (DARWIN)
set(EXPAT_COPY libexpat.1.dylib libexpat.dylib)
else ()
set(EXPAT_COPY libexpat.so.1 libexpat.so)
endif ()
endif (WINDOWS)
set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (USESYSTEMLIBS)

View File

@ -10,7 +10,7 @@ find_path(HUNSPELL_INCLUDE_DIR hunspell.h
PATH_SUFFIXES hunspell
)
set(HUNSPELL_NAMES ${HUNSPELL_NAMES} libhunspell-1.3.0 libhunspell)
set(HUNSPELL_NAMES ${HUNSPELL_NAMES} libhunspell-1.3 libhunspell)
find_library(HUNSPELL_LIBRARY
NAMES ${HUNSPELL_NAMES}
)

View File

@ -5,6 +5,6 @@ if (NOT USESYSTEMLIBS)
if (WINDOWS OR LINUX)
use_prebuilt_binary(glext)
endif (WINDOWS OR LINUX)
use_prebuilt_binary(glh-linear)
use_prebuilt_binary(glh_linear)
set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
endif (NOT USESYSTEMLIBS)

View File

@ -7,5 +7,5 @@ set(GLH_FIND_QUIETLY TRUE)
if (USESYSTEMLIBS)
include(FindGLH)
else (USESYSTEMLIBS)
use_prebuilt_binary(glh-linear)
use_prebuilt_binary(glh_linear)
endif (USESYSTEMLIBS)

View File

@ -1,28 +0,0 @@
# -*- cmake -*-
include(Linking)
include(Prebuilt)
if (USESYSTEMLIBS)
set(GLUI OFF CACHE BOOL
"GLUI support for the llplugin/llmedia test apps.")
else (USESYSTEMLIBS)
use_prebuilt_binary(glui)
set(GLUI ON CACHE BOOL
"GLUI support for the llplugin/llmedia test apps.")
endif (USESYSTEMLIBS)
if (LINUX)
set(GLUI ON CACHE BOOL
"llplugin media apps HACK for Linux.")
endif (LINUX)
if (DARWIN OR LINUX)
set(GLUI_LIBRARY
glui)
endif (DARWIN OR LINUX)
if (WINDOWS)
set(GLUI_LIBRARY
debug glui32.lib
optimized glui32.lib)
endif (WINDOWS)

View File

@ -1,19 +0,0 @@
# -*- cmake -*-
include(Linking)
include(Prebuilt)
if (WINDOWS)
use_prebuilt_binary(freeglut)
set(GLUT_LIBRARY
debug freeglut_static.lib
optimized freeglut_static.lib)
endif (WINDOWS)
if (LINUX)
FIND_LIBRARY(GLUT_LIBRARY glut)
endif (LINUX)
if (DARWIN)
include(CMakeFindFrameworks)
find_library(GLUT_LIBRARY GLUT)
endif (DARWIN)

View File

@ -1,61 +0,0 @@
# -*- cmake -*-
include(Prebuilt)
# If you want to enable or disable TCMALLOC in viewer builds, this is the place.
# set ON or OFF as desired.
set (USE_TCMALLOC OFF)
if (USESYSTEMLIBS)
include(FindGooglePerfTools)
else (USESYSTEMLIBS)
if (WINDOWS)
if (USE_TCMALLOC)
use_prebuilt_binary(gperftools)
set(TCMALLOC_LIBRARIES
debug libtcmalloc_minimal-debug
optimized libtcmalloc_minimal)
set(TCMALLOC_LINK_FLAGS "/INCLUDE:__tcmalloc")
else (USE_TCMALLOC)
set(TCMALLOC_LIBRARIES)
set(TCMALLOC_LINK_FLAGS)
endif (USE_TCMALLOC)
set(GOOGLE_PERFTOOLS_FOUND "YES")
endif (WINDOWS)
if (LINUX)
if (USE_TCMALLOC)
use_prebuilt_binary(gperftools)
set(TCMALLOC_LIBRARIES
tcmalloc)
else (USE_TCMALLOC)
set(TCMALLOC_LIBRARIES)
endif (USE_TCMALLOC)
set(PROFILER_LIBRARIES profiler)
set(GOOGLE_PERFTOOLS_INCLUDE_DIR
${LIBS_PREBUILT_DIR}/include)
set(GOOGLE_PERFTOOLS_FOUND "YES")
endif (LINUX)
endif (USESYSTEMLIBS)
if (GOOGLE_PERFTOOLS_FOUND)
# XXX Disable temporarily, until we have compilation issues on 64-bit
# Etch sorted.
set(USE_GOOGLE_PERFTOOLS OFF CACHE BOOL "Build with Google PerfTools support.")
endif (GOOGLE_PERFTOOLS_FOUND)
if (WINDOWS)
set(USE_GOOGLE_PERFTOOLS ON)
endif (WINDOWS)
if (USE_GOOGLE_PERFTOOLS)
if (USE_TCMALLOC)
set(TCMALLOC_FLAG -DLL_USE_TCMALLOC=1)
else (USE_TCMALLOC)
set(TCMALLOC_FLAG -ULL_USE_TCMALLOC)
endif (USE_TCMALLOC)
endif (USE_GOOGLE_PERFTOOLS)
if (USE_GOOGLE_PERFTOOLS)
include_directories(${GOOGLE_PERFTOOLS_INCLUDE_DIR})
set(GOOGLE_PERFTOOLS_LIBRARIES ${TCMALLOC_LIBRARIES} ${STACKTRACE_LIBRARIES} ${PROFILER_LIBRARIES})
else (USE_GOOGLE_PERFTOOLS)
endif (USE_GOOGLE_PERFTOOLS)

View File

@ -11,7 +11,7 @@ else (USESYSTEMLIBS)
if (WINDOWS)
set(HUNSPELL_LIBRARY libhunspell)
elseif(DARWIN)
set(HUNSPELL_LIBRARY hunspell-1.3.0)
set(HUNSPELL_LIBRARY hunspell-1.3)
elseif(LINUX)
set(HUNSPELL_LIBRARY hunspell-1.3)
else()

View File

@ -4,7 +4,6 @@ include(APR)
include(Boost)
include(EXPAT)
include(ZLIB)
include(GooglePerfTools)
set(LLCOMMON_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llcommon
@ -34,8 +33,6 @@ else (LINUX)
${BOOST_SYSTEM_LIBRARY} )
endif (LINUX)
# add_definitions(${TCMALLOC_FLAG})
set(LLCOMMON_LINK_SHARED OFF CACHE BOOL "Build the llcommon target as a static library.")
if(LLCOMMON_LINK_SHARED)
add_definitions(-DLL_COMMON_LINK_SHARED=1)

View File

@ -39,7 +39,7 @@ macro (use_prebuilt_binary _binary)
if(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
if(DEBUG_PREBUILT)
message("cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install
message(STATUS "cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install
--install-dir=${AUTOBUILD_INSTALL_DIR}
${_binary} ")
endif(DEBUG_PREBUILT)

View File

@ -1,48 +0,0 @@
# -*- cmake -*-
if(INSTALL_PROPRIETARY)
include(Prebuilt)
if (WINDOWS)
use_prebuilt_binary(quicktime)
endif (WINDOWS)
endif(INSTALL_PROPRIETARY)
if (DARWIN)
include(CMakeFindFrameworks)
find_library(QUICKTIME_LIBRARY QuickTime)
elseif (WINDOWS)
set(QUICKTIME_SDK_DIR "$ENV{PROGRAMFILES}/QuickTime SDK"
CACHE PATH "Location of the QuickTime SDK.")
find_library(DEBUG_QUICKTIME_LIBRARY qtmlclient.lib
PATHS
${ARCH_PREBUILT_DIRS_DEBUG}
"${QUICKTIME_SDK_DIR}\\libraries"
)
find_library(RELEASE_QUICKTIME_LIBRARY qtmlclient.lib
PATHS
${ARCH_PREBUILT_DIRS_RELEASE}
"${QUICKTIME_SDK_DIR}\\libraries"
)
if (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY)
set(QUICKTIME_LIBRARY
optimized ${RELEASE_QUICKTIME_LIBRARY}
debug ${DEBUG_QUICKTIME_LIBRARY}
)
endif (DEBUG_QUICKTIME_LIBRARY AND RELEASE_QUICKTIME_LIBRARY)
include_directories(
${LIBS_PREBUILT_DIR}/include/quicktime
"${QUICKTIME_SDK_DIR}\\CIncludes"
)
endif (DARWIN)
mark_as_advanced(QUICKTIME_LIBRARY)
if (QUICKTIME_LIBRARY)
set(QUICKTIME ON CACHE BOOL "Build with QuickTime streaming media support.")
endif (QUICKTIME_LIBRARY)

View File

@ -32,9 +32,9 @@ if (USESYSTEMLIBS)
add_definitions(${${pkg}_CFLAGS_OTHERS})
endforeach(pkg)
else (USESYSTEMLIBS)
if (LINUX OR WINDOWS)
if (LINUX)
use_prebuilt_binary(gtk-atk-pango-glib)
endif (LINUX OR WINDOWS)
endif (LINUX)
if (LINUX)
set(UI_LIBRARIES

View File

@ -9,6 +9,12 @@
# LINUX - Linux
# WINDOWS - Windows
# Switches set here and in 00-Common.cmake must agree with
# https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables
# Reading $LL_BUILD is an attempt to directly use those switches.
if ("$ENV{LL_BUILD}" STREQUAL "")
message(FATAL_ERROR "Environment variable LL_BUILD must be set")
endif ()
# Relative and absolute paths to subtrees.
@ -60,46 +66,55 @@ if (NOT CMAKE_BUILD_TYPE)
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
endif (NOT CMAKE_BUILD_TYPE)
# If someone has specified an address size, use that to determine the
# architecture. Otherwise, let the architecture specify the address size.
if (ADDRESS_SIZE EQUAL 32)
#message(STATUS "ADDRESS_SIZE is 32")
set(ARCH i686)
elseif (ADDRESS_SIZE EQUAL 64)
#message(STATUS "ADDRESS_SIZE is 64")
set(ARCH x86_64)
else (ADDRESS_SIZE EQUAL 32)
#message(STATUS "ADDRESS_SIZE is UNRECOGNIZED: '${ADDRESS_SIZE}'")
# Use Python's platform.machine() since uname -m isn't available everywhere.
# Even if you can assume cygwin uname -m, the answer depends on whether
# you're running 32-bit cygwin or 64-bit cygwin! But even 32-bit Python will
# report a 64-bit processor.
execute_process(COMMAND
"${PYTHON_EXECUTABLE}" "-c"
"import platform; print platform.machine()"
OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
# We expect values of the form i386, i686, x86_64, AMD64.
# In CMake, expressing ARCH.endswith('64') is awkward:
string(LENGTH "${ARCH}" ARCH_LENGTH)
math(EXPR ARCH_LEN_2 "${ARCH_LENGTH} - 2")
string(SUBSTRING "${ARCH}" ${ARCH_LEN_2} 2 ARCH_LAST_2)
if (ARCH_LAST_2 STREQUAL 64)
#message(STATUS "ARCH is detected as 64; ARCH is ${ARCH}")
set(ADDRESS_SIZE 64)
else ()
#message(STATUS "ARCH is detected as 32; ARCH is ${ARCH}")
set(ADDRESS_SIZE 32)
endif ()
endif (ADDRESS_SIZE EQUAL 32)
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(WINDOWS ON BOOL FORCE)
set(ARCH i686)
set(LL_ARCH ${ARCH}_win32)
set(LL_ARCH_DIR ${ARCH}-win32)
set(WORD_SIZE 32)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LINUX ON BOOl FORCE)
# If someone has specified a word size, use that to determine the
# architecture. Otherwise, let the architecture specify the word size.
if (WORD_SIZE EQUAL 32)
#message(STATUS "WORD_SIZE is 32")
set(ARCH i686)
elseif (WORD_SIZE EQUAL 64)
#message(STATUS "WORD_SIZE is 64")
set(ARCH x86_64)
else (WORD_SIZE EQUAL 32)
#message(STATUS "WORD_SIZE is UNDEFINED")
execute_process(COMMAND uname -m COMMAND sed s/i.86/i686/
OUTPUT_VARIABLE ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
if (ARCH STREQUAL x86_64)
#message(STATUS "ARCH is detected as 64; ARCH is ${ARCH}")
set(WORD_SIZE 64)
else (ARCH STREQUAL x86_64)
#message(STATUS "ARCH is detected as 32; ARCH is ${ARCH}")
set(WORD_SIZE 32)
endif (ARCH STREQUAL x86_64)
endif (WORD_SIZE EQUAL 32)
if (WORD_SIZE EQUAL 32)
if (ADDRESS_SIZE EQUAL 32)
set(DEB_ARCHITECTURE i386)
set(FIND_LIBRARY_USE_LIB64_PATHS OFF)
set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib32 ${CMAKE_SYSTEM_LIBRARY_PATH})
else (WORD_SIZE EQUAL 32)
else (ADDRESS_SIZE EQUAL 32)
set(DEB_ARCHITECTURE amd64)
set(FIND_LIBRARY_USE_LIB64_PATHS ON)
endif (WORD_SIZE EQUAL 32)
endif (ADDRESS_SIZE EQUAL 32)
execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH
RESULT_VARIABLE DPKG_RESULT
@ -129,29 +144,45 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DARWIN 1)
# now we only support Xcode 7.0 using 10.11 (El Capitan), minimum OS 10.7 (Lion)
string(REGEX MATCH "-mmacosx-version-min=([^ ]+)" scratch "$ENV{LL_BUILD}")
set(CMAKE_OSX_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}")
message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET = '${CMAKE_OSX_DEPLOYMENT_TARGET}'")
string(REGEX MATCH "-stdlib=([^ ]+)" scratch "$ENV{LL_BUILD}")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "${CMAKE_MATCH_1}")
message(STATUS "CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY = '${CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY}'")
string(REGEX MATCH " -g([^ ]*)" scratch "$ENV{LL_BUILD}")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "${CMAKE_MATCH_1}")
message(STATUS "CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT = '${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}'")
string(REGEX MATCH "-O([^ ]*)" scratch "$ENV{LL_BUILD}")
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL "${CMAKE_MATCH_1}")
message(STATUS "CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL = '${CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL}'")
string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}")
list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx)
if ("${sysroot_idx}" LESS 0)
message(FATAL_ERROR "Environment variable LL_BUILD must contain '-iwithsysroot'")
endif ()
math(EXPR sysroot_idx "${sysroot_idx} + 1")
list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT)
message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'")
set(XCODE_VERSION 7.0)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
set(CMAKE_OSX_SYSROOT macosx10.11)
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL 3)
set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO)
set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS ssse3)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
# Build only for i386 by default, system default on MacOSX 10.6+ is x86_64
if (NOT CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES "i386")
endif (NOT CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES "${ARCH}")
string(REPLACE "i686" "i386" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
string(REPLACE "AMD64" "x86_64" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")
set(ARCH ${CMAKE_OSX_ARCHITECTURES})
set(LL_ARCH ${ARCH}_darwin)
set(LL_ARCH_DIR universal-darwin)
set(WORD_SIZE 32)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# Default deploy grid

View File

@ -104,21 +104,23 @@ add_custom_command(TARGET llimage_libtest POST_BUILD
if (DARWIN)
# Copy the required libraries to the package app
add_custom_command(TARGET llimage_libtest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libapr-1.0.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR}
DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libapr-1.0.dylib
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libapr-1.0.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libapr-1.0.dylib
)
add_custom_command(TARGET llimage_libtest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libaprutil-1.0.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR}
DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libaprutil-1.0.dylib
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libaprutil-1.0.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libaprutil-1.0.dylib
)
add_custom_command(TARGET llimage_libtest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexception_handler.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR}
DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexception_handler.dylib
)
add_custom_command(TARGET llimage_libtest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexpat.1.5.2.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR}
DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexpat.1.5.2.dylib
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libexception_handler.dylib ${LLIMAGE_LIBTEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libexception_handler.dylib
)
foreach(expat ${EXPAT_COPY})
add_custom_command(TARGET llimage_libtest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/${expat} ${LLIMAGE_LIBTEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/${expat}
)
endforeach(expat)
endif (DARWIN)
if (WINDOWS)

View File

@ -2126,5 +2126,3 @@ LLAvatarAppearance::LLMaskedMorph::LLMaskedMorph(LLVisualParam *morph_target, BO
}
}

View File

@ -10,7 +10,6 @@ include(Boost)
include(LLSharedLibs)
include(JsonCpp)
include(GoogleBreakpad)
include(GooglePerfTools)
include(Copy3rdPartyLibs)
include(ZLIB)
include(URIPARSER)
@ -259,13 +258,13 @@ list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES})
if(LLCOMMON_LINK_SHARED)
add_library (llcommon SHARED ${llcommon_SOURCE_FILES})
if(NOT WORD_SIZE EQUAL 32)
if(NOT ADDRESS_SIZE EQUAL 32)
if(WINDOWS)
add_definitions(/FIXED:NO)
##add_definitions(/FIXED:NO)
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
add_definitions(-fPIC)
endif(WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
endif(NOT ADDRESS_SIZE EQUAL 32)
if(WINDOWS)
# always generate llcommon.pdb, even for "Release" builds
set_target_properties(llcommon PROPERTIES LINK_FLAGS "/DEBUG")
@ -350,8 +349,4 @@ if (LL_TESTS)
## throwing and catching exceptions.
##LL_ADD_INTEGRATION_TEST(llexception "" "${test_libs}")
# *TODO - reenable these once tcmalloc libs no longer break the build.
#ADD_BUILD_TEST(llallocator llcommon)
#ADD_BUILD_TEST(llallocator_heap_profile llcommon)
#ADD_BUILD_TEST(llmemtype llcommon)
endif (LL_TESTS)

View File

@ -27,47 +27,6 @@
#include "linden_common.h"
#include "llallocator.h"
#if (LL_USE_TCMALLOC && LL_USE_HEAP_PROFILER)
#include "google/heap-profiler.h"
#include "google/commandlineflags_public.h"
DECLARE_bool(heap_profile_use_stack_trace);
//DECLARE_double(tcmalloc_release_rate);
void LLAllocator::setProfilingEnabled(bool should_enable)
{
// NULL disables dumping to disk
static char const * const PREFIX = NULL;
if(should_enable)
{
HeapProfilerSetUseStackTrace(false);
HeapProfilerStart(PREFIX);
}
else
{
HeapProfilerStop();
}
}
// static
bool LLAllocator::isProfiling()
{
return IsHeapProfilerRunning();
}
std::string LLAllocator::getRawProfile()
{
// *TODO - fix google-perftools to accept an buffer to avoid this
// malloc-copy-free cycle.
char * buffer = GetHeapProfile();
std::string ret = buffer;
free(buffer);
return ret;
}
#else // LL_USE_TCMALLOC
//
// stub implementations for when tcmalloc is disabled
//
@ -87,8 +46,6 @@ std::string LLAllocator::getRawProfile()
return std::string();
}
#endif // LL_USE_TCMALLOC
LLAllocatorHeapProfile const & LLAllocator::getProfile()
{
mProf.mLines.clear();

View File

@ -151,7 +151,11 @@ LLCoros::LLCoros():
// Previously we used
// boost::context::guarded_stack_allocator::default_stacksize();
// empirically this is 64KB on Windows and Linux. Try quadrupling.
#if ADDRESS_SIZE == 64
mStackSize(512*1024)
#else
mStackSize(256*1024)
#endif
{
// Register our cleanup() method for "mainloop" ticks
LLEventPumps::instance().obtain("mainloop").listen(

View File

@ -124,8 +124,8 @@ public:
virtual std::string describe(bool full=true) const;
protected:
typedef std::vector< std::pair<int, int> > EdgeList;
typedef std::vector<int> VertexList;
typedef std::vector< std::pair<std::size_t, std::size_t> > EdgeList;
typedef std::vector<std::size_t> VertexList;
VertexList topo_sort(int vertices, const EdgeList& edges) const;
/**
@ -508,7 +508,7 @@ public:
// been explicitly added. Rely on std::map rejecting a second attempt
// to insert the same key. Use the map's size() as the vertex number
// to get a distinct value for each successful insertion.
typedef std::map<KEY, int> VertexMap;
typedef std::map<KEY, std::size_t> VertexMap;
VertexMap vmap;
// Nest each of these loops because !@#$%? MSVC warns us that its
// former broken behavior has finally been fixed -- and our builds

View File

@ -90,33 +90,15 @@ public:
#if LL_FASTTIMER_USE_RDTSC
static U32 getCPUClockCount32()
{
U32 ret_val;
__asm
{
_emit 0x0f
_emit 0x31
shr eax,8
shl edx,24
or eax, edx
mov dword ptr [ret_val], eax
}
return ret_val;
unsigned __int64 val = __rdtsc();
val = val >> 8;
return static_cast<U32>(val);
}
// return full timer value, *not* shifted by 8 bits
static U64 getCPUClockCount64()
{
U64 ret_val;
__asm
{
_emit 0x0f
_emit 0x31
mov eax,eax
mov edx,edx
mov dword ptr [ret_val+4], edx
mov dword ptr [ret_val], eax
}
return ret_val;
return static_cast<U64>( __rdtsc() );
}
#else
@ -173,16 +155,16 @@ public:
// Mac+Linux+Solaris FAST x86 implementation of CPU clock
static U32 getCPUClockCount32()
{
U64 x;
__asm__ volatile (".byte 0x0f, 0x31": "=A"(x));
return (U32)(x >> 8);
U32 low(0),high(0);
__asm__ volatile (".byte 0x0f, 0x31": "=a"(low), "=d"(high) );
return (low>>8) | (high<<24);
}
static U64 getCPUClockCount64()
{
U64 x;
__asm__ volatile (".byte 0x0f, 0x31": "=A"(x));
return x;
U32 low(0),high(0);
__asm__ volatile (".byte 0x0f, 0x31": "=a"(low), "=d"(high) );
return (U64)low | ( ((U64)high) << 32);
}
#endif

View File

@ -45,7 +45,7 @@ typedef FILE LLFILE;
typedef struct _stat llstat;
#else
typedef struct stat llstat;
#include <bits/postypes.h>
#include <sys/types.h>
#endif
#ifndef S_ISREG

View File

@ -12,12 +12,10 @@
*
* also relevant:
*
* Template parameter deduction for constructors
* http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0091r0.html
*
* https://github.com/viboes/std-make
*
* but obviously we're not there yet.
* Template argument deduction for class templates
* http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0091r3.html
* was apparently adopted in June 2016? Unclear when compilers will
* portably support this, but there is hope.
*
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
* Copyright (c) 2015, Linden Research, Inc.

View File

@ -591,7 +591,7 @@ char* LLPrivateMemoryPool::LLMemoryBlock::allocate()
void LLPrivateMemoryPool::LLMemoryBlock::freeMem(void* addr)
{
//bit index
U32 idx = ((U32)addr - (U32)mBuffer - mDummySize) / mSlotSize ;
uintptr_t idx = ((uintptr_t)addr - (uintptr_t)mBuffer - mDummySize) / mSlotSize ;
U32* bits = &mUsageBits ;
if(idx >= 32)
@ -773,7 +773,7 @@ char* LLPrivateMemoryPool::LLMemoryChunk::allocate(U32 size)
void LLPrivateMemoryPool::LLMemoryChunk::freeMem(void* addr)
{
U32 blk_idx = getPageIndex((U32)addr) ;
U32 blk_idx = getPageIndex((uintptr_t)addr) ;
LLMemoryBlock* blk = (LLMemoryBlock*)(mMetaBuffer + blk_idx * sizeof(LLMemoryBlock)) ;
blk = blk->mSelf ;
@ -798,7 +798,7 @@ bool LLPrivateMemoryPool::LLMemoryChunk::empty()
bool LLPrivateMemoryPool::LLMemoryChunk::containsAddress(const char* addr) const
{
return (U32)mBuffer <= (U32)addr && (U32)mBuffer + mBufferSize > (U32)addr ;
return (uintptr_t)mBuffer <= (uintptr_t)addr && (uintptr_t)mBuffer + mBufferSize > (uintptr_t)addr ;
}
//debug use
@ -831,13 +831,13 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump()
for(U32 i = 1 ; i < blk_list.size(); i++)
{
total_size += blk_list[i]->getBufferSize() ;
if((U32)blk_list[i]->getBuffer() < (U32)blk_list[i-1]->getBuffer() + blk_list[i-1]->getBufferSize())
if((uintptr_t)blk_list[i]->getBuffer() < (uintptr_t)blk_list[i-1]->getBuffer() + blk_list[i-1]->getBufferSize())
{
LL_ERRS() << "buffer corrupted." << LL_ENDL ;
}
}
llassert_always(total_size + mMinBlockSize >= mBufferSize - ((U32)mDataBuffer - (U32)mBuffer)) ;
llassert_always(total_size + mMinBlockSize >= mBufferSize - ((uintptr_t)mDataBuffer - (uintptr_t)mBuffer)) ;
U32 blk_num = (mBufferSize - (mDataBuffer - mBuffer)) / mMinBlockSize ;
for(U32 i = 0 ; i < blk_num ; )
@ -860,7 +860,7 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump()
#endif
#if 0
LL_INFOS() << "---------------------------" << LL_ENDL ;
LL_INFOS() << "Chunk buffer: " << (U32)getBuffer() << " size: " << getBufferSize() << LL_ENDL ;
LL_INFOS() << "Chunk buffer: " << (uintptr_t)getBuffer() << " size: " << getBufferSize() << LL_ENDL ;
LL_INFOS() << "available blocks ... " << LL_ENDL ;
for(S32 i = 0 ; i < mBlockLevels ; i++)
@ -868,7 +868,7 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump()
LLMemoryBlock* blk = mAvailBlockList[i] ;
while(blk)
{
LL_INFOS() << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ;
LL_INFOS() << "blk buffer " << (uintptr_t)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ;
blk = blk->mNext ;
}
}
@ -879,7 +879,7 @@ void LLPrivateMemoryPool::LLMemoryChunk::dump()
LLMemoryBlock* blk = mFreeSpaceList[i] ;
while(blk)
{
LL_INFOS() << "blk buffer " << (U32)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ;
LL_INFOS() << "blk buffer " << (uintptr_t)blk->getBuffer() << " size: " << blk->getBufferSize() << LL_ENDL ;
blk = blk->mNext ;
}
}
@ -1155,9 +1155,9 @@ void LLPrivateMemoryPool::LLMemoryChunk::addToAvailBlockList(LLMemoryBlock* blk)
return ;
}
U32 LLPrivateMemoryPool::LLMemoryChunk::getPageIndex(U32 addr)
U32 LLPrivateMemoryPool::LLMemoryChunk::getPageIndex(uintptr_t addr)
{
return (addr - (U32)mDataBuffer) / mMinBlockSize ;
return (addr - (uintptr_t)mDataBuffer) / mMinBlockSize ;
}
//for mAvailBlockList
@ -1495,7 +1495,7 @@ void LLPrivateMemoryPool::removeChunk(LLMemoryChunk* chunk)
U16 LLPrivateMemoryPool::findHashKey(const char* addr)
{
return (((U32)addr) / CHUNK_SIZE) % mHashFactor ;
return (((uintptr_t)addr) / CHUNK_SIZE) % mHashFactor ;
}
LLPrivateMemoryPool::LLMemoryChunk* LLPrivateMemoryPool::findChunk(const char* addr)
@ -1720,7 +1720,7 @@ LLPrivateMemoryPoolManager::~LLPrivateMemoryPoolManager()
S32 k = 0 ;
for(mem_allocation_info_t::iterator iter = sMemAllocationTracker.begin() ; iter != sMemAllocationTracker.end() ; ++iter)
{
LL_INFOS() << k++ << ", " << (U32)iter->first << " : " << iter->second << LL_ENDL ;
LL_INFOS() << k++ << ", " << (uintptr_t)iter->first << " : " << iter->second << LL_ENDL ;
}
sMemAllocationTracker.clear() ;
}

View File

@ -138,7 +138,6 @@ template <typename T> T* LL_NEXT_ALIGNED_ADDRESS_64(T* address)
//------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------
#if !LL_USE_TCMALLOC
inline void* ll_aligned_malloc_16(size_t size) // returned hunk MUST be freed with ll_aligned_free_16().
{
#if defined(LL_WINDOWS)
@ -187,13 +186,6 @@ inline void* ll_aligned_realloc_16(void* ptr, size_t size, size_t old_size) // r
#endif
}
#else // USE_TCMALLOC
// ll_aligned_foo_16 are not needed with tcmalloc
#define ll_aligned_malloc_16 malloc
#define ll_aligned_realloc_16(a,b,c) realloc(a,b)
#define ll_aligned_free_16 free
#endif // USE_TCMALLOC
inline void* ll_aligned_malloc_32(size_t size) // returned hunk MUST be freed with ll_aligned_free_32().
{
#if defined(LL_WINDOWS)
@ -423,7 +415,7 @@ public:
{
bool operator()(const LLMemoryBlock* const& lhs, const LLMemoryBlock* const& rhs)
{
return (U32)lhs->getBuffer() < (U32)rhs->getBuffer();
return (uintptr_t)lhs->getBuffer() < (uintptr_t)rhs->getBuffer();
}
};
};
@ -454,7 +446,7 @@ public:
void dump() ;
private:
U32 getPageIndex(U32 addr) ;
U32 getPageIndex(uintptr_t addr) ;
U32 getBlockLevel(U32 size) ;
U16 getPageLevel(U32 size) ;
LLMemoryBlock* addBlock(U32 blk_idx) ;

View File

@ -138,6 +138,12 @@
#pragma warning( 3 : 4266 ) // 'function' : no override available for virtual member function from base 'type'; function is hidden
#pragma warning (disable : 4180) // qualifier applied to function type has no meaning; ignored
//#pragma warning( disable : 4284 ) // silly MS warning deep inside their <map> include file
#if ADDRESS_SIZE == 64
// That one is all over the place for x64 builds.
#pragma warning( disable : 4267 ) // 'var' : conversion from 'size_t' to 'type', possible loss of data)
#endif
#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
#pragma warning( disable : 4996 ) // warning: deprecated

View File

@ -398,7 +398,7 @@ static F64 calculate_cpu_frequency(U32 measure_msecs)
HANDLE hThread = GetCurrentThread();
unsigned long dwCurPriorityClass = GetPriorityClass(hProcess);
int iCurThreadPriority = GetThreadPriority(hThread);
unsigned long dwProcessMask, dwSystemMask, dwNewMask = 1;
DWORD_PTR dwProcessMask, dwSystemMask, dwNewMask = 1;
GetProcessAffinityMask(hProcess, &dwProcessMask, &dwSystemMask);
SetPriorityClass(hProcess, REALTIME_PRIORITY_CLASS);

View File

@ -443,7 +443,7 @@ public:
struct LLDictionaryLess
{
public:
bool operator()(const std::string& a, const std::string& b)
bool operator()(const std::string& a, const std::string& b) const
{
return (LLStringUtil::precedesDict(a, b) ? true : false);
}

View File

@ -63,7 +63,7 @@ void set_thread_name( DWORD dwThreadID, const char* threadName)
__try
{
::RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (DWORD*)&info );
::RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (ULONG_PTR*)&info );
}
__except(EXCEPTION_CONTINUE_EXECUTION)
{

View File

@ -148,7 +148,7 @@ if (LL_TESTS)
if (DARWIN)
# Path inside the app bundle where we'll need to copy libraries
set(LL_TEST_DESTINATION_DIR
${CMAKE_SOURCE_DIR}/../build-darwin-i386/sharedlibs/Resources
${CMAKE_BINARY_DIR}/sharedlibs/Resources
)
# Create the Contents/Resources directory
@ -164,21 +164,23 @@ if (DARWIN)
# Copy the required libraries to the package app
add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libapr-1.0.dylib ${LL_TEST_DESTINATION_DIR}
DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libapr-1.0.dylib
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libapr-1.0.dylib ${LL_TEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libapr-1.0.dylib
)
add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libaprutil-1.0.dylib ${LL_TEST_DESTINATION_DIR}
DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libaprutil-1.0.dylib
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libaprutil-1.0.dylib ${LL_TEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libaprutil-1.0.dylib
)
add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexception_handler.dylib ${LL_TEST_DESTINATION_DIR}
DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexception_handler.dylib
)
add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexpat.1.5.2.dylib ${LL_TEST_DESTINATION_DIR}
DEPENDS ${CMAKE_SOURCE_DIR}/../build-darwin-i386/packages/lib/release/libexpat.1.5.2.dylib
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/libexception_handler.dylib ${LL_TEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/libexception_handler.dylib
)
foreach(expat ${EXPAT_COPY})
add_custom_command(TARGET INTEGRATION_TEST_llcorehttp PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${AUTOBUILD_INSTALL_DIR}/lib/release/${expat} ${LL_TEST_DESTINATION_DIR}
DEPENDS ${AUTOBUILD_INSTALL_DIR}/lib/release/${expat}
)
endforeach(expat)
endif (DARWIN)
@ -214,7 +216,7 @@ endif (DARWIN)
# The following come from LLAddBuildTest.cmake's INTEGRATION_TEST_xxxx target.
set_target_properties(http_texture_load
PROPERTIES
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:CONSOLE ${TCMALLOC_LINK_FLAGS}"
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:CONSOLE"
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO"
LINK_FLAGS_RELEASE ""
)

View File

@ -50,11 +50,12 @@ HttpStatus::type_enum_t EXT_CURL_EASY;
HttpStatus::type_enum_t EXT_CURL_MULTI;
HttpStatus::type_enum_t LLCORE;
HttpStatus::operator unsigned long() const
HttpStatus::operator U32() const
{
static const int shift(sizeof(unsigned long) * 4);
// Effectively, concatenate mType (high) with mStatus (low).
static const int shift(sizeof(mDetails->mStatus) * 8);
unsigned long result(((unsigned long)mDetails->mType) << shift | (unsigned long)(int)mDetails->mStatus);
U32 result(U32(mDetails->mType) << shift | U32((int)mDetails->mStatus));
return result;
}
@ -64,7 +65,7 @@ std::string HttpStatus::toHex() const
std::ostringstream result;
result.width(8);
result.fill('0');
result << std::hex << operator unsigned long();
result << std::hex << operator U32();
return result.str();
}

View File

@ -382,10 +382,10 @@ struct HttpStatus
/// creates an ambiguous second path to integer conversion
/// which tends to find programming errors such as formatting
/// the status to a stream (operator<<).
operator unsigned long() const;
unsigned long toULong() const
operator U32() const;
U32 toULong() const
{
return operator unsigned long();
return operator U32();
}
/// And to convert to a hex string.

View File

@ -244,7 +244,7 @@ void HttpStatusTestObjectType::test<7>()
HttpStatus status(404);
std::string msg = status.toHex();
// std::cout << "Result: " << msg << std::endl;
ensure(msg == "01940001");
ensure_equals(msg, "01940001");
}

View File

@ -1227,9 +1227,10 @@ void LLImageRaw::fill( const LLColor4U& color )
if( 4 == getComponents() )
{
U32* data = (U32*) getData();
U32 rgbaColor = color.asRGBA();
for( S32 i = 0; i < pixels; i++ )
{
data[i] = color.mAll;
data[ i ] = rgbaColor;
}
}
else

View File

@ -41,8 +41,12 @@ LLImageJ2CImpl* fallbackCreateLLImageJ2CImpl()
std::string LLImageJ2COJ::getEngineInfo() const
{
#ifdef OPENJPEG_VERSION
return std::string("OpenJPEG: " OPENJPEG_VERSION ", Runtime: ")
+ opj_version();
#else
return std::string("OpenJPEG runtime: ") + opj_version();
#endif
}
// Return string from message, eliminating final \n if present

View File

@ -40,6 +40,14 @@ set_source_files_properties(${llkdu_HEADER_FILES}
list(APPEND llkdu_SOURCE_FILES ${llkdu_HEADER_FILES})
# Our KDU package is built with KDU_X86_INTRINSICS in its .vcxproj file.
# Unless that macro is also set for every consumer build, KDU freaks out,
# spamming the viewer log with alignment FUD.
set_source_files_properties(${llkdu_SOURCE_FILES}
PROPERTIES
COMPILE_DEFINITIONS
"KDU_X86_INTRINSICS")
if (USE_KDU)
add_library (llkdu ${llkdu_SOURCE_FILES})

View File

@ -0,0 +1,40 @@
/**
* @file include_kdu_xxxx.h
* @author Nat Goodspeed
* @date 2016-04-25
* @brief
*
* $LicenseInfo:firstyear=2016&license=viewerlgpl$
* Copyright (c) 2016, Linden Research, Inc.
* $/LicenseInfo$
*/
// This file specifically omits #include guards of its own: it's sort of an
// #include macro used to wrap KDU #includes with proper incantations. Usage:
// #define kdu_xxxx "kdu_compressed.h" // or whichever KDU header
// #include "include_kdu_xxxx.h"
// // kdu_xxxx #undef'ed by include_kdu_xxxx.h
#if LL_DARWIN
// don't *really* want to rebuild KDU so turn off specific warnings for this header
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wself-assign-field"
#pragma clang diagnostic ignored "-Wunused-private-field"
#include kdu_xxxx
#pragma clang diagnostic pop
#elif LL_WINDOWS
// With warnings-as-errors in effect, strange relationship between
// jp2_output_box and its subclass jp2_target in kdu_compressed.h
// causes build failures. Specifically:
// warning C4263: 'void kdu_supp::jp2_target::open(kdu_supp::jp2_family_tgt *)' : member function does not override any base class virtual member function
// warning C4264: 'void kdu_supp::jp2_output_box::open(kdu_core::kdu_uint32)' : no override available for virtual member function from base 'kdu_supp::jp2_output_box'; function is hidden
#pragma warning(push)
#pragma warning(disable : 4263 4264)
#include kdu_xxxx
#pragma warning(pop)
#else // some other platform
#include kdu_xxxx
#endif
#undef kdu_xxxx

View File

@ -25,21 +25,37 @@
*/
#include "linden_common.h"
#include "llimagej2ckdu.h"
#include "lltimer.h"
#include "llpointer.h"
#include "llmath.h"
#include "llkdumem.h"
#include "stringize.h"
#include "kdu_block_coding.h"
#define kdu_xxxx "kdu_block_coding.h"
#include "include_kdu_xxxx.h"
// Avoid ubiquitous necessity of kdu_core:: qualification
using namespace kdu_core;
#include "llexception.h"
#include <boost/exception/diagnostic_information.hpp>
#include <sstream>
#include <iomanip>
// stream kdu_dims to std::ostream
// Turns out this must NOT be in the anonymous namespace!
// It must also precede #include "stringize.h".
inline
std::ostream& operator<<(std::ostream& out, const kdu_dims& dims)
{
return out << "(" << dims.pos.x << "," << dims.pos.y << "),"
"[" << dims.size.x << "x" << dims.size.y << "]";
}
#include "stringize.h"
namespace {
// Failure to load an image shouldn't crash the whole viewer.
struct KDUError: public LLContinueError
@ -82,19 +98,10 @@ std::string report_kdu_exception(kdu_exception mb)
}
} // anonymous namespace
// stream kdu_dims to std::ostream
// Turns out this must NOT be in the anonymous namespace!
inline
std::ostream& operator<<(std::ostream& out, const kdu_dims& dims)
{
return out << "(" << dims.pos.x << "," << dims.pos.y << "),"
"[" << dims.size.x << "x" << dims.size.y << "]";
}
class kdc_flow_control {
public:
kdc_flow_control(kdu_image_in_base *img_in, kdu_codestream codestream);
kdc_flow_control(kdu_supp::kdu_image_in_base *img_in, kdu_codestream codestream);
~kdc_flow_control();
bool advance_components();
void process_components();
@ -103,7 +110,7 @@ private:
struct kdc_component_flow_control {
public:
kdu_image_in_base *reader;
kdu_supp::kdu_image_in_base *reader;
int vert_subsampling;
int ratio_counter; /* Initialized to 0, decremented by `count_delta';
when < 0, a new line must be processed, after
@ -143,7 +150,8 @@ std::string LLImageJ2CKDU::getEngineInfo() const
class LLKDUDecodeState
{
public:
LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap);
LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap,
kdu_codestream* codestreamp);
~LLKDUDecodeState();
bool processTileDecode(F32 decode_time, bool limit_time = true);
@ -345,9 +353,9 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, bool keep_codestream, ECod
// This method is only called from methods that catch KDUError.
// We want to fail the image load, not crash the viewer.
LLTHROW(KDUError(STRINGIZE("Component " << idx << " dimensions "
<< other_dims
<< " do not match component 0 dimensions "
<< dims << "!")));
<< stringize(other_dims)
<< " do not match component 0 dimensions "
<< stringize(dims) << "!")));
}
}
@ -559,7 +567,8 @@ bool LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco
kdu_coords offset = tile_dims.pos - dims.pos;
int row_gap = channels*dims.size.x; // inter-row separation
kdu_byte *buf = buffer + offset.y*row_gap + offset.x*channels;
mDecodeState.reset(new LLKDUDecodeState(tile, buf, row_gap));
mDecodeState.reset(new LLKDUDecodeState(tile, buf, row_gap,
mCodeStreamp.get()));
}
// Do the actual processing
F32 remaining_time = decode_time - decode_timer.getElapsedTimeF32();
@ -1247,7 +1256,8 @@ all necessary level shifting, type conversion, rounding and truncation. */
}
}
LLKDUDecodeState::LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap)
LLKDUDecodeState::LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap,
kdu_codestream* codestreamp)
{
S32 c;
@ -1293,7 +1303,7 @@ LLKDUDecodeState::LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap)
mEngines[c] = kdu_synthesis(res,&mAllocator,use_shorts);
}
}
mAllocator.finalize(); // Actually creates buffering resources
mAllocator.finalize(*codestreamp); // Actually creates buffering resources
for (c = 0; c < mNumComponents; c++)
{
mLines[c].create(); // Grabs resources from the allocator.
@ -1351,7 +1361,7 @@ separation between consecutive rows in the real buffer. */
// kdc_flow_control
kdc_flow_control::kdc_flow_control (kdu_image_in_base *img_in, kdu_codestream codestream)
kdc_flow_control::kdc_flow_control (kdu_supp::kdu_image_in_base *img_in, kdu_codestream codestream)
{
int n;

View File

@ -37,15 +37,8 @@
#include "kdu_messaging.h"
#include "kdu_params.h"
// don't *really* want to rebuild KDU so turn off specific warnings for this header
#if LL_DARWIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#include "kdu_compressed.h"
#pragma clang diagnostic pop
#else
#include "kdu_compressed.h"
#endif
#define kdu_xxxx "kdu_compressed.h"
#include "include_kdu_xxxx.h"
#include "kdu_sample_processing.h"
#include <boost/scoped_ptr.hpp>
@ -111,17 +104,19 @@ private:
}
}
kdu_codestream* operator->() { return &mCodeStream; }
// for those few times when you need a raw kdu_codestream*
kdu_core::kdu_codestream* get() { return &mCodeStream; }
kdu_core::kdu_codestream* operator->() { return &mCodeStream; }
private:
kdu_codestream mCodeStream;
kdu_core::kdu_codestream mCodeStream;
};
// Encode variable
boost::scoped_ptr<LLKDUMemSource> mInputp;
CodeStreamHolder mCodeStreamp;
boost::scoped_ptr<kdu_coords> mTPosp; // tile position
boost::scoped_ptr<kdu_dims> mTileIndicesp;
boost::scoped_ptr<kdu_core::kdu_coords> mTPosp; // tile position
boost::scoped_ptr<kdu_core::kdu_dims> mTileIndicesp;
int mBlocksSize;
int mPrecinctsSize;
int mLevels;

View File

@ -28,6 +28,9 @@
#include "llkdumem.h"
#include "llerror.h"
using namespace kdu_core;
using kd_supp_image_local::image_line_buf;
#if defined(LL_WINDOWS)
# pragma warning(disable: 4702) // unreachable code
#endif

View File

@ -29,26 +29,22 @@
// Support classes for reading and writing from memory buffers in KDU
#define KDU_NO_THREADS
// don't *really* want to rebuild KDU so turn off specific warnings for this header
#if LL_DARWIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wself-assign-field"
#pragma clang diagnostic ignored "-Wunused-private-field"
#include "kdu_image.h"
#pragma clang diagnostic pop
#else
#include "kdu_image.h"
#endif
#define kdu_xxxx "kdu_image.h"
#include "include_kdu_xxxx.h"
#include "kdu_elementary.h"
#include "kdu_messaging.h"
#include "kdu_params.h"
#include "kdu_compressed.h"
#define kdu_xxxx "kdu_compressed.h"
#include "include_kdu_xxxx.h"
#include "kdu_sample_processing.h"
#include "image_local.h"
#include "stdtypes.h"
class LLKDUMemSource: public kdu_compressed_source
class LLKDUMemSource: public kdu_core::kdu_compressed_source
{
public:
LLKDUMemSource(U8 *input_buffer, U32 size)
@ -62,7 +58,7 @@ public:
{
}
int read(kdu_byte *buf, int num_bytes)
int read(kdu_core::kdu_byte *buf, int num_bytes)
{
U32 num_out;
num_out = num_bytes;
@ -87,7 +83,7 @@ private:
U32 mCurPos;
};
class LLKDUMemTarget: public kdu_compressed_target
class LLKDUMemTarget: public kdu_core::kdu_compressed_target
{
public:
LLKDUMemTarget(U8 *output_buffer, U32 &output_size, const U32 buffer_size)
@ -102,7 +98,7 @@ public:
{
}
bool write(const kdu_byte *buf, int num_bytes)
bool write(const kdu_core::kdu_byte *buf, int num_bytes)
{
U32 num_out;
num_out = num_bytes;
@ -126,7 +122,7 @@ private:
U32 *mOutputSize;
};
class LLKDUMemIn : public kdu_image_in_base
class LLKDUMemIn : public kdu_supp::kdu_image_in_base
{
public:
LLKDUMemIn(const U8 *data,
@ -134,10 +130,10 @@ public:
const U16 rows,
const U16 cols,
U8 in_num_components,
siz_params *siz);
kdu_core::siz_params *siz);
~LLKDUMemIn();
bool get(int comp_idx, kdu_line_buf &line, int x_tnum);
bool get(int comp_idx, kdu_core::kdu_line_buf &line, int x_tnum);
private:
const U8 *mData;
@ -146,8 +142,8 @@ private:
int rows, cols;
int alignment_bytes; // Number of 0's at end of each line.
int precision[3];
image_line_buf *incomplete_lines; // Each "sample" represents a full pixel
image_line_buf *free_lines;
kd_supp_image_local::image_line_buf *incomplete_lines; // Each "sample" represents a full pixel
kd_supp_image_local::image_line_buf *free_lines;
int num_unread_rows;
U32 mCurPos;

View File

@ -30,6 +30,7 @@
#include "llimagej2ckdu.h"
#if LL_DARWIN
// For this source, it's true that private fields in llkdumem.h are unused.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#include "llkdumem.h"
@ -37,7 +38,6 @@
#else
#include "llkdumem.h"
#endif
#include "kdu_block_coding.h"
// Tut header
#include "lltut.h"
@ -113,17 +113,19 @@ void LLImageJ2C::setLastError(const std::string&, const std::string&) { }
bool LLImageJ2C::updateData() { return false; }
void LLImageJ2C::updateRawDiscardLevel() { }
LLKDUMemIn::LLKDUMemIn(const U8*, const U32, const U16, const U16, const U8, siz_params*) { }
LLKDUMemIn::LLKDUMemIn(const U8*, const U32, const U16, const U16, const U8, kdu_core::siz_params*) { }
LLKDUMemIn::~LLKDUMemIn() { }
bool LLKDUMemIn::get(int, kdu_line_buf&, int) { return false; }
bool LLKDUMemIn::get(int, kdu_core::kdu_line_buf&, int) { return false; }
// Stub Kakadu Library calls
// they're all namespaced now
namespace kdu_core {
kdu_tile_comp kdu_tile::access_component(int ) { kdu_tile_comp a; return a; }
kdu_block_encoder::kdu_block_encoder() { }
kdu_block_decoder::kdu_block_decoder() { }
void kdu_block::set_max_passes(int , bool ) { }
void kdu_block::set_max_bytes(int , bool ) { }
void kdu_tile::close(kdu_thread_env* ) { }
void kdu_tile::close(kdu_thread_env *, bool) {}
int kdu_tile::get_num_components() { return 0; }
bool kdu_tile::get_ycc() { return false; }
void kdu_tile::set_components_of_interest(int , const int* ) { }
@ -156,14 +158,14 @@ void kdu_codestream::set_fussy() { }
void kdu_codestream::get_dims(int, kdu_dims&, bool ) { }
int kdu_codestream::get_min_dwt_levels() { return 5; }
int kdu_codestream::get_max_tile_layers() { return 1; }
void kdu_codestream::change_appearance(bool, bool, bool) { }
void kdu_codestream::change_appearance(bool, bool, bool, kdu_thread_env *) {}
void kdu_codestream::get_tile_dims(kdu_coords, int, kdu_dims&, bool ) { }
void kdu_codestream::destroy() { }
void kdu_codestream::collect_timing_stats(int ) { }
void kdu_codestream::set_max_bytes(kdu_long, bool, bool ) { }
void kdu_codestream::get_valid_tiles(kdu_dims& ) { }
void kdu_codestream::create(kdu_compressed_source*, kdu_thread_env*) { }
void kdu_codestream::apply_input_restrictions( int, int, int, int, kdu_dims*, kdu_component_access_mode ) { }
void kdu_codestream::apply_input_restrictions(int, int, int, int, kdu_dims const *, kdu_component_access_mode, kdu_thread_env *, kdu_quality_limiter const *) {}
void kdu_codestream::get_subsampling(int , kdu_coords&, bool ) { }
void kdu_codestream::flush(kdu_long *, int, kdu_uint16 *, bool, bool, double, kdu_thread_env*, int) { }
void kdu_codestream::set_resilient(bool ) { }
@ -178,13 +180,15 @@ siz_params* kdu_codestream::access_siz() { return NULL; }
kdu_tile kdu_codestream::open_tile(kdu_coords , kdu_thread_env* ) { kdu_tile a; return a; }
kdu_codestream_comment kdu_codestream::add_comment() { kdu_codestream_comment a; return a; }
void kdu_subband::close_block(kdu_block*, kdu_thread_env*) { }
void kdu_subband::get_valid_blocks(kdu_dims &indices) { }
kdu_block* kdu_subband::open_block(kdu_coords, int*, kdu_thread_env*) { return NULL; }
void kdu_subband::get_valid_blocks(kdu_dims &indices) const { }
kdu_block * kdu_subband::open_block(kdu_coords, int *, kdu_thread_env *, int, bool) { return NULL; }
bool kdu_codestream_comment::put_text(const char*) { return false; }
void kdu_customize_warnings(kdu_message*) { }
void kdu_customize_errors(kdu_message*) { }
kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, kdu_thread_env*, kdu_thread_queue*, int, kdu_roi_image*, int) { kdu_long a = 0; return a; }
kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, kdu_thread_env *,kdu_thread_queue *, int, kdu_roi_image *, int, kdu_sample_allocator *, kdu_push_pull_params const *) { return kdu_long(0); }
void kdu_multi_analysis::destroy(kdu_thread_env *) {}
siz_params::siz_params() : kdu_params(NULL, false, false, false, false, false) { }
siz_params::~siz_params() {}
void siz_params::finalize(bool ) { }
void siz_params::copy_with_xforms(kdu_params*, int, int, bool, bool, bool) { }
int siz_params::write_marker_segment(kdu_output*, kdu_params*, int) { return 0; }
@ -193,10 +197,15 @@ bool siz_params::read_marker_segment(kdu_uint16, int, kdu_byte a[], int) { retur
kdu_decoder::kdu_decoder(kdu_subband , kdu_sample_allocator*, bool , float, int, kdu_thread_env*, kdu_thread_queue*, int) { }
void kdu_codestream::create(siz_params*, kdu_compressed_target*, kdu_dims*, int, kdu_long, kdu_thread_env* ) { }
kdu_sample_allocator::~kdu_sample_allocator() {}
void kdu_sample_allocator::do_finalize(kdu_codestream) {}
void (*kdu_convert_ycc_to_rgb_rev16)(kdu_int16*,kdu_int16*,kdu_int16*,int);
void (*kdu_convert_ycc_to_rgb_irrev16)(kdu_int16*,kdu_int16*,kdu_int16*,int);
void (*kdu_convert_ycc_to_rgb_rev32)(kdu_int32*,kdu_int32*,kdu_int32*,int);
void (*kdu_convert_ycc_to_rgb_irrev32)(float*,float*,float*,int);
bool kdu_core_sample_alignment_checker(int, int, int, int, bool, bool) { return false; }
void kdu_pull_ifc::destroy() {}
} // namespace kdu_core
// -------------------------------------------------------------------------------------------
// TUT

View File

@ -153,7 +153,7 @@ inline F64 llabs(const F64 a)
inline S32 lltrunc( F32 f )
{
#if LL_WINDOWS && !defined( __INTEL_COMPILER )
#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && (ADDRESS_SIZE == 32)
// Avoids changing the floating point control word.
// Add or subtract 0.5 - epsilon and then round
const static U32 zpfp[] = { 0xBEFFFFFF, 0x3EFFFFFF };
@ -179,7 +179,7 @@ inline S32 lltrunc( F64 f )
inline S32 llfloor( F32 f )
{
#if LL_WINDOWS && !defined( __INTEL_COMPILER )
#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && (ADDRESS_SIZE == 32)
// Avoids changing the floating point control word.
// Accurate (unlike Stereopsis version) for all values between S32_MIN and S32_MAX and slightly faster than Stereopsis version.
// Add -(0.5 - epsilon) and then round

View File

@ -31,7 +31,7 @@
#error "Please include llmath.h before this file."
#endif
#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 ) )
#if ( ( LL_DARWIN || LL_LINUX ) && !(__SSE2__) ) || ( LL_WINDOWS && ( _M_IX86_FP < 2 && ADDRESS_SIZE == 32 ) )
#error SSE2 not enabled. LLVector4a and related class will not compile.
#endif

View File

@ -355,7 +355,8 @@ namespace tut
val3 = z1 + (z2 - z1)* val;
val4 = w1 + (w2 - w1)* val;
LLVector4 vec4b = lerp(vec4,vec4a,val);
ensure("lerp failed", ((val1 ==vec4b.mV[VX])&& (val2 ==vec4b.mV[VY]) && (val3 ==vec4b.mV[VZ])&& (val4 ==vec4b.mV[VW])));
LLVector4 check(val1, val2, val3, val4);
ensure_equals("lerp failed", check, vec4b);
}
template<> template<>

View File

@ -47,14 +47,7 @@ class LLColor4U
{
public:
union
{
U8 mV[LENGTHOFCOLOR4U];
U32 mAll;
LLColor4* mSources;
LLColor4U* mSourcesU;
};
U8 mV[LENGTHOFCOLOR4U];
LLColor4U(); // Initializes LLColor4U to (0, 0, 0, 1)
LLColor4U(U8 r, U8 g, U8 b); // Initializes LLColor4U to (r, g, b, 1)
@ -132,6 +125,9 @@ public:
return LLColor4(*this);
}
U32 asRGBA() const;
void fromRGBA( U32 aVal );
static LLColor4U white;
static LLColor4U black;
static LLColor4U red;
@ -565,6 +561,26 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color)
mV[3] = 255;
}
inline U32 LLColor4U::asRGBA() const
{
// Little endian: values are swapped in memory. The original code access the array like a U32, so we need to swap here
return (mV[3] << 24) | (mV[2] << 16) | (mV[1] << 8) | mV[0];
}
inline void LLColor4U::fromRGBA( U32 aVal )
{
// Little endian: values are swapped in memory. The original code access the array like a U32, so we need to swap here
mV[ 0 ] = aVal & 0xFF;
aVal >>= 8;
mV[ 1 ] = aVal & 0xFF;
aVal >>= 8;
mV[ 2 ] = aVal & 0xFF;
aVal >>= 8;
mV[ 3 ] = aVal & 0xFF;
}
#endif

View File

@ -56,13 +56,13 @@ set(llplugin_HEADER_FILES
set_source_files_properties(${llplugin_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
if(NOT WORD_SIZE EQUAL 32)
if(NOT ADDRESS_SIZE EQUAL 32)
if(WINDOWS)
add_definitions(/FIXED:NO)
##add_definitions(/FIXED:NO)
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
add_definitions(-fPIC)
endif(WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
endif(NOT ADDRESS_SIZE EQUAL 32)
list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES})

View File

@ -2046,7 +2046,8 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, S32 vert_count)
}
}
mVerticesp[mCount] = mVerticesp[mCount-1];
if( mCount > 0 ) // ND: Guard against crashes if mCount is zero, yes it can happen
mVerticesp[mCount] = mVerticesp[mCount-1];
}
void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 vert_count)
@ -2162,9 +2163,12 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLCol
}
}
mVerticesp[mCount] = mVerticesp[mCount-1];
mTexcoordsp[mCount] = mTexcoordsp[mCount-1];
mColorsp[mCount] = mColorsp[mCount-1];
if (mCount > 0)
{
mVerticesp[mCount] = mVerticesp[mCount - 1];
mTexcoordsp[mCount] = mTexcoordsp[mCount - 1];
mColorsp[mCount] = mColorsp[mCount - 1];
}
}
void LLRender::vertex2i(const GLint& x, const GLint& y)

View File

@ -1436,13 +1436,22 @@ void LLVertexBuffer::setupVertexArray()
//glVertexattribIPointer requires GLSL 1.30 or later
if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30)
{
glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i], (void*) mOffsets[i]);
glVertexAttribIPointer(i, attrib_size[i], attrib_type[i], sTypeSize[i], (const GLvoid*) mOffsets[i]);
}
#endif
}
else
{
glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i], attrib_normalized[i], sTypeSize[i], (void*) mOffsets[i]);
// nat 2016-12-16: With 64-bit clang compile, the compiler
// produces an error if we simply cast mOffsets[i] -- an S32
// -- to (GLvoid *), the type of the parameter. It correctly
// points out that there's no way an S32 could fit a real
// pointer value. Ruslan asserts that in this case the last
// param is interpreted as an array data offset within the VBO
// rather than as an actual pointer, so it's okay.
glVertexAttribPointerARB(i, attrib_size[i], attrib_type[i],
attrib_normalized[i], sTypeSize[i],
reinterpret_cast<GLvoid*>(mOffsets[i]));
}
}
else

View File

@ -126,7 +126,7 @@ private:
F32 mValue;
LLUIColor mColor;
bool operator <(const Threshold& other)
bool operator <(const Threshold& other) const
{
return mValue < other.mValue;
}

View File

@ -94,7 +94,7 @@ LLDir_Mac::LLDir_Mac()
// MBW -- This keeps the mac application from finding other things.
// If this is really for skins, it should JUST apply to skins.
U32 build_dir_pos = mExecutableDir.rfind("/build-darwin-");
std::string::size_type build_dir_pos = mExecutableDir.rfind("/build-darwin-");
if (build_dir_pos != std::string::npos)
{
// ...we're in a dev checkout

View File

@ -113,7 +113,7 @@ class LLDragDropWin32Target:
PVOID data = GlobalLock( stgmed.hGlobal );
mDropUrl = std::string( (char*)data );
// XXX MAJOR MAJOR HACK!
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(mAppWindowHandle, GWL_USERDATA);
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( mAppWindowHandle, GWLP_USERDATA );
if (NULL != window_imp)
{
LLCoordGL gl_coord( 0, 0 );
@ -168,7 +168,7 @@ class LLDragDropWin32Target:
if ( mAllowDrop )
{
// XXX MAJOR MAJOR HACK!
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(mAppWindowHandle, GWL_USERDATA);
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( mAppWindowHandle, GWLP_USERDATA );
if (NULL != window_imp)
{
LLCoordGL gl_coord( 0, 0 );
@ -215,7 +215,7 @@ class LLDragDropWin32Target:
HRESULT __stdcall DragLeave( void )
{
// XXX MAJOR MAJOR HACK!
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(mAppWindowHandle, GWL_USERDATA);
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( mAppWindowHandle, GWLP_USERDATA );
if (NULL != window_imp)
{
LLCoordGL gl_coord( 0, 0 );
@ -232,7 +232,7 @@ class LLDragDropWin32Target:
if ( mAllowDrop )
{
// window impl stored in Window data (neat!)
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong( mAppWindowHandle, GWL_USERDATA );
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( mAppWindowHandle, GWLP_USERDATA );
if ( NULL != window_imp )
{
POINT pt_client;

View File

@ -785,7 +785,7 @@ void LLWindowWin32::close()
LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL;
// Don't process events in our mainWindowProc any longer.
SetWindowLong(mWindowHandle, GWL_USERDATA, NULL);
SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, NULL);
// Make sure we don't leave a blank toolbar button.
ShowWindow(mWindowHandle, SW_HIDE);
@ -1564,7 +1564,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
LL_DEBUGS("Window") << "Keeping vertical sync" << LL_ENDL;
}
SetWindowLong(mWindowHandle, GWL_USERDATA, (U32)this);
SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, (LONG_PTR)this);
// register this window as handling drag/drop events from the OS
DragAcceptFiles( mWindowHandle, TRUE );
@ -1876,7 +1876,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
// This is to avoid triggering double click teleport after returning focus (see MAINT-3786).
static bool sHandleDoubleClick = true;
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong(h_wnd, GWL_USERDATA);
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( h_wnd, GWLP_USERDATA );
if (NULL != window_imp)

View File

@ -8,14 +8,10 @@ if (LINUX)
endif (LINUX)
if (DARWIN)
add_subdirectory(quicktime)
add_subdirectory(cef)
endif (DARWIN)
if (WINDOWS)
add_subdirectory(cef)
add_subdirectory(winmmshim)
add_subdirectory(libvlc)
endif (WINDOWS)
### add_subdirectory(example)

View File

@ -28,13 +28,13 @@ include_directories(SYSTEM
### media_plugin_base
if(NOT WORD_SIZE EQUAL 32)
if(NOT ADDRESS_SIZE EQUAL 32)
if(WINDOWS)
add_definitions(/FIXED:NO)
##add_definitions(/FIXED:NO)
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
add_definitions(-fPIC)
endif(WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
endif(NOT ADDRESS_SIZE EQUAL 32)
set(media_plugin_base_SOURCE_FILES
media_plugin_base.cpp

View File

@ -34,13 +34,13 @@ include_directories(SYSTEM
### media_plugin_cef
if(NOT WORD_SIZE EQUAL 32)
if(NOT ADDRESS_SIZE EQUAL 32)
if(WINDOWS)
add_definitions(/FIXED:NO)
##add_definitions(/FIXED:NO)
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
add_definitions(-fPIC)
endif(WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
endif(NOT ADDRESS_SIZE EQUAL 32)
set(media_plugin_cef_SOURCE_FILES
media_plugin_cef.cpp
@ -97,8 +97,8 @@ if (WINDOWS)
set_target_properties(
media_plugin_cef
PROPERTIES
LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT"
LINK_FLAGS_DEBUG "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMTD"
LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT /IGNORE:4099"
LINK_FLAGS_DEBUG "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMTD /IGNORE:4099"
)
endif (WINDOWS)

View File

@ -501,7 +501,10 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
LLCEFLib::LLCEFLibSettings settings;
settings.initial_width = 1024;
settings.initial_height = 1024;
settings.page_zoom_factor = message_in.getValueReal("factor");
// The LLCEFLibSettings struct in the Windows 32-bit
// llceflib's build 500907 does not have a page_zoom_factor
// member. Set below.
//settings.page_zoom_factor = message_in.getValueReal("factor");
settings.plugins_enabled = mPluginsEnabled;
settings.media_stream_enabled = false; // MAINT-6060 - WebRTC media removed until we can add granualrity/query UI
settings.javascript_enabled = mJavascriptEnabled;
@ -518,6 +521,9 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
// if this fails, the media system in viewer will put up a message
}
// now we can set page zoom factor
mLLCEFLib->setPageZoom(message_in.getValueReal("factor"));
// Plugin gets to decide the texture parameters to use.
mDepth = 4;
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params");

View File

@ -41,44 +41,15 @@ public:
void setPan(F32 pan);
private:
typedef void (WINAPI *set_volume_func_t)(F32);
typedef void (WINAPI *set_mute_func_t)(bool);
set_volume_func_t mSetVolumeFunc;
set_mute_func_t mSetMuteFunc;
// tests if running on Vista, 7, 8 + once in CTOR
bool isWindowsVistaOrHigher();
F32 mVolume;
F32 mPan;
bool mSystemIsVistaOrHigher;
};
bool VolumeCatcherImpl::isWindowsVistaOrHigher()
{
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
return osvi.dwMajorVersion >= 6;
}
VolumeCatcherImpl::VolumeCatcherImpl()
: mVolume(1.0f), // default volume is max
mPan(0.f) // default pan is centered
{
mSystemIsVistaOrHigher = isWindowsVistaOrHigher();
if ( ! mSystemIsVistaOrHigher )
{
HMODULE handle = ::LoadLibrary(L"winmm.dll");
if(handle)
{
mSetVolumeFunc = (set_volume_func_t)::GetProcAddress(handle, "setPluginVolume");
mSetMuteFunc = (set_mute_func_t)::GetProcAddress(handle, "setPluginMute");
}
}
}
VolumeCatcherImpl::~VolumeCatcherImpl()
@ -89,26 +60,12 @@ void VolumeCatcherImpl::setVolume(F32 volume)
{
mVolume = volume;
if ( mSystemIsVistaOrHigher )
{
// set both left/right to same volume
// TODO: use pan value to set independently
DWORD left_channel = (DWORD)(mVolume * 65535.0f);
DWORD right_channel = (DWORD)(mVolume * 65535.0f);
DWORD hw_volume = left_channel << 16 | right_channel;
::waveOutSetVolume(NULL, hw_volume);
}
else
{
if (mSetMuteFunc)
{
mSetMuteFunc(volume == 0.f);
}
if (mSetVolumeFunc)
{
mSetVolumeFunc(mVolume);
}
}
// set both left/right to same volume
// TODO: use pan value to set independently
DWORD left_channel = (DWORD)(mVolume * 65535.0f);
DWORD right_channel = (DWORD)(mVolume * 65535.0f);
DWORD hw_volume = left_channel << 16 | right_channel;
::waveOutSetVolume(NULL, hw_volume);
}
void VolumeCatcherImpl::setPan(F32 pan)

View File

@ -32,13 +32,13 @@ include_directories(SYSTEM
### media_plugin_example
if(NOT WORD_SIZE EQUAL 32)
if(NOT ADDRESS_SIZE EQUAL 32)
if(WINDOWS)
add_definitions(/FIXED:NO)
##add_definitions(/FIXED:NO)
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
add_definitions(-fPIC)
endif(WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
endif(NOT ADDRESS_SIZE EQUAL 32)
set(media_plugin_example_SOURCE_FILES
media_plugin_example.cpp

View File

@ -33,13 +33,13 @@ include_directories(SYSTEM
### media_plugin_gstreamer010
if(NOT WORD_SIZE EQUAL 32)
if(NOT ADDRESS_SIZE EQUAL 32)
if(WINDOWS)
add_definitions(/FIXED:NO)
##add_definitions(/FIXED:NO)
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
add_definitions(-fPIC)
endif(WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
endif(NOT ADDRESS_SIZE EQUAL 32)
set(media_plugin_gstreamer010_SOURCE_FILES
media_plugin_gstreamer010.cpp

View File

@ -33,13 +33,13 @@ include_directories(SYSTEM
### media_plugin_libvlc
if(NOT WORD_SIZE EQUAL 32)
if(NOT ADDRESS_SIZE EQUAL 32)
if(WINDOWS)
add_definitions(/FIXED:NO)
##add_definitions(/FIXED:NO)
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
add_definitions(-fPIC)
endif(WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
endif(NOT ADDRESS_SIZE EQUAL 32)
set(media_plugin_libvlc_SOURCE_FILES
media_plugin_libvlc.cpp
@ -61,7 +61,17 @@ target_link_libraries(media_plugin_libvlc
add_dependencies(media_plugin_libvlc
${LLPLUGIN_LIBRARIES}
${MEDIA_PLUGIN_BASE_LIBRARIES}
${LLCOMMON_LIBRARIES}
##${LLCOMMON_LIBRARIES}
# Just say 'llcommon' here. LLCOMMON_LIBRARIES is specified for use in
# target_link_libraries: it includes several Boost libraries, which are
# absolutely NOT dependencies in the sense intended here. Those Boost
# library macros, in turn, specify 'debug' and 'optimized' and a different
# library name for each, producing several wordy errors:
# Policy CMP0046 is not set: Error on non-existent dependency in
# add_dependencies.
# Really, the only dependency we should mention from LLCOMMON_LIBRARIES is
# llcommon itself.
llcommon
)
if (WINDOWS)

View File

@ -1,94 +0,0 @@
# -*- cmake -*-
project(media_plugin_quicktime)
include(00-Common)
include(LLCommon)
include(LLImage)
include(LLPlugin)
include(LLMath)
include(LLRender)
include(LLWindow)
include(Linking)
include(PluginAPI)
include(MediaPluginBase)
include(OpenGL)
include(QuickTimePlugin)
include_directories(
${LLPLUGIN_INCLUDE_DIRS}
${MEDIA_PLUGIN_BASE_INCLUDE_DIRS}
${LLCOMMON_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLIMAGE_INCLUDE_DIRS}
${LLRENDER_INCLUDE_DIRS}
${LLWINDOW_INCLUDE_DIRS}
)
include_directories(SYSTEM
${LLCOMMON_SYSTEM_INCLUDE_DIRS}
)
if (DARWIN)
include(CMakeFindFrameworks)
find_library(CARBON_LIBRARY Carbon)
endif (DARWIN)
### media_plugin_quicktime
set(media_plugin_quicktime_SOURCE_FILES
media_plugin_quicktime.cpp
)
add_library(media_plugin_quicktime
SHARED
${media_plugin_quicktime_SOURCE_FILES}
)
target_link_libraries(media_plugin_quicktime
${LLPLUGIN_LIBRARIES}
${MEDIA_PLUGIN_BASE_LIBRARIES}
${LLCOMMON_LIBRARIES}
${QUICKTIME_LIBRARY}
${PLUGIN_API_WINDOWS_LIBRARIES}
)
add_dependencies(media_plugin_quicktime
${LLPLUGIN_LIBRARIES}
${MEDIA_PLUGIN_BASE_LIBRARIES}
${LLCOMMON_LIBRARIES}
)
if (WINDOWS)
set_target_properties(
media_plugin_quicktime
PROPERTIES
LINK_FLAGS "/MANIFEST:NO"
)
endif (WINDOWS)
if (QUICKTIME)
add_definitions(-DLL_QUICKTIME_ENABLED=1)
if (DARWIN)
# Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name
set_target_properties(
media_plugin_quicktime
PROPERTIES
PREFIX ""
BUILD_WITH_INSTALL_RPATH 1
INSTALL_NAME_DIR "@executable_path"
LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp"
)
# We use a bunch of deprecated system APIs.
set_source_files_properties(
media_plugin_quicktime.cpp PROPERTIES
COMPILE_FLAGS -Wno-deprecated-declarations
)
find_library(CARBON_LIBRARY Carbon)
target_link_libraries(media_plugin_quicktime ${CARBON_LIBRARY})
endif (DARWIN)
endif (QUICKTIME)

File diff suppressed because it is too large Load Diff

View File

@ -1,37 +0,0 @@
# -*- cmake -*-
project(winmm_shim)
### winmm_shim
# *HACK - override msvcrt implementation (intialized on 00-Common) to be
# statically linked for winmm.dll this relies on vc taking the last flag on
# the command line
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(winmm_shim_SOURCE_FILES
forwarding_api.cpp
winmm_shim.cpp
)
set(winmm_shim_HEADER_FILES
forwarding_api.h
winmm.def
)
list(APPEND winmm_shim_SOURCE_FILES ${winmm_shim_HEADER_FILES})
add_library(winmm_shim
SHARED
${winmm_shim_SOURCE_FILES}
)
if (WINDOWS)
set_target_properties(
winmm_shim
PROPERTIES
LINK_FLAGS "/MANIFEST:NO"
OUTPUT_NAME "winmm"
)
endif (WINDOWS)

File diff suppressed because it is too large Load Diff

View File

@ -1,390 +0,0 @@
/**
* @file forwarding_api.h
* @brief forwards winmm API calls to real winmm.dll
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
// this turns off __declspec(dllimport) for the functions declared in mmsystem.h
#define _WINMM_
#include <windows.h>
#include <mmsystem.h>
void init_function_pointers(HMODULE winmm_handle);
void ll_winmm_shim_initialize();
typedef VOID (*LPTASKCALLBACK)(DWORD_PTR dwInst);
typedef LRESULT (WINAPI *CloseDriver_type)( HDRVR hDriver, LPARAM lParam1, LPARAM lParam2);
extern CloseDriver_type CloseDriver_orig;
typedef HDRVR (WINAPI *OpenDriver_type)( LPCWSTR szDriverName, LPCWSTR szSectionName, LPARAM lParam2);
extern OpenDriver_type OpenDriver_orig;
typedef LRESULT (WINAPI *SendDriverMessage_type)( HDRVR hDriver, UINT message, LPARAM lParam1, LPARAM lParam2);
extern SendDriverMessage_type SendDriverMessage_orig;
typedef HMODULE (WINAPI *DrvGetModuleHandle_type)( HDRVR hDriver);
extern DrvGetModuleHandle_type DrvGetModuleHandle_orig;
typedef HMODULE (WINAPI *GetDriverModuleHandle_type)( HDRVR hDriver);
extern GetDriverModuleHandle_type GetDriverModuleHandle_orig;
typedef LRESULT (WINAPI *DefDriverProc_type)( DWORD_PTR dwDriverIdentifier, HDRVR hdrvr, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
extern DefDriverProc_type DefDriverProc_orig;
typedef BOOL (WINAPI *DriverCallback_type)(DWORD dwCallBack, DWORD dwFlags, HDRVR hdrvr, DWORD msg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
extern DriverCallback_type DriverCallback_orig;
typedef UINT (WINAPI *mmsystemGetVersion_type)(void);
extern mmsystemGetVersion_type mmsystemGetVersion_orig;
typedef BOOL (WINAPI *sndPlaySoundA_type)( LPCSTR pszSound, UINT fuSound);
extern sndPlaySoundA_type sndPlaySoundA_orig;
typedef BOOL (WINAPI *sndPlaySoundW_type)( LPCWSTR pszSound, UINT fuSound);
extern sndPlaySoundW_type sndPlaySoundW_orig;
typedef BOOL (WINAPI *PlaySoundA_type)( LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);
extern PlaySoundA_type PlaySoundA_orig;
typedef BOOL (WINAPI *PlaySoundW_type)( LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound);
extern PlaySoundW_type PlaySoundW_orig;
typedef UINT (WINAPI *waveOutGetNumDevs_type)(void);
extern waveOutGetNumDevs_type waveOutGetNumDevs_orig;
typedef MMRESULT (WINAPI *waveOutGetDevCapsA_type)( UINT_PTR uDeviceID, LPWAVEOUTCAPSA pwoc, UINT cbwoc);
extern waveOutGetDevCapsA_type waveOutGetDevCapsA_orig;
typedef MMRESULT (WINAPI *waveOutGetDevCapsW_type)( UINT_PTR uDeviceID, LPWAVEOUTCAPSW pwoc, UINT cbwoc);
extern waveOutGetDevCapsW_type waveOutGetDevCapsW_orig;
typedef MMRESULT (WINAPI *waveOutGetVolume_type)( HWAVEOUT hwo, LPDWORD pdwVolume);
extern waveOutGetVolume_type waveOutGetVolume_orig;
typedef MMRESULT (WINAPI *waveOutSetVolume_type)( HWAVEOUT hwo, DWORD dwVolume);
extern waveOutSetVolume_type waveOutSetVolume_orig;
typedef MMRESULT (WINAPI *waveOutGetErrorTextA_type)( MMRESULT mmrError, LPSTR pszText, UINT cchText);
extern waveOutGetErrorTextA_type waveOutGetErrorTextA_orig;
typedef MMRESULT (WINAPI *waveOutGetErrorTextW_type)( MMRESULT mmrError, LPWSTR pszText, UINT cchText);
extern waveOutGetErrorTextW_type waveOutGetErrorTextW_orig;
typedef MMRESULT (WINAPI *waveOutOpen_type)( LPHWAVEOUT phwo, UINT uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
extern waveOutOpen_type waveOutOpen_orig;
typedef MMRESULT (WINAPI *waveOutClose_type)( HWAVEOUT hwo);
extern waveOutClose_type waveOutClose_orig;
typedef MMRESULT (WINAPI *waveOutPrepareHeader_type)( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);
extern waveOutPrepareHeader_type waveOutPrepareHeader_orig;
typedef MMRESULT (WINAPI *waveOutUnprepareHeader_type)( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);
extern waveOutUnprepareHeader_type waveOutUnprepareHeader_orig;
typedef MMRESULT (WINAPI *waveOutWrite_type)( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh);
extern waveOutWrite_type waveOutWrite_orig;
typedef MMRESULT (WINAPI *waveOutPause_type)( HWAVEOUT hwo);
extern waveOutPause_type waveOutPause_orig;
typedef MMRESULT (WINAPI *waveOutRestart_type)( HWAVEOUT hwo);
extern waveOutRestart_type waveOutRestart_orig;
typedef MMRESULT (WINAPI *waveOutReset_type)( HWAVEOUT hwo);
extern waveOutReset_type waveOutReset_orig;
typedef MMRESULT (WINAPI *waveOutBreakLoop_type)( HWAVEOUT hwo);
extern waveOutBreakLoop_type waveOutBreakLoop_orig;
typedef MMRESULT (WINAPI *waveOutGetPosition_type)( HWAVEOUT hwo, LPMMTIME pmmt, UINT cbmmt);
extern waveOutGetPosition_type waveOutGetPosition_orig;
typedef MMRESULT (WINAPI *waveOutGetPitch_type)( HWAVEOUT hwo, LPDWORD pdwPitch);
extern waveOutGetPitch_type waveOutGetPitch_orig;
typedef MMRESULT (WINAPI *waveOutSetPitch_type)( HWAVEOUT hwo, DWORD dwPitch);
extern waveOutSetPitch_type waveOutSetPitch_orig;
typedef MMRESULT (WINAPI *waveOutGetPlaybackRate_type)( HWAVEOUT hwo, LPDWORD pdwRate);
extern waveOutGetPlaybackRate_type waveOutGetPlaybackRate_orig;
typedef MMRESULT (WINAPI *waveOutSetPlaybackRate_type)( HWAVEOUT hwo, DWORD dwRate);
extern waveOutSetPlaybackRate_type waveOutSetPlaybackRate_orig;
typedef MMRESULT (WINAPI *waveOutGetID_type)( HWAVEOUT hwo, LPUINT puDeviceID);
extern waveOutGetID_type waveOutGetID_orig;
typedef MMRESULT (WINAPI *waveOutMessage_type)( HWAVEOUT hwo, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
extern waveOutMessage_type waveOutMessage_orig;
typedef UINT (WINAPI *waveInGetNumDevs_type)(void);
extern waveInGetNumDevs_type waveInGetNumDevs_orig;
typedef MMRESULT (WINAPI *waveInGetDevCapsA_type)( UINT_PTR uDeviceID, LPWAVEINCAPSA pwic, UINT cbwic);
extern waveInGetDevCapsA_type waveInGetDevCapsA_orig;
typedef MMRESULT (WINAPI *waveInGetDevCapsW_type)( UINT_PTR uDeviceID, LPWAVEINCAPSW pwic, UINT cbwic);
extern waveInGetDevCapsW_type waveInGetDevCapsW_orig;
typedef MMRESULT (WINAPI *waveInGetErrorTextA_type)(MMRESULT mmrError, LPSTR pszText, UINT cchText);
extern waveInGetErrorTextA_type waveInGetErrorTextA_orig;
typedef MMRESULT (WINAPI *waveInGetErrorTextW_type)(MMRESULT mmrError, LPWSTR pszText, UINT cchText);
extern waveInGetErrorTextW_type waveInGetErrorTextW_orig;
typedef MMRESULT (WINAPI *waveInOpen_type)( LPHWAVEIN phwi, UINT uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
extern waveInOpen_type waveInOpen_orig;
typedef MMRESULT (WINAPI *waveInClose_type)( HWAVEIN hwi);
extern waveInClose_type waveInClose_orig;
typedef MMRESULT (WINAPI *waveInPrepareHeader_type)( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
extern waveInPrepareHeader_type waveInPrepareHeader_orig;
typedef MMRESULT (WINAPI *waveInUnprepareHeader_type)( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
extern waveInUnprepareHeader_type waveInUnprepareHeader_orig;
typedef MMRESULT (WINAPI *waveInAddBuffer_type)( HWAVEIN hwi, LPWAVEHDR pwh, UINT cbwh);
extern waveInAddBuffer_type waveInAddBuffer_orig;
typedef MMRESULT (WINAPI *waveInStart_type)( HWAVEIN hwi);
extern waveInStart_type waveInStart_orig;
typedef MMRESULT (WINAPI *waveInStop_type)( HWAVEIN hwi);
extern waveInStop_type waveInStop_orig;
typedef MMRESULT (WINAPI *waveInReset_type)( HWAVEIN hwi);
extern waveInReset_type waveInReset_orig;
typedef MMRESULT (WINAPI *waveInGetPosition_type)( HWAVEIN hwi, LPMMTIME pmmt, UINT cbmmt);
extern waveInGetPosition_type waveInGetPosition_orig;
typedef MMRESULT (WINAPI *waveInGetID_type)( HWAVEIN hwi, LPUINT puDeviceID);
extern waveInGetID_type waveInGetID_orig;
typedef MMRESULT (WINAPI *waveInMessage_type)( HWAVEIN hwi, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
extern waveInMessage_type waveInMessage_orig;
typedef UINT (WINAPI *midiOutGetNumDevs_type)(void);
extern midiOutGetNumDevs_type midiOutGetNumDevs_orig;
typedef MMRESULT (WINAPI *midiStreamOpen_type)( LPHMIDISTRM phms, LPUINT puDeviceID, DWORD cMidi, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
extern midiStreamOpen_type midiStreamOpen_orig;
typedef MMRESULT (WINAPI *midiStreamClose_type)( HMIDISTRM hms);
extern midiStreamClose_type midiStreamClose_orig;
typedef MMRESULT (WINAPI *midiStreamProperty_type)( HMIDISTRM hms, LPBYTE lppropdata, DWORD dwProperty);
extern midiStreamProperty_type midiStreamProperty_orig;
typedef MMRESULT (WINAPI *midiStreamPosition_type)( HMIDISTRM hms, LPMMTIME lpmmt, UINT cbmmt);
extern midiStreamPosition_type midiStreamPosition_orig;
typedef MMRESULT (WINAPI *midiStreamOut_type)( HMIDISTRM hms, LPMIDIHDR pmh, UINT cbmh);
extern midiStreamOut_type midiStreamOut_orig;
typedef MMRESULT (WINAPI *midiStreamPause_type)( HMIDISTRM hms);
extern midiStreamPause_type midiStreamPause_orig;
typedef MMRESULT (WINAPI *midiStreamRestart_type)( HMIDISTRM hms);
extern midiStreamRestart_type midiStreamRestart_orig;
typedef MMRESULT (WINAPI *midiStreamStop_type)( HMIDISTRM hms);
extern midiStreamStop_type midiStreamStop_orig;
typedef MMRESULT (WINAPI *midiConnect_type)( HMIDI hmi, HMIDIOUT hmo, LPVOID pReserved);
extern midiConnect_type midiConnect_orig;
typedef MMRESULT (WINAPI *midiDisconnect_type)( HMIDI hmi, HMIDIOUT hmo, LPVOID pReserved);
extern midiDisconnect_type midiDisconnect_orig;
typedef MMRESULT (WINAPI *midiOutGetDevCapsA_type)( UINT_PTR uDeviceID, LPMIDIOUTCAPSA pmoc, UINT cbmoc);
extern midiOutGetDevCapsA_type midiOutGetDevCapsA_orig;
typedef MMRESULT (WINAPI *midiOutGetDevCapsW_type)( UINT_PTR uDeviceID, LPMIDIOUTCAPSW pmoc, UINT cbmoc);
extern midiOutGetDevCapsW_type midiOutGetDevCapsW_orig;
typedef MMRESULT (WINAPI *midiOutGetVolume_type)( HMIDIOUT hmo, LPDWORD pdwVolume);
extern midiOutGetVolume_type midiOutGetVolume_orig;
typedef MMRESULT (WINAPI *midiOutSetVolume_type)( HMIDIOUT hmo, DWORD dwVolume);
extern midiOutSetVolume_type midiOutSetVolume_orig;
typedef MMRESULT (WINAPI *midiOutGetErrorTextA_type)( MMRESULT mmrError, LPSTR pszText, UINT cchText);
extern midiOutGetErrorTextA_type midiOutGetErrorTextA_orig;
typedef MMRESULT (WINAPI *midiOutGetErrorTextW_type)( MMRESULT mmrError, LPWSTR pszText, UINT cchText);
extern midiOutGetErrorTextW_type midiOutGetErrorTextW_orig;
typedef MMRESULT (WINAPI *midiOutOpen_type)( LPHMIDIOUT phmo, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
extern midiOutOpen_type midiOutOpen_orig;
typedef MMRESULT (WINAPI *midiOutClose_type)( HMIDIOUT hmo);
extern midiOutClose_type midiOutClose_orig;
typedef MMRESULT (WINAPI *midiOutPrepareHeader_type)( HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh);
extern midiOutPrepareHeader_type midiOutPrepareHeader_orig;
typedef MMRESULT (WINAPI *midiOutUnprepareHeader_type)(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh);
extern midiOutUnprepareHeader_type midiOutUnprepareHeader_orig;
typedef MMRESULT (WINAPI *midiOutShortMsg_type)( HMIDIOUT hmo, DWORD dwMsg);
extern midiOutShortMsg_type midiOutShortMsg_orig;
typedef MMRESULT (WINAPI *midiOutLongMsg_type)(HMIDIOUT hmo, LPMIDIHDR pmh, UINT cbmh);
extern midiOutLongMsg_type midiOutLongMsg_orig;
typedef MMRESULT (WINAPI *midiOutReset_type)( HMIDIOUT hmo);
extern midiOutReset_type midiOutReset_orig;
typedef MMRESULT (WINAPI *midiOutCachePatches_type)( HMIDIOUT hmo, UINT uBank, LPWORD pwpa, UINT fuCache);
extern midiOutCachePatches_type midiOutCachePatches_orig;
typedef MMRESULT (WINAPI *midiOutCacheDrumPatches_type)( HMIDIOUT hmo, UINT uPatch, LPWORD pwkya, UINT fuCache);
extern midiOutCacheDrumPatches_type midiOutCacheDrumPatches_orig;
typedef MMRESULT (WINAPI *midiOutGetID_type)( HMIDIOUT hmo, LPUINT puDeviceID);
extern midiOutGetID_type midiOutGetID_orig;
typedef MMRESULT (WINAPI *midiOutMessage_type)( HMIDIOUT hmo, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
extern midiOutMessage_type midiOutMessage_orig;
typedef UINT (WINAPI *midiInGetNumDevs_type)(void);
extern midiInGetNumDevs_type midiInGetNumDevs_orig;
typedef MMRESULT (WINAPI *midiInGetDevCapsA_type)( UINT_PTR uDeviceID, LPMIDIINCAPSA pmic, UINT cbmic);
extern midiInGetDevCapsA_type midiInGetDevCapsA_orig;
typedef MMRESULT (WINAPI *midiInGetDevCapsW_type)( UINT_PTR uDeviceID, LPMIDIINCAPSW pmic, UINT cbmic);
extern midiInGetDevCapsW_type midiInGetDevCapsW_orig;
typedef MMRESULT (WINAPI *midiInGetErrorTextA_type)( MMRESULT mmrError, LPSTR pszText, UINT cchText);
extern midiInGetErrorTextA_type midiInGetErrorTextA_orig;
typedef MMRESULT (WINAPI *midiInGetErrorTextW_type)( MMRESULT mmrError, LPWSTR pszText, UINT cchText);
extern midiInGetErrorTextW_type midiInGetErrorTextW_orig;
typedef MMRESULT (WINAPI *midiInOpen_type)( LPHMIDIIN phmi, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
extern midiInOpen_type midiInOpen_orig;
typedef MMRESULT (WINAPI *midiInClose_type)( HMIDIIN hmi);
extern midiInClose_type midiInClose_orig;
typedef MMRESULT (WINAPI *midiInPrepareHeader_type)( HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh);
extern midiInPrepareHeader_type midiInPrepareHeader_orig;
typedef MMRESULT (WINAPI *midiInUnprepareHeader_type)( HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh);
extern midiInUnprepareHeader_type midiInUnprepareHeader_orig;
typedef MMRESULT (WINAPI *midiInAddBuffer_type)( HMIDIIN hmi, LPMIDIHDR pmh, UINT cbmh);
extern midiInAddBuffer_type midiInAddBuffer_orig;
typedef MMRESULT (WINAPI *midiInStart_type)( HMIDIIN hmi);
extern midiInStart_type midiInStart_orig;
typedef MMRESULT (WINAPI *midiInStop_type)( HMIDIIN hmi);
extern midiInStop_type midiInStop_orig;
typedef MMRESULT (WINAPI *midiInReset_type)( HMIDIIN hmi);
extern midiInReset_type midiInReset_orig;
typedef MMRESULT (WINAPI *midiInGetID_type)( HMIDIIN hmi, LPUINT puDeviceID);
extern midiInGetID_type midiInGetID_orig;
typedef MMRESULT (WINAPI *midiInMessage_type)( HMIDIIN hmi, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
extern midiInMessage_type midiInMessage_orig;
typedef UINT (WINAPI *auxGetNumDevs_type)(void);
extern auxGetNumDevs_type auxGetNumDevs_orig;
typedef MMRESULT (WINAPI *auxGetDevCapsA_type)( UINT_PTR uDeviceID, LPAUXCAPSA pac, UINT cbac);
extern auxGetDevCapsA_type auxGetDevCapsA_orig;
typedef MMRESULT (WINAPI *auxGetDevCapsW_type)( UINT_PTR uDeviceID, LPAUXCAPSW pac, UINT cbac);
extern auxGetDevCapsW_type auxGetDevCapsW_orig;
typedef MMRESULT (WINAPI *auxSetVolume_type)( UINT uDeviceID, DWORD dwVolume);
extern auxSetVolume_type auxSetVolume_orig;
typedef MMRESULT (WINAPI *auxGetVolume_type)( UINT uDeviceID, LPDWORD pdwVolume);
extern auxGetVolume_type auxGetVolume_orig;
typedef MMRESULT (WINAPI *auxOutMessage_type)( UINT uDeviceID, UINT uMsg, DWORD_PTR dw1, DWORD_PTR dw2);
extern auxOutMessage_type auxOutMessage_orig;
typedef UINT (WINAPI *mixerGetNumDevs_type)(void);
extern mixerGetNumDevs_type mixerGetNumDevs_orig;
typedef MMRESULT (WINAPI *mixerGetDevCapsA_type)( UINT_PTR uMxId, LPMIXERCAPSA pmxcaps, UINT cbmxcaps);
extern mixerGetDevCapsA_type mixerGetDevCapsA_orig;
typedef MMRESULT (WINAPI *mixerGetDevCapsW_type)( UINT_PTR uMxId, LPMIXERCAPSW pmxcaps, UINT cbmxcaps);
extern mixerGetDevCapsW_type mixerGetDevCapsW_orig;
typedef MMRESULT (WINAPI *mixerOpen_type)( LPHMIXER phmx, UINT uMxId, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
extern mixerOpen_type mixerOpen_orig;
typedef MMRESULT (WINAPI *mixerClose_type)( HMIXER hmx);
extern mixerClose_type mixerClose_orig;
typedef DWORD (WINAPI *mixerMessage_type)( HMIXER hmx, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
extern mixerMessage_type mixerMessage_orig;
typedef MMRESULT (WINAPI *mixerGetLineInfoA_type)( HMIXEROBJ hmxobj, LPMIXERLINEA pmxl, DWORD fdwInfo);
extern mixerGetLineInfoA_type mixerGetLineInfoA_orig;
typedef MMRESULT (WINAPI *mixerGetLineInfoW_type)( HMIXEROBJ hmxobj, LPMIXERLINEW pmxl, DWORD fdwInfo);
extern mixerGetLineInfoW_type mixerGetLineInfoW_orig;
typedef MMRESULT (WINAPI *mixerGetID_type)( HMIXEROBJ hmxobj, UINT FAR *puMxId, DWORD fdwId);
extern mixerGetID_type mixerGetID_orig;
typedef MMRESULT (WINAPI *mixerGetLineControlsA_type)( HMIXEROBJ hmxobj, LPMIXERLINECONTROLSA pmxlc, DWORD fdwControls);
extern mixerGetLineControlsA_type mixerGetLineControlsA_orig;
typedef MMRESULT (WINAPI *mixerGetLineControlsW_type)( HMIXEROBJ hmxobj, LPMIXERLINECONTROLSW pmxlc, DWORD fdwControls);
extern mixerGetLineControlsW_type mixerGetLineControlsW_orig;
typedef MMRESULT (WINAPI *mixerGetControlDetailsA_type)( HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
extern mixerGetControlDetailsA_type mixerGetControlDetailsA_orig;
typedef MMRESULT (WINAPI *mixerGetControlDetailsW_type)( HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
extern mixerGetControlDetailsW_type mixerGetControlDetailsW_orig;
typedef MMRESULT (WINAPI *mixerSetControlDetails_type)( HMIXEROBJ hmxobj, LPMIXERCONTROLDETAILS pmxcd, DWORD fdwDetails);
extern mixerSetControlDetails_type mixerSetControlDetails_orig;
typedef DWORD (WINAPI *mmGetCurrentTask_type)(void);
extern mmGetCurrentTask_type mmGetCurrentTask_orig;
typedef void (WINAPI *mmTaskBlock_type)(DWORD);
extern mmTaskBlock_type mmTaskBlock_orig;
typedef UINT (WINAPI *mmTaskCreate_type)(LPTASKCALLBACK, HANDLE*, DWORD_PTR);
extern mmTaskCreate_type mmTaskCreate_orig;
typedef BOOL (WINAPI *mmTaskSignal_type)(DWORD);
extern mmTaskSignal_type mmTaskSignal_orig;
typedef VOID (WINAPI *mmTaskYield_type)(VOID);
extern mmTaskYield_type mmTaskYield_orig;
typedef MMRESULT (WINAPI *timeGetSystemTime_type)( LPMMTIME pmmt, UINT cbmmt);
extern timeGetSystemTime_type timeGetSystemTime_orig;
typedef DWORD (WINAPI *timeGetTime_type)(void);
extern timeGetTime_type timeGetTime_orig;
typedef MMRESULT (WINAPI *timeSetEvent_type)( UINT uDelay, UINT uResolution, LPTIMECALLBACK fptc, DWORD_PTR dwUser, UINT fuEvent);
extern timeSetEvent_type timeSetEvent_orig;
typedef MMRESULT (WINAPI *timeKillEvent_type)( UINT uTimerID);
extern timeKillEvent_type timeKillEvent_orig;
typedef MMRESULT (WINAPI *timeGetDevCaps_type)( LPTIMECAPS ptc, UINT cbtc);
extern timeGetDevCaps_type timeGetDevCaps_orig;
typedef MMRESULT (WINAPI *timeBeginPeriod_type)( UINT uPeriod);
extern timeBeginPeriod_type timeBeginPeriod_orig;
typedef MMRESULT (WINAPI *timeEndPeriod_type)( UINT uPeriod);
extern timeEndPeriod_type timeEndPeriod_orig;
typedef UINT (WINAPI *joyGetNumDevs_type)(void);
extern joyGetNumDevs_type joyGetNumDevs_orig;
typedef MMRESULT (WINAPI *joyConfigChanged_type)(DWORD dwFlags);
extern joyConfigChanged_type joyConfigChanged_orig;
typedef MMRESULT (WINAPI *joyGetDevCapsA_type)( UINT_PTR uJoyID, LPJOYCAPSA pjc, UINT cbjc);
extern joyGetDevCapsA_type joyGetDevCapsA_orig;
typedef MMRESULT (WINAPI *joyGetDevCapsW_type)( UINT_PTR uJoyID, LPJOYCAPSW pjc, UINT cbjc);
extern joyGetDevCapsW_type joyGetDevCapsW_orig;
typedef MMRESULT (WINAPI *joyGetPos_type)( UINT uJoyID, LPJOYINFO pji);
extern joyGetPos_type joyGetPos_orig;
typedef MMRESULT (WINAPI *joyGetPosEx_type)( UINT uJoyID, LPJOYINFOEX pji);
extern joyGetPosEx_type joyGetPosEx_orig;
typedef MMRESULT (WINAPI *joyGetThreshold_type)( UINT uJoyID, LPUINT puThreshold);
extern joyGetThreshold_type joyGetThreshold_orig;
typedef MMRESULT (WINAPI *joyReleaseCapture_type)( UINT uJoyID);
extern joyReleaseCapture_type joyReleaseCapture_orig;
typedef MMRESULT (WINAPI *joySetCapture_type)( HWND hwnd, UINT uJoyID, UINT uPeriod, BOOL fChanged);
extern joySetCapture_type joySetCapture_orig;
typedef MMRESULT (WINAPI *joySetThreshold_type)( UINT uJoyID, UINT uThreshold);
extern joySetThreshold_type joySetThreshold_orig;
typedef BOOL(WINAPI *mciDriverNotify_type)(HANDLE hwndCallback, MCIDEVICEID uDeviceID, UINT uStatus);
extern mciDriverNotify_type mciDriverNotify_orig;
typedef UINT (WINAPI *mciDriverYield_type)(UINT uDeviceID);
extern mciDriverYield_type mciDriverYield_orig;
typedef FOURCC (WINAPI *mmioStringToFOURCCA_type)( LPCSTR sz, UINT uFlags);
extern mmioStringToFOURCCA_type mmioStringToFOURCCA_orig;
typedef FOURCC (WINAPI *mmioStringToFOURCCW_type)( LPCWSTR sz, UINT uFlags);
extern mmioStringToFOURCCW_type mmioStringToFOURCCW_orig;
typedef LPMMIOPROC (WINAPI *mmioInstallIOProcA_type)( FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
extern mmioInstallIOProcA_type mmioInstallIOProcA_orig;
typedef LPMMIOPROC (WINAPI *mmioInstallIOProcW_type)( FOURCC fccIOProc, LPMMIOPROC pIOProc, DWORD dwFlags);
extern mmioInstallIOProcW_type mmioInstallIOProcW_orig;
typedef HMMIO (WINAPI *mmioOpenA_type)( LPSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
extern mmioOpenA_type mmioOpenA_orig;
typedef HMMIO (WINAPI *mmioOpenW_type)( LPWSTR pszFileName, LPMMIOINFO pmmioinfo, DWORD fdwOpen);
extern mmioOpenW_type mmioOpenW_orig;
typedef MMRESULT (WINAPI *mmioRenameA_type)( LPCSTR pszFileName, LPCSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename);
extern mmioRenameA_type mmioRenameA_orig;
typedef MMRESULT (WINAPI *mmioRenameW_type)( LPCWSTR pszFileName, LPCWSTR pszNewFileName, LPCMMIOINFO pmmioinfo, DWORD fdwRename);
extern mmioRenameW_type mmioRenameW_orig;
typedef MMRESULT (WINAPI *mmioClose_type)( HMMIO hmmio, UINT fuClose);
extern mmioClose_type mmioClose_orig;
typedef LONG (WINAPI *mmioRead_type)( HMMIO hmmio, HPSTR pch, LONG cch);
extern mmioRead_type mmioRead_orig;
typedef LONG (WINAPI *mmioWrite_type)( HMMIO hmmio, const char _huge* pch, LONG cch);
extern mmioWrite_type mmioWrite_orig;
typedef LONG (WINAPI *mmioSeek_type)( HMMIO hmmio, LONG lOffset, int iOrigin);
extern mmioSeek_type mmioSeek_orig;
typedef MMRESULT (WINAPI *mmioGetInfo_type)( HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuInfo);
extern mmioGetInfo_type mmioGetInfo_orig;
typedef MMRESULT (WINAPI *mmioSetInfo_type)( HMMIO hmmio, LPCMMIOINFO pmmioinfo, UINT fuInfo);
extern mmioSetInfo_type mmioSetInfo_orig;
typedef MMRESULT (WINAPI *mmioSetBuffer_type)( HMMIO hmmio, LPSTR pchBuffer, LONG cchBuffer, UINT fuBuffer);
extern mmioSetBuffer_type mmioSetBuffer_orig;
typedef MMRESULT (WINAPI *mmioFlush_type)( HMMIO hmmio, UINT fuFlush);
extern mmioFlush_type mmioFlush_orig;
typedef MMRESULT (WINAPI *mmioAdvance_type)( HMMIO hmmio, LPMMIOINFO pmmioinfo, UINT fuAdvance);
extern mmioAdvance_type mmioAdvance_orig;
typedef LRESULT (WINAPI *mmioSendMessage_type)( HMMIO hmmio, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
extern mmioSendMessage_type mmioSendMessage_orig;
typedef MMRESULT (WINAPI *mmioDescend_type)( HMMIO hmmio, LPMMCKINFO pmmcki, const MMCKINFO FAR* pmmckiParent, UINT fuDescend);
extern mmioDescend_type mmioDescend_orig;
typedef MMRESULT (WINAPI *mmioAscend_type)( HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuAscend);
extern mmioAscend_type mmioAscend_orig;
typedef MMRESULT (WINAPI *mmioCreateChunk_type)(HMMIO hmmio, LPMMCKINFO pmmcki, UINT fuCreate);
extern mmioCreateChunk_type mmioCreateChunk_orig;
typedef MCIERROR (WINAPI *mciSendCommandA_type)( MCIDEVICEID mciId, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
extern mciSendCommandA_type mciSendCommandA_orig;
typedef MCIERROR (WINAPI *mciSendCommandW_type)( MCIDEVICEID mciId, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
extern mciSendCommandW_type mciSendCommandW_orig;
typedef MCIERROR (WINAPI *mciSendStringA_type)( LPCSTR lpstrCommand, LPSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
extern mciSendStringA_type mciSendStringA_orig;
typedef MCIERROR (WINAPI *mciSendStringW_type)( LPCWSTR lpstrCommand, LPWSTR lpstrReturnString, UINT uReturnLength, HWND hwndCallback);
extern mciSendStringW_type mciSendStringW_orig;
typedef MCIDEVICEID (WINAPI *mciGetDeviceIDA_type)( LPCSTR pszDevice);
extern mciGetDeviceIDA_type mciGetDeviceIDA_orig;
typedef MCIDEVICEID (WINAPI *mciGetDeviceIDW_type)( LPCWSTR pszDevice);
extern mciGetDeviceIDW_type mciGetDeviceIDW_orig;
typedef MCIDEVICEID (WINAPI *mciGetDeviceIDFromElementIDA_type)( DWORD dwElementID, LPCSTR lpstrType );
extern mciGetDeviceIDFromElementIDA_type mciGetDeviceIDFromElementIDA_orig;
typedef MCIDEVICEID (WINAPI *mciGetDeviceIDFromElementIDW_type)( DWORD dwElementID, LPCWSTR lpstrType );
extern mciGetDeviceIDFromElementIDW_type mciGetDeviceIDFromElementIDW_orig;
typedef DWORD_PTR (WINAPI *mciGetDriverData_type)(UINT uDeviceID);
extern mciGetDriverData_type mciGetDriverData_orig;
typedef BOOL (WINAPI *mciGetErrorStringA_type)( MCIERROR mcierr, LPSTR pszText, UINT cchText);
extern mciGetErrorStringA_type mciGetErrorStringA_orig;
typedef BOOL (WINAPI *mciGetErrorStringW_type)( MCIERROR mcierr, LPWSTR pszText, UINT cchText);
extern mciGetErrorStringW_type mciGetErrorStringW_orig;
typedef BOOL (WINAPI *mciSetDriverData_type)(UINT uDeviceID, DWORD_PTR dwData);
extern mciSetDriverData_type mciSetDriverData_orig;
typedef BOOL (WINAPI *mciSetYieldProc_type)( MCIDEVICEID mciId, YIELDPROC fpYieldProc, DWORD dwYieldData);
extern mciSetYieldProc_type mciSetYieldProc_orig;
typedef BOOL (WINAPI *mciFreeCommandResource_type)(UINT uTable);
extern mciFreeCommandResource_type mciFreeCommandResource_orig;
typedef HTASK (WINAPI *mciGetCreatorTask_type)( MCIDEVICEID mciId);
extern mciGetCreatorTask_type mciGetCreatorTask_orig;
typedef YIELDPROC (WINAPI *mciGetYieldProc_type)( MCIDEVICEID mciId, LPDWORD pdwYieldData);
extern mciGetYieldProc_type mciGetYieldProc_orig;
typedef UINT (WINAPI *mciLoadCommandResource_type)(HANDLE hInstance, LPCWSTR lpResName, UINT uType);
extern mciLoadCommandResource_type mciLoadCommandResource_orig;
typedef BOOL (WINAPI *mciExecute_type)(LPCSTR pszCommand);
extern mciExecute_type mciExecute_orig;

View File

@ -1,218 +0,0 @@
;
; winmm.def
;
; Exports for WINMM DLL
;
LIBRARY WINMM
EXPORTS
CloseDriver
DefDriverProc
DriverCallback
DrvGetModuleHandle
GetDriverModuleHandle
;MigrateAllDrivers
;MigrateSoundEvents
;NotifyCallbackData
OpenDriver
;PlaySound
PlaySoundA
PlaySoundW
SendDriverMessage
;WOW32DriverCallback
;WOW32ResolveMultiMediaHandle
;WOWAppExit
;WinmmLogoff
;WinmmLogon
;aux32Message
auxGetDevCapsA
auxGetDevCapsW
auxGetNumDevs
auxGetVolume
auxOutMessage
auxSetVolume
;gfxAddGfx
;gfxBatchChange
;gfxCreateGfxFactoriesList
;gfxCreateZoneFactoriesList
;gfxDestroyDeviceInterfaceList
;gfxEnumerateGfxs
;gfxLogoff
;gfxLogon
;gfxModifyGfx
;gfxOpenGfx
;gfxRemoveGfx
;joy32Message
joyConfigChanged
joyGetDevCapsA
joyGetDevCapsW
joyGetNumDevs
joyGetPos
joyGetPosEx
joyGetThreshold
joyReleaseCapture
joySetCapture
joySetThreshold
;mci32Message
mciDriverNotify
mciDriverYield
mciExecute
mciFreeCommandResource
mciGetCreatorTask
mciGetDeviceIDA
mciGetDeviceIDFromElementIDA
mciGetDeviceIDFromElementIDW
mciGetDeviceIDW
mciGetDriverData
mciGetErrorStringA
mciGetErrorStringW
mciGetYieldProc
mciLoadCommandResource
mciSendCommandA
mciSendCommandW
mciSendStringA
mciSendStringW
mciSetDriverData
mciSetYieldProc
;mid32Message
midiConnect
midiDisconnect
midiInAddBuffer
midiInClose
midiInGetDevCapsA
midiInGetDevCapsW
midiInGetErrorTextA
midiInGetErrorTextW
midiInGetID
midiInGetNumDevs
midiInMessage
midiInOpen
midiInPrepareHeader
midiInReset
midiInStart
midiInStop
midiInUnprepareHeader
midiOutCacheDrumPatches
midiOutCachePatches
midiOutClose
midiOutGetDevCapsA
midiOutGetDevCapsW
midiOutGetErrorTextA
midiOutGetErrorTextW
midiOutGetID
midiOutGetNumDevs
midiOutGetVolume
midiOutLongMsg
midiOutMessage
midiOutOpen
midiOutPrepareHeader
midiOutReset
midiOutSetVolume
midiOutShortMsg
midiOutUnprepareHeader
midiStreamClose
midiStreamOpen
midiStreamOut
midiStreamPause
midiStreamPosition
midiStreamProperty
midiStreamRestart
midiStreamStop
mixerClose
mixerGetControlDetailsA
mixerGetControlDetailsW
mixerGetDevCapsA
mixerGetDevCapsW
mixerGetID
mixerGetLineControlsA
mixerGetLineControlsW
mixerGetLineInfoA
mixerGetLineInfoW
mixerGetNumDevs
mixerMessage
mixerOpen
mixerSetControlDetails
;mmDrvInstall
mmGetCurrentTask
mmTaskBlock
mmTaskCreate
mmTaskSignal
mmTaskYield
mmioAdvance
mmioAscend
mmioClose
mmioCreateChunk
mmioDescend
mmioFlush
mmioGetInfo
mmioInstallIOProcA
mmioInstallIOProcW
mmioOpenA
mmioOpenW
mmioRead
mmioRenameA
mmioRenameW
mmioSeek
mmioSendMessage
mmioSetBuffer
mmioSetInfo
mmioStringToFOURCCA
mmioStringToFOURCCW
mmioWrite
mmsystemGetVersion
;mod32Message
;mxd32Message
sndPlaySoundA
sndPlaySoundW
;tid32Message
timeBeginPeriod
timeEndPeriod
timeGetDevCaps
timeGetSystemTime
timeGetTime
timeKillEvent
timeSetEvent
waveInAddBuffer
waveInClose
waveInGetDevCapsA
waveInGetDevCapsW
waveInGetErrorTextA
waveInGetErrorTextW
waveInGetID
waveInGetNumDevs
waveInGetPosition
waveInMessage
waveInOpen
waveInPrepareHeader
waveInReset
waveInStart
waveInStop
waveInUnprepareHeader
waveOutBreakLoop
waveOutClose
waveOutGetDevCapsA
waveOutGetDevCapsW
waveOutGetErrorTextA
waveOutGetErrorTextW
waveOutGetID
waveOutGetNumDevs
waveOutGetPitch
waveOutGetPlaybackRate
waveOutGetPosition
waveOutGetVolume
waveOutMessage
waveOutOpen
waveOutPause
waveOutPrepareHeader
waveOutReset
waveOutRestart
waveOutSetPitch
waveOutSetPlaybackRate
waveOutSetVolume
waveOutUnprepareHeader
waveOutWrite
;wid32Message
;winmmSetDebugLevel
;wod32Message
setPluginVolume
setPluginMute

View File

@ -1,219 +0,0 @@
/**
* @file winmmshim.cpp
* @brief controls volume level of process by intercepting calls to winmm.dll
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010-2014, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "forwarding_api.h"
#include <xmmintrin.h>
#include <map>
#include <math.h>
using std::wstring;
static float sVolumeLevel = 1.f; // Could be covered by critical section,
static bool sMute = false; // not needed with atomicity and alignment.
static CRITICAL_SECTION sCriticalSection;
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
InitializeCriticalSection(&sCriticalSection);
}
return TRUE;
}
void ll_winmm_shim_initialize(){
static volatile bool initialized = false;
// do this only once using double-check locking
if (!initialized)
{
EnterCriticalSection(&sCriticalSection);
if (!initialized)
{ // bind to original winmm.dll
TCHAR system_path[MAX_PATH];
TCHAR dll_path[MAX_PATH];
::GetSystemDirectory(system_path, MAX_PATH);
// grab winmm.dll from system path, where it should live
wsprintf(dll_path, "%s\\winmm.dll", system_path);
HMODULE winmm_handle = ::LoadLibrary(dll_path);
if (winmm_handle != NULL)
{ // we have a dll, let's get out pointers!
init_function_pointers(winmm_handle);
::OutputDebugStringA("WINMM_SHIM.DLL: real winmm.dll initialized successfully\n");
initialized = true; // Last thing after completing setup
}
else
{
// failed to initialize real winmm.dll
::OutputDebugStringA("WINMM_SHIM.DLL: Failed to initialize real winmm.dll\n");
}
}
LeaveCriticalSection(&sCriticalSection);
}
}
extern "C"
{
// tracks the requested format for a given waveout buffer
struct WaveOutFormat
{
WaveOutFormat(int bits_per_sample)
: mBitsPerSample(bits_per_sample)
{}
int mBitsPerSample;
};
typedef std::map<HWAVEOUT, WaveOutFormat*> wave_out_map_t;
static wave_out_map_t sWaveOuts; // Covered by sCriticalSection
MMRESULT WINAPI waveOutOpen( LPHWAVEOUT phwo, UINT uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
{
ll_winmm_shim_initialize();
if (pwfx->wFormatTag != WAVE_FORMAT_PCM
|| (pwfx->wBitsPerSample != 8 && pwfx->wBitsPerSample != 16))
{ // uncompressed 8 and 16 bit sound are the only types we support
return WAVERR_BADFORMAT;
}
MMRESULT result = waveOutOpen_orig(phwo, uDeviceID, pwfx, dwCallback, dwInstance, fdwOpen);
if (result == MMSYSERR_NOERROR
&& ((fdwOpen & WAVE_FORMAT_QUERY) == 0)) // not just querying for format support
{ // remember the requested bits per sample, and associate with the given handle
WaveOutFormat* wave_outp = new WaveOutFormat(pwfx->wBitsPerSample);
EnterCriticalSection(&sCriticalSection);
sWaveOuts.insert(std::make_pair(*phwo, wave_outp));
LeaveCriticalSection(&sCriticalSection);
}
return result;
}
MMRESULT WINAPI waveOutClose( HWAVEOUT hwo)
{
ll_winmm_shim_initialize();
EnterCriticalSection(&sCriticalSection);
wave_out_map_t::iterator found_it = sWaveOuts.find(hwo);
if (found_it != sWaveOuts.end())
{ // forget what we know about this handle
delete found_it->second;
sWaveOuts.erase(found_it);
}
LeaveCriticalSection(&sCriticalSection);
return waveOutClose_orig(hwo);
}
MMRESULT WINAPI waveOutWrite( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh)
{
ll_winmm_shim_initialize();
MMRESULT result = MMSYSERR_NOERROR;
if (sMute)
{ // zero out the audio buffer when muted
memset(pwh->lpData, 0, pwh->dwBufferLength);
}
else if (sVolumeLevel != 1.f)
{ // need to apply volume level
int bits_per_sample(0);
EnterCriticalSection(&sCriticalSection);
wave_out_map_t::iterator found_it = sWaveOuts.find(hwo);
if (found_it != sWaveOuts.end())
{
bits_per_sample = found_it->second->mBitsPerSample;
}
LeaveCriticalSection(&sCriticalSection);
if (bits_per_sample)
{
switch (bits_per_sample)
{
case 8:
{
char volume = (char)(sVolumeLevel * 127.f);
for (unsigned int i = 0; i < pwh->dwBufferLength; i++)
{
// unsigned multiply doesn't use most significant bit, so shift by 7 bits
// to get resulting value back into 8 bits
pwh->lpData[i] = (pwh->lpData[i] * volume) >> 7;
}
break;
}
case 16:
{
short volume_16 = (short)(sVolumeLevel * 32767.f);
// copy volume level 4 times into 64 bit MMX register
__m64 volume_64 = _mm_set_pi16(volume_16, volume_16, volume_16, volume_16);
__m64* sample_64;
__m64* last_sample_64 = (__m64*)(pwh->lpData + pwh->dwBufferLength - sizeof(__m64));
// for everything that can be addressed in 64 bit multiples...
for (sample_64 = (__m64*)pwh->lpData;
sample_64 <= last_sample_64;
++sample_64)
{
//...multiply the samples by the volume...
__m64 scaled_sample = _mm_mulhi_pi16(*sample_64, volume_64);
// ...and shift left 1 bit since an unsigned multiple loses the most significant bit
// 0x7FFF * 0x7FFF = 0x3fff0001
// 0x3fff0001 << 1 = 0x7ffe0002
// notice that the LSB is always 0...should consider dithering
*sample_64 = _mm_slli_pi16(scaled_sample, 1);
}
// the captain has turned off the MMX sign, you are now free to use floating point registers
_mm_empty();
// finish remaining samples that didn't fit into 64 bit register
for (short* sample_16 = (short*)sample_64;
sample_16 < (short*)(pwh->lpData + pwh->dwBufferLength);
++sample_16)
{
*sample_16 = (*sample_16 * volume_16) >> 15;
}
break;
}
default:
// don't do anything
break;
}
}
}
return waveOutWrite_orig( hwo, pwh, cbwh);
}
void WINAPI setPluginVolume(float volume)
{
sVolumeLevel = volume;
}
void WINAPI setPluginMute(bool mute)
{
sMute = mute;
}
}

View File

@ -13,7 +13,6 @@ include(DragDrop)
include(EXPAT)
include(FMODEX)
include(GLOD)
include(GooglePerfTools)
include(Hunspell)
include(JsonCpp)
include(LLAppearance)
@ -1431,7 +1430,7 @@ if (WINDOWS)
set(ICON_PATH "project")
set(VIEWER_MACOSX_PHASE "a")
endif()
message("Copying icons for ${ICON_PATH}")
message(STATUS "Copying icons for ${ICON_PATH}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/icons/${ICON_PATH}/secondlife.ico"
@ -1682,7 +1681,7 @@ if (WINDOWS)
set_target_properties(${VIEWER_BINARY_NAME}
PROPERTIES
# *TODO -reenable this once we get server usage sorted out
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS ${TCMALLOC_LINK_FLAGS} /LARGEADDRESSAWARE"
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /LARGEADDRESSAWARE"
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO /LARGEADDRESSAWARE"
LINK_FLAGS_RELEASE "/FORCE:MULTIPLE /MAP\"secondlife-bin.MAP\" /OPT:REF /LARGEADDRESSAWARE"
)
@ -1702,20 +1701,8 @@ if (WINDOWS)
# In the meantime, if you have any ideas on how to easily maintain one list, either here or in viewer_manifest.py
# and have the build deps get tracked *please* tell me about it.
if(USE_TCMALLOC)
# Configure a var for tcmalloc location, if used.
# Note the need to specify multiple names explicitly.
set(GOOGLE_PERF_TOOLS_SOURCE
${SHARED_LIB_STAGING_DIR}/Release/libtcmalloc_minimal.dll
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libtcmalloc_minimal.dll
${SHARED_LIB_STAGING_DIR}/Debug/libtcmalloc_minimal-debug.dll
)
endif(USE_TCMALLOC)
set(COPY_INPUT_DEPENDENCIES
# The following commented dependencies are determined at variably at build time. Can't do this here.
#${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libtcmalloc_minimal.dll => None ... Skipping libtcmalloc_minimal.dll
${CMAKE_SOURCE_DIR}/../etc/message.xml
${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llcommon.dll
@ -1783,7 +1770,7 @@ if (WINDOWS)
--configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
--grid=${GRID}
--channel=${VIEWER_CHANNEL}
"--channel=${VIEWER_CHANNEL}"
--versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt
--source=${CMAKE_CURRENT_SOURCE_DIR}
--touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat
@ -1846,7 +1833,7 @@ if (WINDOWS)
--artwork=${ARTWORK_DIR}
--build=${CMAKE_CURRENT_BINARY_DIR}
--buildtype=${CMAKE_BUILD_TYPE}
--channel=${VIEWER_CHANNEL}
"--channel=${VIEWER_CHANNEL}"
--versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt
--configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
@ -1957,7 +1944,6 @@ target_link_libraries(${VIEWER_BINARY_NAME}
${LLLOGIN_LIBRARIES}
${LLPHYSICS_LIBRARIES}
${LLPHYSICSEXTENSIONS_LIBRARIES}
${TCMALLOC_LIBRARIES}
${LLAPPEARANCE_LIBRARIES}
)
@ -1986,7 +1972,7 @@ if (LINUX)
--artwork=${ARTWORK_DIR}
--build=${CMAKE_CURRENT_BINARY_DIR}
--buildtype=${CMAKE_BUILD_TYPE}
--channel=${VIEWER_CHANNEL}
"--channel=${VIEWER_CHANNEL}"
--versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt
--configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/packaged
@ -2014,7 +2000,7 @@ if (LINUX)
--configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/packaged
--grid=${GRID}
--channel=${VIEWER_CHANNEL}
"--channel=${VIEWER_CHANNEL}"
--versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt
--source=${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS
@ -2073,7 +2059,7 @@ if (DARWIN)
--configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
--grid=${GRID}
--channel=${VIEWER_CHANNEL}
"--channel=${VIEWER_CHANNEL}"
--versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt
--source=${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS
@ -2102,11 +2088,10 @@ if (DARWIN)
--artwork=${ARTWORK_DIR}
--build=${CMAKE_CURRENT_BINARY_DIR}
--buildtype=${CMAKE_BUILD_TYPE}
--channel=${VIEWER_CHANNEL}
--configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
--grid=${GRID}
--channel=${VIEWER_CHANNEL}
"--channel=${VIEWER_CHANNEL}"
--versionfile=${CMAKE_CURRENT_BINARY_DIR}/viewer_version.txt
--source=${CMAKE_CURRENT_SOURCE_DIR}
--touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
@ -2123,9 +2108,10 @@ endif (INSTALL)
if (PACKAGE)
set(SYMBOL_SEARCH_DIRS "")
# Note that the path to VIEWER_SYMBOL_FILE must match that in ../../build.sh
if (WINDOWS)
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-windows.tar.bz2")
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-windows-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2")
# slplugin.exe failing symbols dump - need to debug, might have to do with updated version of google breakpad
# set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX} slplugin.exe")
set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
@ -2139,14 +2125,14 @@ if (PACKAGE)
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}")
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}")
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}")
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin.tar.bz2")
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2")
set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger")
set(VIEWER_EXE_GLOBS "'Second Life' mac-crash-logger")
set(VIEWER_LIB_GLOB "*.dylib")
endif (DARWIN)
if (LINUX)
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged")
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-linux.tar.bz2")
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-linux-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2")
set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin")
set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin")
set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*")

View File

@ -1 +1 @@
5.0.2
5.1.0

View File

@ -2045,11 +2045,11 @@
<key>Comment</key>
<string>Size (in bytes) for each coroutine stack</string>
<key>Persist</key>
<integer>0</integer>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>262144</integer>
<integer>524288</integer>
</map>
<key>CrashOnStartup</key>
<map>
@ -6365,17 +6365,6 @@
<key>Value</key>
<integer>512</integer>
</map>
<key>MemProfiling</key>
<map>
<key>Comment</key>
<string>You want to use tcmalloc's memory profiling options.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>MenuAccessKeyTime</key>
<map>
<key>Comment</key>
@ -10068,28 +10057,28 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>RenderUseFarClip</key>
<map>
<key>Comment</key>
<string>If false, frustum culling will ignore far clip plane.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>RenderUseImpostors</key>
<map>
<key>Comment</key>
<key>RenderUseFarClip</key>
<map>
<key>Comment</key>
<string>If false, frustum culling will ignore far clip plane.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>RenderUseImpostors</key>
<map>
<key>Comment</key>
<string>OBSOLETE and UNUSED. See RenderAvatarMaxNonImpostors and RenderAvatarMaxComplexity.</string>
<key>Persist</key>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
<key>RenderAutoMuteByteLimit</key>
<map>
<key>Comment</key>

View File

@ -1,17 +1,23 @@
# just run this script each time after you change the installer's name to fix the icon misalignment
#!/bin/bash
cp -r ../../../../build-darwin-i386/newview/*.dmg ~/Desktop/TempBuild.dmg
hdid ~/Desktop/TempBuild.dmg
open -a finder /Volumes/Second\ Life\ Installer
osascript dmg-cleanup.applescript
umount /Volumes/Second\ Life\ Installer/
hdid ~/Desktop/TempBuild.dmg
open -a finder /Volumes/Second\ Life\ Installer
#cp /Volumes/Second\ Life\ Installer/.DS_Store ~/Desktop/_DS_Store
# just run this script each time after you change the installer's name to fix the icon misalignment
mydir="$(dirname "$0")"
# If there's more than one DMG in more than one build directory, pick the most
# recent one.
dmgfile="$(ls -t "$mydir/../../../../build-darwin-*/newview/*.dmg" | head -n 1)"
dmgwork="$HOME/Desktop/TempBuild.dmg"
mounted="/Volumes/Second Life Installer"
cp -r "$dmgfile" "$dmgwork"
hdid "$dmgwork"
open -a finder "$mounted"
osascript "$mydir/dmg-cleanup.applescript"
umount "$mounted"/
hdid "$dmgwork"
open -a finder "$mounted"
#cp "$mounted"/.DS_Store ~/Desktop/_DS_Store
#chflags nohidden ~/Desktop/_DS_Store
#cp ~/Desktop/_DS_Store ./firstlook-dmg/_DS_Store
#cp ~/Desktop/_DS_Store ./publicnightly-dmg/_DS_Store
#cp ~/Desktop/_DS_Store ./release-dmg/_DS_Store
#cp ~/Desktop/_DS_Store ./releasecandidate-dmg/_DS_Store
#umount /Volumes/Second\ Life\ Installer/
#rm ~/Desktop/_DS_Store ~/Desktop/TempBuild.dmg
#cp ~/Desktop/_DS_Store "$mydir/firstlook-dmg/_DS_Store"
#cp ~/Desktop/_DS_Store "$mydir/publicnightly-dmg/_DS_Store"
#cp ~/Desktop/_DS_Store "$mydir/release-dmg/_DS_Store"
#cp ~/Desktop/_DS_Store "$mydir/releasecandidate-dmg/_DS_Store"
#umount "$mounted"/
#rm ~/Desktop/_DS_Store "$dmgwork"

View File

@ -3306,6 +3306,7 @@ LLSD LLAppViewer::getViewerInfo() const
info["VIEWER_VERSION"] = version;
info["VIEWER_VERSION_STR"] = LLVersionInfo::getVersion();
info["CHANNEL"] = LLVersionInfo::getChannel();
info["ADDRESS_SIZE"] = ADDRESS_SIZE;
std::string build_config = LLVersionInfo::getBuildConfig();
if (build_config != "Release")
{

View File

@ -260,7 +260,7 @@ bool LLAppViewerMacOSX::restoreErrorTrap()
unsigned int reset_count = 0;
#define SET_SIG(S) sigaction(SIGABRT, &act, &old_act); \
if((unsigned int)act.sa_sigaction != (unsigned int) old_act.sa_sigaction) \
if(act.sa_sigaction != old_act.sa_sigaction) \
++reset_count;
// Synchronous signals
SET_SIG(SIGABRT)

View File

@ -35,6 +35,22 @@
#include "llwaterparammanager.h"
#include "llwlhandlers.h"
#include "llwlparammanager.h"
#include "lltrans.h"
std::string LLWLParamKey::toString() const
{
switch (scope)
{
case SCOPE_LOCAL:
return name + std::string(" (") + LLTrans::getString("Local") + std::string(")");
break;
case SCOPE_REGION:
return name + std::string(" (") + LLTrans::getString("Region") + std::string(")");
break;
default:
return name + " (?)";
}
}
std::string LLEnvPrefs::getWaterPresetName() const
{

View File

@ -48,6 +48,87 @@ public:
} EScope;
};
struct LLWLParamKey : LLEnvKey
{
public:
// scope and source of a param set (WL sky preset)
std::string name;
EScope scope;
// for conversion from LLSD
static const int NAME_IDX = 0;
static const int SCOPE_IDX = 1;
inline LLWLParamKey(const std::string& n, EScope s)
: name(n), scope(s)
{
}
inline LLWLParamKey(LLSD llsd)
: name(llsd[NAME_IDX].asString()), scope(EScope(llsd[SCOPE_IDX].asInteger()))
{
}
inline LLWLParamKey() // NOT really valid, just so std::maps can return a default of some sort
: name(""), scope(SCOPE_LOCAL)
{
}
inline LLWLParamKey(std::string& stringVal)
{
size_t len = stringVal.length();
if (len > 0)
{
name = stringVal.substr(0, len - 1);
scope = (EScope) atoi(stringVal.substr(len - 1, len).c_str());
}
}
inline std::string toStringVal() const
{
std::stringstream str;
str << name << scope;
return str.str();
}
inline LLSD toLLSD() const
{
LLSD llsd = LLSD::emptyArray();
llsd.append(LLSD(name));
llsd.append(LLSD(scope));
return llsd;
}
inline void fromLLSD(const LLSD& llsd)
{
name = llsd[NAME_IDX].asString();
scope = EScope(llsd[SCOPE_IDX].asInteger());
}
inline bool operator <(const LLWLParamKey other) const
{
if (name < other.name)
{
return true;
}
else if (name > other.name)
{
return false;
}
else
{
return scope < other.scope;
}
}
inline bool operator ==(const LLWLParamKey other) const
{
return (name == other.name) && (scope == other.scope);
}
std::string toString() const;
};
class LLEnvironmentSettings
{
public:

View File

@ -2133,7 +2133,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
LLVector4a src;
U32 vec[4];
vec[0] = vec[1] = vec[2] = vec[3] = color.mAll;
vec[0] = vec[1] = vec[2] = vec[3] = color.asRGBA();
src.loadua((F32*) vec);
@ -2169,7 +2169,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
LLColor4U glow4u = LLColor4U(0,0,0,glow);
U32 glow32 = glow4u.mAll;
U32 glow32 = glow4u.asRGBA();
U32 vec[4];
vec[0] = vec[1] = vec[2] = vec[3] = glow32;

View File

@ -66,13 +66,13 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl)
std::string name = check->getName();
if(name == "touch_only")
{
LLPipeline::toggleRenderScriptedTouchBeacons(NULL);
LLPipeline::toggleRenderScriptedTouchBeacons();
// Don't allow both to be ON at the same time. Toggle the other one off if both now on.
if (
LLPipeline::getRenderScriptedTouchBeacons(NULL) &&
LLPipeline::getRenderScriptedBeacons(NULL) )
LLPipeline::getRenderScriptedTouchBeacons() &&
LLPipeline::getRenderScriptedBeacons() )
{
LLPipeline::setRenderScriptedBeacons(FALSE);
LLPipeline::setRenderScriptedBeacons(false);
getChild<LLCheckBoxCtrl>("scripted")->setControlValue(LLSD(FALSE));
getChild<LLCheckBoxCtrl>("scripted")->setValue(FALSE);
getChild<LLCheckBoxCtrl>("touch_only")->setControlValue(LLSD(TRUE)); // just to be sure it's in sync with llpipeline
@ -81,13 +81,13 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl)
}
else if(name == "scripted")
{
LLPipeline::toggleRenderScriptedBeacons(NULL);
LLPipeline::toggleRenderScriptedBeacons();
// Don't allow both to be ON at the same time. Toggle the other one off if both now on.
if (
LLPipeline::getRenderScriptedTouchBeacons(NULL) &&
LLPipeline::getRenderScriptedBeacons(NULL) )
LLPipeline::getRenderScriptedTouchBeacons() &&
LLPipeline::getRenderScriptedBeacons() )
{
LLPipeline::setRenderScriptedTouchBeacons(FALSE);
LLPipeline::setRenderScriptedTouchBeacons(false);
getChild<LLCheckBoxCtrl>("touch_only")->setControlValue(LLSD(FALSE));
getChild<LLCheckBoxCtrl>("touch_only")->setValue(FALSE);
getChild<LLCheckBoxCtrl>("scripted")->setControlValue(LLSD(TRUE)); // just to be sure it's in sync with llpipeline
@ -100,13 +100,13 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl)
else if(name == "moapbeacon") LLPipeline::setRenderMOAPBeacons(check->get());
else if(name == "highlights")
{
LLPipeline::toggleRenderHighlights(NULL);
LLPipeline::toggleRenderHighlights();
// Don't allow both to be OFF at the same time. Toggle the other one on if both now off.
if (
!LLPipeline::getRenderBeacons(NULL) &&
!LLPipeline::getRenderHighlights(NULL) )
!LLPipeline::getRenderBeacons() &&
!LLPipeline::getRenderHighlights() )
{
LLPipeline::setRenderBeacons(TRUE);
LLPipeline::setRenderBeacons(true);
getChild<LLCheckBoxCtrl>("beacons")->setControlValue(LLSD(TRUE));
getChild<LLCheckBoxCtrl>("beacons")->setValue(TRUE);
getChild<LLCheckBoxCtrl>("highlights")->setControlValue(LLSD(FALSE)); // just to be sure it's in sync with llpipeline
@ -115,13 +115,13 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl)
}
else if(name == "beacons")
{
LLPipeline::toggleRenderBeacons(NULL);
LLPipeline::toggleRenderBeacons();
// Don't allow both to be OFF at the same time. Toggle the other one on if both now off.
if (
!LLPipeline::getRenderBeacons(NULL) &&
!LLPipeline::getRenderHighlights(NULL) )
!LLPipeline::getRenderBeacons() &&
!LLPipeline::getRenderHighlights() )
{
LLPipeline::setRenderHighlights(TRUE);
LLPipeline::setRenderHighlights(true);
getChild<LLCheckBoxCtrl>("highlights")->setControlValue(LLSD(TRUE));
getChild<LLCheckBoxCtrl>("highlights")->setValue(TRUE);
getChild<LLCheckBoxCtrl>("beacons")->setControlValue(LLSD(FALSE)); // just to be sure it's in sync with llpipeline

View File

@ -184,7 +184,7 @@ void LLFloaterBump::onScrollListRightClicked(LLUICtrl* ctrl, S32 x, S32 y)
std::string mute_msg = (LLMuteList::getInstance()->isMuted(mItemUUID, mNames[mItemUUID])) ? "UnmuteAvatar" : "MuteAvatar";
mPopupMenu->getChild<LLUICtrl>("Avatar Mute")->setValue(LLTrans::getString(mute_msg));
mPopupMenu->setItemEnabled(std::string("Zoom In"), (BOOL)gObjectList.findObject(mItemUUID));
mPopupMenu->setItemEnabled(std::string("Zoom In"), bool(gObjectList.findObject(mItemUUID)));
((LLContextMenu*)mPopupMenu)->show(x, y);
LLMenuGL::showPopup(ctrl, mPopupMenu, x, y);

View File

@ -282,7 +282,7 @@ void LLFloaterIMNearbyChat::onTearOffClicked()
LLFloaterIMSessionTab::onTearOffClicked();
// see CHUI-170: Save torn-off state of the nearby chat between sessions
BOOL in_the_multifloater = (BOOL)getHost();
bool in_the_multifloater(getHost());
gSavedPerAccountSettings.setBOOL("NearbyChatIsNotTornOff", in_the_multifloater);
}

View File

@ -119,7 +119,7 @@ BOOL LLFloaterMap::handleDoubleClick(S32 x, S32 y, MASK mask)
LLVector3d pos_global = mMap->viewPosToGlobal(x, y);
LLTracker::stopTracking(NULL);
LLTracker::stopTracking(false);
LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance();
if (world_map)
{

View File

@ -558,7 +558,7 @@ void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const std::string&
}
else
{
LLTracker::stopTracking(NULL);
LLTracker::stopTracking(false);
}
setDefaultBtn("Teleport");
}
@ -602,7 +602,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
}
else
{
LLTracker::stopTracking(NULL);
LLTracker::stopTracking(false);
}
setDefaultBtn("Teleport");
}
@ -628,7 +628,7 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
if (!sim_info)
{
// We haven't found a region for that point yet, leave the tracking to the world map
LLTracker::stopTracking(NULL);
LLTracker::stopTracking(false);
LLWorldMap::getInstance()->setTracking(pos_global);
S32 world_x = S32(pos_global.mdV[0] / 256);
S32 world_y = S32(pos_global.mdV[1] / 256);
@ -644,7 +644,7 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
{
// Down region. Show the blue circle of death!
// i.e. let the world map that this and tell it it's invalid
LLTracker::stopTracking(NULL);
LLTracker::stopTracking(false);
LLWorldMap::getInstance()->setTracking(pos_global);
LLWorldMap::getInstance()->setTrackingInvalid();
setDefaultBtn("");
@ -863,7 +863,7 @@ void LLFloaterWorldMap::friendsChanged()
(buddy_info && !buddy_info->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)) ||
gAgent.isGodlike())
{
LLTracker::stopTracking(NULL);
LLTracker::stopTracking(false);
}
}
}
@ -1070,7 +1070,7 @@ void LLFloaterWorldMap::onLandmarkComboPrearrange( )
if( current_choice.isNull() || !list->setCurrentByID( current_choice ) )
{
LLTracker::stopTracking(NULL);
LLTracker::stopTracking(false);
}
}
@ -1080,7 +1080,7 @@ void LLFloaterWorldMap::onComboTextEntry()
// Reset the tracking whenever we start typing into any of the search fields,
// so that hitting <enter> does an auto-complete versus teleporting us to the
// previously selected landmark/friend.
LLTracker::stopTracking(NULL);
LLTracker::stopTracking(false);
}
void LLFloaterWorldMap::onSearchTextEntry( )
@ -1103,7 +1103,7 @@ void LLFloaterWorldMap::onLandmarkComboCommit()
LLUUID asset_id;
LLUUID item_id = list->getCurrentID();
LLTracker::stopTracking(NULL);
LLTracker::stopTracking(false);
//RN: stopTracking() clears current combobox selection, need to reassert it here
list->setCurrentByID(item_id);
@ -1158,7 +1158,7 @@ void LLFloaterWorldMap::onAvatarComboPrearrange( )
if( !list->setCurrentByID( current_choice ) || current_choice.isNull() )
{
LLTracker::stopTracking(NULL);
LLTracker::stopTracking(false);
}
}
@ -1271,7 +1271,7 @@ void LLFloaterWorldMap::onCoordinatesCommit()
void LLFloaterWorldMap::onClearBtn()
{
mTrackedStatus = LLTracker::TRACKING_NOTHING;
LLTracker::stopTracking((void *)(intptr_t)TRUE);
LLTracker::stopTracking(true);
LLWorldMap::getInstance()->cancelTracking();
mSLURL = LLSLURL(); // Clear the SLURL since it's invalid
mSetToUserPosition = TRUE; // Revert back to the current user position

View File

@ -930,7 +930,7 @@ bool LLChatLogParser::parse(std::string& raw, LLSD& im, const LLSD& parse_params
//possibly a case of complex object names consisting of 3+ words
if (!has_name)
{
U32 divider_pos = stuff.find(NAME_TEXT_DIVIDER);
std::string::size_type divider_pos = stuff.find(NAME_TEXT_DIVIDER);
if (divider_pos != std::string::npos && divider_pos < (stuff.length() - NAME_TEXT_DIVIDER.length()))
{
im[LL_IM_FROM] = stuff.substr(0, divider_pos);

View File

@ -531,7 +531,7 @@ void LLMaterialMgr::onPutResponse(bool success, const LLSD& content)
LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL;
for (LLSD::array_const_iterator faceIter = response_data.beginArray(); faceIter != response_data.endArray(); ++faceIter)
{
# ifndef LL_RELEASE_FOR_DOWNLOAD
# ifdef SHOW_ASSERT // same condition that controls llassert()
const LLSD& face_data = *faceIter; // conditional to avoid unused variable warning
# endif
llassert(face_data.isMap());

View File

@ -735,7 +735,7 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color,
continue;
}
S32 offset = px + py * image_width;
((U32*)datap)[offset] = color.mAll;
((U32*)datap)[offset] = color.asRGBA();
}
// top line
@ -748,7 +748,7 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color,
continue;
}
S32 offset = px + py * image_width;
((U32*)datap)[offset] = color.mAll;
((U32*)datap)[offset] = color.asRGBA();
}
}
else
@ -770,7 +770,7 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color,
continue;
}
S32 offset = p_x + p_y * image_width;
((U32*)datap)[offset] = color.mAll;
((U32*)datap)[offset] = color.asRGBA();
}
}
}
@ -988,6 +988,6 @@ void LLNetMap::handleStopTracking (const LLSD& userdata)
if (mPopupMenu)
{
mPopupMenu->setItemEnabled ("Stop Tracking", false);
LLTracker::stopTracking ((void*)LLTracker::isTracking(NULL));
LLTracker::stopTracking (LLTracker::isTracking(NULL));
}
}

View File

@ -48,7 +48,7 @@ namespace {
U32 render_type = render_type_from_string( iter->asString() );
if ( render_type != 0 )
{
LLPipeline::toggleRenderTypeControl( (void*) render_type );
LLPipeline::toggleRenderTypeControl( render_type );
}
}
}
@ -59,7 +59,7 @@ namespace {
U32 render_type = render_type_from_string( request["type"].asString() );
if ( render_type != 0 )
{
response["value"] = LLPipeline::hasRenderTypeControl( (void*) render_type );
response["value"] = LLPipeline::hasRenderTypeControl( render_type );
}
else
{
@ -87,7 +87,7 @@ namespace {
U32 render_feature = feature_from_string( iter->asString() );
if ( render_feature != 0 )
{
LLPipeline::toggleRenderDebugControl( (void*) render_feature );
LLPipeline::toggleRenderDebugControl( render_feature );
}
}
}
@ -126,7 +126,7 @@ namespace {
U32 info_display = info_display_from_string( iter->asString() );
if ( info_display != 0 )
{
LLPipeline::toggleRenderDebug( (void*) info_display );
LLPipeline::toggleRenderDebug( info_display );
}
}
}

View File

@ -116,26 +116,26 @@ void LLSearchHistory::addEntry(const std::string& search_query)
mSearchHistory.push_front(item);
}
bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LLSearchHistoryItem& right)
bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LLSearchHistoryItem& right) const
{
S32 result = LLStringUtil::compareInsensitive(search_query, right.search_query);
return result < 0;
}
bool LLSearchHistory::LLSearchHistoryItem::operator > (const LLSearchHistory::LLSearchHistoryItem& right)
bool LLSearchHistory::LLSearchHistoryItem::operator > (const LLSearchHistory::LLSearchHistoryItem& right) const
{
S32 result = LLStringUtil::compareInsensitive(search_query, right.search_query);
return result > 0;
}
bool LLSearchHistory::LLSearchHistoryItem::operator==(const LLSearchHistory::LLSearchHistoryItem& right)
bool LLSearchHistory::LLSearchHistoryItem::operator==(const LLSearchHistory::LLSearchHistoryItem& right) const
{
return 0 == LLStringUtil::compareInsensitive(search_query, right.search_query);
}
bool LLSearchHistory::LLSearchHistoryItem::operator==(const std::string& right)
bool LLSearchHistory::LLSearchHistoryItem::operator==(const std::string& right) const
{
return 0 == LLStringUtil::compareInsensitive(search_query, right);
}

View File

@ -99,16 +99,16 @@ public:
/**
* Allows std::list sorting
*/
bool operator < (const LLSearchHistory::LLSearchHistoryItem& right);
bool operator < (const LLSearchHistory::LLSearchHistoryItem& right) const;
/**
* Allows std::list sorting
*/
bool operator > (const LLSearchHistory::LLSearchHistoryItem& right);
bool operator > (const LLSearchHistory::LLSearchHistoryItem& right) const;
bool operator==(const LLSearchHistoryItem& right);
bool operator==(const LLSearchHistoryItem& right) const;
bool operator==(const std::string& right);
bool operator==(const std::string& right) const;
/**
* Serializes search history item to LLSD

View File

@ -122,7 +122,7 @@ void LLSkinningUtil::initSkinningMatrixPalette(
// static
void LLSkinningUtil::checkSkinWeights(LLVector4a* weights, U32 num_vertices, const LLMeshSkinInfo* skin)
{
#ifndef LL_RELEASE_FOR_DOWNLOAD
#ifdef SHOW_ASSERT // same condition that controls llassert()
const S32 max_joints = skin->mJointNames.size();
for (U32 j=0; j<num_vertices; j++)
{

Some files were not shown because too many files have changed in this diff Show More