Merge with viewer64, first pass.
commit
2290d5ed16
|
|
@ -24,9 +24,10 @@ build-linux-*
|
|||
build-darwin-*
|
||||
build-vc80/
|
||||
build-vc100/
|
||||
build-vc100_x64/
|
||||
build-vc120/
|
||||
build-vc120_x64/
|
||||
build-vc120-32/
|
||||
build-vc120-64/
|
||||
indra/build-vc[0-9]*
|
||||
indra/CMakeFiles
|
||||
indra/lib/mono/1.0/*.dll
|
||||
|
|
|
|||
28
BuildParams
28
BuildParams
|
|
@ -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 ####
|
||||
|
|
@ -83,5 +65,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=""
|
||||
|
||||
|
|
|
|||
1776
autobuild.xml
1776
autobuild.xml
File diff suppressed because it is too large
Load Diff
219
build.sh
219
build.sh
|
|
@ -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 - <FS:TM> FS doesnt use this
|
||||
|
||||
# mangle the changelog
|
||||
dch --force-bad-version \
|
||||
--distribution unstable \
|
||||
|
|
@ -316,47 +341,26 @@ then
|
|||
|
||||
# upload debian package and create repository
|
||||
begin_section "Upload Debian Repository"
|
||||
for deb_file in ../*.deb; do
|
||||
upload_item debian $deb_file binary/octet-stream
|
||||
for deb_file in `/bin/ls ../packages_public/*.deb ../*.deb 2>/dev/null`; do
|
||||
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
|
||||
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
|
||||
if [ -d "$build_log_dir/debian_repo" ]
|
||||
then
|
||||
pushd "$build_log_dir/debian_repo"
|
||||
cat > Release <<EOF
|
||||
Archive: stable
|
||||
Component: main
|
||||
Origin: Teamcity
|
||||
Label: Teamcity built .debs
|
||||
Architecture: i386 amd64 any
|
||||
EOF
|
||||
if dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz \
|
||||
&& dpkg-scansources . /dev/null | gzip -9c > Sources.gz
|
||||
then
|
||||
begin_section Packages.gz
|
||||
gunzip --stdout Packages.gz
|
||||
for file in *.deb
|
||||
do
|
||||
stat "$file" | sed 2q
|
||||
md5sum "$file"
|
||||
done
|
||||
end_section Packages.gz
|
||||
|
||||
for file in *
|
||||
do
|
||||
upload_item debian_repo "$file" binary/octet-stream
|
||||
done
|
||||
else
|
||||
record_failure 'Unable to generate Packages.gz or Sources.gz'
|
||||
create_deb_repo
|
||||
|
||||
# Rename the local debian_repo* directories so that the master buildscript
|
||||
# doesn't make a remote repo again.
|
||||
for debian_repo_type in debian_repo debian_repo_private; do
|
||||
if [ -d "$build_log_dir/$debian_repo_type" ]; then
|
||||
mv $build_log_dir/$debian_repo_type $build_log_dir/${debian_repo_type}_pushed
|
||||
fi
|
||||
popd
|
||||
|
||||
process_pending_uploads
|
||||
|
||||
# Rename the local debian_repo directory so that the master buildscript
|
||||
# doesn't make a remote repo again.
|
||||
|
||||
mv $build_log_dir/debian_repo $build_log_dir/debian_repo_pushed
|
||||
fi
|
||||
done
|
||||
end_section "Upload Debian Repository"
|
||||
|
||||
else
|
||||
|
|
@ -372,18 +376,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
|
||||
|
|
@ -391,32 +394,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
|
||||
|
|
@ -427,7 +442,7 @@ then
|
|||
done
|
||||
fi
|
||||
fi
|
||||
end_section Upload Installer
|
||||
end_section "Uploads"
|
||||
else
|
||||
record_event "skipping upload of installer"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -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 " "
|
||||
|
||||
|
|
|
|||
|
|
@ -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,17 +60,13 @@ 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
|
||||
#<FS:LO> Change MSVC multi processor from a hardcoded 8 to no number to allow the compiler to spawn a number equal to the number of thread execution units the computer has.
|
||||
#${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /Zo /MD /MP8 /Ob0 -D_SECURE_STL=0"
|
||||
"${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
|
||||
#<FS:LO> Change MSVC multi processor from a hardcoded 8 to no number to allow the compiler to spawn a number equal to the number of thread execution units the computer has.
|
||||
#"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /Zo /MD /MP8 /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
|
||||
"${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 /IGNORE:4099")
|
||||
|
|
@ -64,93 +74,32 @@ if (WINDOWS)
|
|||
set(CMAKE_CXX_STANDARD_LIBRARIES "")
|
||||
set(CMAKE_C_STANDARD_LIBRARIES "")
|
||||
|
||||
# <FS:Ansariel> [AVX Optimization]
|
||||
# add_definitions(
|
||||
# /DLL_WINDOWS=1
|
||||
# /DDOM_DYNAMIC
|
||||
# /DUNICODE
|
||||
# /D_UNICODE
|
||||
# /GS
|
||||
# /TP
|
||||
# /W3
|
||||
# /c
|
||||
# /Zc:forScope
|
||||
# /nologo
|
||||
# /Oy-
|
||||
# /Zc:wchar_t-
|
||||
add_definitions(
|
||||
/DNOMINMAX
|
||||
# /DDOM_DYNAMIC # For shared library colladadom
|
||||
)
|
||||
add_compile_options(
|
||||
/GS
|
||||
/TP
|
||||
/W3
|
||||
/c
|
||||
/Zc:forScope
|
||||
/nologo
|
||||
/Oy-
|
||||
# /arch:SSE2
|
||||
# /fp:fast
|
||||
# )
|
||||
if (USE_AVX_OPTIMIZATION)
|
||||
add_definitions(
|
||||
/DLL_WINDOWS=1
|
||||
/DNOMINMAX
|
||||
# /DDOM_DYNAMIC # For shared library colladadom
|
||||
/DUNICODE
|
||||
/D_UNICODE
|
||||
/GS
|
||||
/TP
|
||||
/W3
|
||||
/c
|
||||
/Zc:forScope
|
||||
/nologo
|
||||
/Oy-
|
||||
/Zc:wchar_t-
|
||||
/arch:AVX
|
||||
# /fp:fast
|
||||
)
|
||||
elseif (USE_AVX2_OPTIMIZATION)
|
||||
add_definitions(
|
||||
/DLL_WINDOWS=1
|
||||
/DNOMINMAX
|
||||
# /DDOM_DYNAMIC # For shared library colladadom
|
||||
/DUNICODE
|
||||
/D_UNICODE
|
||||
/GS
|
||||
/TP
|
||||
/W3
|
||||
/c
|
||||
/Zc:forScope
|
||||
/nologo
|
||||
/Oy-
|
||||
/Zc:wchar_t-
|
||||
/arch:AVX2
|
||||
# /fp:fast
|
||||
)
|
||||
else (USE_AVX_OPTIMIZATION)
|
||||
add_definitions(
|
||||
/DLL_WINDOWS=1
|
||||
/DNOMINMAX
|
||||
# /DDOM_DYNAMIC
|
||||
/DUNICODE
|
||||
/D_UNICODE
|
||||
/GS
|
||||
/TP
|
||||
/W3
|
||||
/c
|
||||
/Zc:forScope
|
||||
/nologo
|
||||
/Oy-
|
||||
/Zc:wchar_t-
|
||||
# /arch:SSE2
|
||||
# /fp:fast
|
||||
)
|
||||
if( NOT ND_BUILD64BIT_ARCH )
|
||||
add_definitions( /arch:SSE2 )
|
||||
endif( NOT ND_BUILD64BIT_ARCH )
|
||||
/fp:fast
|
||||
)
|
||||
|
||||
endif (USE_AVX_OPTIMIZATION)
|
||||
# </FS:Ansariel> [AVX Optimization]
|
||||
# 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}")
|
||||
|
||||
if( ND_BUILD64BIT_ARCH )
|
||||
add_definitions("/wd4267 /DND_BUILD64BIT_ARCH" )
|
||||
else( ND_BUILD64BIT_ARCH )
|
||||
|
|
@ -163,101 +112,22 @@ 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)
|
||||
|
||||
#<FS:ND> Gentoo defines _FORTIFY_SOURCE by default
|
||||
if (NOT ND_SYSTEM_DEFINES_FORTIFY_SOURCE)
|
||||
#</FS:ND>
|
||||
|
||||
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})
|
||||
|
||||
#<FS:ND> Gentoo defines _FORTIFY_SOURCE by default
|
||||
endif (NOT ND_SYSTEM_DEFINES_FORTIFY_SOURCE)
|
||||
#</FS:ND>
|
||||
|
||||
# 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)
|
||||
|
||||
#<FS:ND> Disable unused-but-set-variable for GCC >= 4.6. It causes a lot of warning/errors all over the source. Fixing that would result in changing a good amount of files.
|
||||
if(${CXX_VERSION_NUMBER} GREATER 460)
|
||||
set(CMAKE_CXX_FLAGS "-Wno-unused-but-set-variable ${CMAKE_CXX_FLAGS}")
|
||||
endif (${CXX_VERSION_NUMBER} GREATER 460)
|
||||
#</FS:ND>
|
||||
#<FS:ND> Disable attribute warnings for GCC >= 4.7. It causes a lot of warning/errors in boost.
|
||||
if(${CXX_VERSION_NUMBER} GREATER 470)
|
||||
set(CMAKE_CXX_FLAGS "-Wno-attributes ${CMAKE_CXX_FLAGS}")
|
||||
endif (${CXX_VERSION_NUMBER} GREATER 470)
|
||||
#</FS:ND>
|
||||
#<FS:ND> Disable unsed local typedef warnings for GCC >= 4.8. It causes a lot of warning/errors in boost.
|
||||
if(${CXX_VERSION_NUMBER} GREATER 480)
|
||||
set(CMAKE_CXX_FLAGS "-Wno-unused-local-typedefs ${CMAKE_CXX_FLAGS}")
|
||||
endif (${CXX_VERSION_NUMBER} GREATER 480)
|
||||
#</FS:ND>
|
||||
|
||||
|
||||
|
||||
# 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
|
||||
|
|
@ -272,78 +142,37 @@ if (LINUX)
|
|||
|
||||
|
||||
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 -Wl,--build-id -Wl,-rpath,'$ORIGIN:$ORIGIN/../lib' -Wl,--exclude-libs,ALL")
|
||||
set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory")
|
||||
endif (NOT USESYSTEMLIBS)
|
||||
|
||||
# <FS:TS> Enable AVX optimizations if requested and at least GCC 4.6.
|
||||
if (USE_AVX_OPTIMIZATION)
|
||||
if (NOT (${CXX_VERSION_NUMBER} LESS 460))
|
||||
add_definitions(-mavx)
|
||||
else (NOT (${CXX_VERSION_NUMBER} LESS 460))
|
||||
error ("AVX optimizations require at least version 4.6.0 of GCC.")
|
||||
endif (NOT (${CXX_VERSION_NUMBER} LESS 460))
|
||||
endif (USE_AVX_OPTIMIZATION)
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
|
||||
# <FS:ND> Build without frame pointer if requested. Otherwise profiling might not work reliable. N.B. Win32 uses FP based calling by default.
|
||||
if( NO_OMIT_FRAMEPOINTER )
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-fno-omit-frame-pointer ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
endif( NO_OMIT_FRAMEPOINTER )
|
||||
# </FS:ND>
|
||||
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")
|
||||
# <FS:TS> Take a deep breath and turn on C++11...
|
||||
set(DARWIN_extra_cstar_flags "-std=c++11 -stdlib=libc++ -Wno-overloaded-virtual ${DARWIN_extra_cstar_flags}")
|
||||
# </FS:TS>
|
||||
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}")
|
||||
if (USE_AVX_OPTIMIZATION)
|
||||
if (XCODE_VERSION GREATER 4.9)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS AVX)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL -Ofast)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -mavx ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-Ofast -mavx ${CMAKE_C_FLAGS_RELEASE}")
|
||||
else (XCODE_VERSION GREATER 4.9)
|
||||
error("Darwin AVX Optimizations only available on Xcode5 with Clang, silly person!")
|
||||
endif (XCODE_VERSION GREATER 4.9)
|
||||
else (USE_AVX_OPTIMIZATION)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS SSE3)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL -O3)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -msse3 ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -msse3 ${CMAKE_C_FLAGS_RELEASE}")
|
||||
endif (USE_AVX_OPTIMIZATION)
|
||||
set(ENABLE_SIGNING TRUE)
|
||||
set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
|
||||
# <FS:ND> Build without frame pointer if requested. Otherwise profiling might not work reliable. N.B. Win32 uses FP based calling by default.
|
||||
if( NO_OMIT_FRAMEPOINTER )
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-fno-omit-frame-pointer ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
endif( NO_OMIT_FRAMEPOINTER )
|
||||
# </FS:ND>
|
||||
|
||||
## Really?? On developer machines too?
|
||||
##set(ENABLE_SIGNING TRUE)
|
||||
##set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
|
||||
endif (DARWIN)
|
||||
|
||||
|
||||
|
|
@ -372,26 +201,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)
|
||||
|
||||
if (ND_BUILD64BIT_ARCH)
|
||||
add_definitions(-DND_BUILD64BIT_ARCH)
|
||||
endif (ND_BUILD64BIT_ARCH)
|
||||
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
|
||||
|
|
|
|||
|
|
@ -2,15 +2,13 @@
|
|||
# Construct the version and copyright information based on package data.
|
||||
include(Python)
|
||||
|
||||
if( ND_BUILD64BIT_ARCH )
|
||||
set( ND_PKG_FLAGS "-m64" )
|
||||
else( ND_BUILD64BIT_ARCH )
|
||||
set( ND_PKG_FLAGS "" )
|
||||
endif( ND_BUILD64BIT_ARCH )
|
||||
|
||||
# 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 ${ND_PKG_FLAGS} > 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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -55,7 +55,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}"
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ set(cmake_SOURCE_FILES
|
|||
FindFMODEX.cmake
|
||||
FindGLH.cmake
|
||||
FindGoogleBreakpad.cmake
|
||||
FindGooglePerfTools.cmake
|
||||
FindHUNSPELL.cmake
|
||||
FindJsonCpp.cmake
|
||||
FindNDOF.cmake
|
||||
|
|
@ -45,11 +44,8 @@ set(cmake_SOURCE_FILES
|
|||
GLOD.cmake
|
||||
## GStreamer010Plugin.cmake
|
||||
GetPrerequisites_2_8.cmake
|
||||
## Glui.cmake
|
||||
Glut.cmake
|
||||
GoogleBreakpad.cmake
|
||||
GoogleMock.cmake
|
||||
GooglePerfTools.cmake
|
||||
Growl.cmake
|
||||
Havok.cmake
|
||||
Hunspell.cmake
|
||||
|
|
@ -90,7 +86,6 @@ set(cmake_SOURCE_FILES
|
|||
Prebuilt.cmake
|
||||
PulseAudio.cmake
|
||||
Python.cmake
|
||||
QuickTimePlugin.cmake
|
||||
TemplateCheck.cmake
|
||||
Tut.cmake
|
||||
UI.cmake
|
||||
|
|
|
|||
|
|
@ -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/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})
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -55,29 +43,19 @@ if(WINDOWS)
|
|||
)
|
||||
|
||||
if( NOT ND_USE_OPENJPEG2 )
|
||||
set(debug_files ${debug_files} openjpegd.dll )
|
||||
set(release_files ${release_files} openjpeg.dll )
|
||||
else()
|
||||
set(debug_files ${debug_files} openjp2.dll )
|
||||
set(release_files ${release_files} openjp2.dll )
|
||||
endif( NOT ND_USE_OPENJPEG2 )
|
||||
|
||||
set(debug_files ${debug_files} growl++.dll growl.dll )
|
||||
set(release_files ${release_files} growl++.dll growl.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)
|
||||
if( NOT ND_BUILD64BIT_ARCH )
|
||||
set(debug_files ${debug_files} fmodexL.dll)
|
||||
set(release_files ${release_files} fmodex.dll)
|
||||
else( NOT ND_BUILD64BIT_ARCH )
|
||||
set(debug_files ${debug_files} fmodexL64.dll)
|
||||
set(release_files ${release_files} fmodex64.dll)
|
||||
endif( NOT ND_BUILD64BIT_ARCH )
|
||||
|
||||
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)
|
||||
|
||||
#*******************************
|
||||
|
|
@ -180,10 +158,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
|
||||
libgrowl.dylib
|
||||
libgrowl++.dylib
|
||||
|
|
@ -221,14 +197,13 @@ elseif(LINUX)
|
|||
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
|
||||
# *FIX - figure out what to do with duplicate libalut.so here -brad
|
||||
set(release_files
|
||||
#libapr-1.so.0
|
||||
#libaprutil-1.so.0
|
||||
libapr-1.so.0
|
||||
libaprutil-1.so.0
|
||||
libatk-1.0.so
|
||||
#libdb-5.1.so
|
||||
libexpat.so
|
||||
libexpat.so.1
|
||||
#libfreetype.so.6.6.2
|
||||
#libfreetype.so.6
|
||||
libdb-5.1.so
|
||||
${EXPAT_COPY}
|
||||
libfreetype.so.6.6.2
|
||||
libfreetype.so.6
|
||||
libGLOD.so
|
||||
libgmodule-2.0.so
|
||||
libgobject-2.0.so
|
||||
|
|
@ -240,24 +215,10 @@ elseif(LINUX)
|
|||
libfontconfig.so.1.8.0
|
||||
libfontconfig.so.1
|
||||
)
|
||||
if( NOT ND_BUILD64BIT_ARCH )
|
||||
set(release_files ${release_files}
|
||||
libapr-1.so.0
|
||||
libaprutil-1.so.0
|
||||
libdb-5.1.so
|
||||
libfreetype.so.6.6.2
|
||||
libfreetype.so.6
|
||||
)
|
||||
endif( NOT ND_BUILD64BIT_ARCH )
|
||||
if( NOT ND_USE_OPENJPEG2 )
|
||||
set(release_files ${release_files} libopenjpeg.so )
|
||||
endif( NOT ND_USE_OPENJPEG2 )
|
||||
|
||||
|
||||
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")
|
||||
|
|
@ -314,13 +275,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}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -27,7 +27,7 @@ endif(WIN32)
|
|||
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)
|
||||
|
|
@ -70,10 +70,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!")
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ find_path(HUNSPELL_INCLUDE_DIR hunspell.h
|
|||
PATH_SUFFIXES hunspell
|
||||
)
|
||||
|
||||
set(HUNSPELL_NAMES ${HUNSPELL_NAMES} libhunspell-1.3.0 libhunspell hunspell)
|
||||
set(HUNSPELL_NAMES ${HUNSPELL_NAMES} libhunspell-1.3.0 libhunspell)
|
||||
find_library(HUNSPELL_LIBRARY
|
||||
NAMES ${HUNSPELL_NAMES}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -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)
|
||||
|
|
@ -1,63 +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 ON)
|
||||
set (USE_TCMALLOC OFF) # <FS:ND> tcmalloc removal
|
||||
|
||||
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)
|
||||
|
||||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 ${autobuild_install_platform}
|
||||
message("cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install
|
||||
--install-dir=${AUTOBUILD_INSTALL_DIR}
|
||||
${_binary} ")
|
||||
endif(DEBUG_PREBUILT)
|
||||
|
|
|
|||
|
|
@ -1,53 +0,0 @@
|
|||
# -*- cmake -*-
|
||||
|
||||
if(INSTALL_PROPRIETARY)
|
||||
include(Prebuilt)
|
||||
if (WINDOWS)
|
||||
use_prebuilt_binary(quicktime)
|
||||
endif (WINDOWS)
|
||||
endif(INSTALL_PROPRIETARY)
|
||||
|
||||
if(HAVE_QUICKTIME_3P AND WINDOWS)
|
||||
include(Prebuilt)
|
||||
use_prebuilt_binary(quicktime)
|
||||
endif(HAVE_QUICKTIME_3P AND WINDOWS)
|
||||
|
||||
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)
|
||||
|
||||
|
|
@ -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_LIB_NAMES
|
||||
|
|
|
|||
|
|
@ -9,15 +9,12 @@
|
|||
# LINUX - Linux
|
||||
# WINDOWS - Windows
|
||||
|
||||
set(NDTARGET_ARCH "x86" CACHE STRING "Build 64 or 32 bit viewer. Defaults to 32 bit.")
|
||||
set(ND_USE_OPENJPEG2 OFF CACHE BOOL "Use OpenJPEG 2.1 instead of 1.4. Default off.")
|
||||
|
||||
if( ${NDTARGET_ARCH} STREQUAL "x64" )
|
||||
set( ND_BUILD64BIT_ARCH ON )
|
||||
elseif( ${NDTARGET_ARCH} STREQUAL "universal" )
|
||||
set( ND_BUILD64BIT_ARCH ON )
|
||||
set( OSX_UNIVERSAL_ARCH ON )
|
||||
endif()
|
||||
# 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.
|
||||
|
||||
|
|
@ -78,49 +75,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)
|
||||
if( ND_BUILD64BIT_ARCH )
|
||||
set(WORD_SIZE 64)
|
||||
endif( ND_BUILD64BIT_ARCH )
|
||||
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
|
||||
|
|
@ -150,71 +153,45 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(DARWIN 1)
|
||||
|
||||
# now we only support Xcode 6.0 using 10.9 (Mavericks), minimum OS 10.7 (Lion)
|
||||
#<FS:TS> Be a bit more flexible: support Xcode 6 or 7 and SDKs from 10.9 to 10.11
|
||||
#set(XCODE_VERSION 6.0)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
|
||||
#set(CMAKE_OSX_SYSROOT macosx10.9)
|
||||
if(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk")
|
||||
# Assume Xcode 7 if Sierra SDK is present
|
||||
set(XCODE_VERSION 7.3)
|
||||
set(CMAKE_OSX_SYSROOT macosx10.12)
|
||||
message(STATUS "OS X SDK 10.12 found.")
|
||||
elseif(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk")
|
||||
# Assume Xcode 7 if El Capitan SDK is present
|
||||
set(XCODE_VERSION 7.3)
|
||||
set(CMAKE_OSX_SYSROOT macosx10.11)
|
||||
message(STATUS "OS X SDK 10.11 found.")
|
||||
elseif(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk")
|
||||
# Assume Xcode 7 if Yosemite SDK is present
|
||||
set(XCODE_VERSION 7.0)
|
||||
set(CMAKE_OSX_SYSROOT macosx10.10)
|
||||
message(STATUS "OS X SDK 10.10 found.")
|
||||
elseif(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk")
|
||||
# Assume Xcode 6 if only Mavericks SDK is present
|
||||
set(XCODE_VERSION 6.0)
|
||||
set(CMAKE_OSX_SYSROOT macosx10.9)
|
||||
message(STATUS "OS X SDK 10.9 found.")
|
||||
else(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk")
|
||||
error("Unable to determine which OS X SDK to use. Giving up.")
|
||||
endif(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk")
|
||||
|
||||
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_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)
|
||||
# <FS:TS> Need libc++ for C++11 and Boost
|
||||
#set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
|
||||
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")
|
||||
if(ND_BUILD64BIT_ARCH)
|
||||
set(CMAKE_OSX_ARCHITECTURES "x86_64")
|
||||
endif(ND_BUILD64BIT_ARCH)
|
||||
if(OSX_UNIVERSAL_ARCH)
|
||||
set(CMAKE_OSX_ARCHITECTURES "i386;x86_64")
|
||||
endif(OSX_UNIVERSAL_ARCH)
|
||||
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})
|
||||
if(ND_BUILD64BIT_ARCH)
|
||||
set(ARCH x86_64)
|
||||
endif(ND_BUILD64BIT_ARCH)
|
||||
if(OSX_UNIVERSAL_ARCH)
|
||||
set(ARCH universal)
|
||||
endif(OSX_UNIVERSAL_ARCH)
|
||||
set(LL_ARCH ${ARCH}_darwin)
|
||||
set(LL_ARCH_DIR universal-darwin)
|
||||
if(ND_BUILD64BIT_ARCH)
|
||||
set(WORD_SIZE 64)
|
||||
else (ND_BUILD64BIT_ARCH)
|
||||
set(WORD_SIZE 32)
|
||||
endif(ND_BUILD64BIT_ARCH)
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
# Default deploy grid
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -2156,5 +2156,3 @@ LLAvatarAppearance::LLMaskedMorph::LLMaskedMorph(LLVisualParam *morph_target, BO
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ include(Boost)
|
|||
include(LLSharedLibs)
|
||||
include(JsonCpp)
|
||||
include(GoogleBreakpad)
|
||||
include(GooglePerfTools)
|
||||
include(Copy3rdPartyLibs)
|
||||
include(ZLIB)
|
||||
include(URIPARSER)
|
||||
|
|
@ -282,6 +281,13 @@ list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES})
|
|||
|
||||
if(LLCOMMON_LINK_SHARED)
|
||||
add_library (llcommon SHARED ${llcommon_SOURCE_FILES})
|
||||
if(NOT ADDRESS_SIZE EQUAL 32)
|
||||
if(WINDOWS)
|
||||
##add_definitions(/FIXED:NO)
|
||||
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
|
||||
add_definitions(-fPIC)
|
||||
endif(WINDOWS)
|
||||
endif(NOT ADDRESS_SIZE EQUAL 32)
|
||||
if(WINDOWS)
|
||||
# always generate llcommon.pdb, even for "Release" builds
|
||||
set_target_properties(llcommon PROPERTIES LINK_FLAGS "/DEBUG")
|
||||
|
|
@ -374,8 +380,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)
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -101,7 +101,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(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -89,43 +89,15 @@ public:
|
|||
#if LL_FASTTIMER_USE_RDTSC
|
||||
static U32 getCPUClockCount32()
|
||||
{
|
||||
U32 ret_val;
|
||||
#if !defined(ND_BUILD64BIT_ARCH)
|
||||
__asm
|
||||
{
|
||||
_emit 0x0f
|
||||
_emit 0x31
|
||||
shr eax,8
|
||||
shl edx,24
|
||||
or eax, edx
|
||||
mov dword ptr [ret_val], eax
|
||||
}
|
||||
#else
|
||||
unsigned __int64 val = __rdtsc();
|
||||
val = val >> 8;
|
||||
ret_val = static_cast<U32>( val );
|
||||
#endif
|
||||
return ret_val;
|
||||
return static_cast<U32>(val);
|
||||
}
|
||||
|
||||
// return full timer value, *not* shifted by 8 bits
|
||||
static U64 getCPUClockCount64()
|
||||
{
|
||||
U64 ret_val;
|
||||
#if !defined(ND_BUILD64BIT_ARCH)
|
||||
__asm
|
||||
{
|
||||
_emit 0x0f
|
||||
_emit 0x31
|
||||
mov eax,eax
|
||||
mov edx,edx
|
||||
mov dword ptr [ret_val+4], edx
|
||||
mov dword ptr [ret_val], eax
|
||||
}
|
||||
#else
|
||||
ret_val = static_cast<U64>( __rdtsc() );
|
||||
#endif
|
||||
return ret_val;
|
||||
return static_cast<U64>( __rdtsc() );
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
@ -188,32 +160,16 @@ public:
|
|||
// Mac+Linux+Solaris FAST x86 implementation of CPU clock
|
||||
static U32 getCPUClockCount32()
|
||||
{
|
||||
// <FS:ND> Proper RDTSC timings for Linux/Mac
|
||||
|
||||
// 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);
|
||||
|
||||
// </FS:ND>
|
||||
}
|
||||
|
||||
static U64 getCPUClockCount64()
|
||||
{
|
||||
// <FS:ND> Proper RDTSC timings for Linux/Mac
|
||||
|
||||
// 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);
|
||||
|
||||
// </FS:ND>
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -45,10 +45,7 @@ typedef FILE LLFILE;
|
|||
typedef struct _stat llstat;
|
||||
#else
|
||||
typedef struct stat llstat;
|
||||
//<FS:TS> This file only exists on Linux
|
||||
# if LL_LINUX
|
||||
# include <bits/postypes.h>
|
||||
# endif
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifndef S_ISREG
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@
|
|||
#include "llsys.h"
|
||||
#include "llframetimer.h"
|
||||
#include "lltrace.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//static
|
||||
|
|
@ -592,12 +591,7 @@ char* LLPrivateMemoryPool::LLMemoryBlock::allocate()
|
|||
void LLPrivateMemoryPool::LLMemoryBlock::freeMem(void* addr)
|
||||
{
|
||||
//bit index
|
||||
// U32 idx = ((U32)addr - (U32)mBuffer - mDummySize) / mSlotSize ;
|
||||
// <FS:ND> 64 bit fix
|
||||
unsigned char *p1 = reinterpret_cast<unsigned char*>(addr);
|
||||
unsigned char *p2 = reinterpret_cast<unsigned char*>(mBuffer);
|
||||
U32 idx = ( p1 - p2 - mDummySize) / mSlotSize ;
|
||||
// </FS:ND>
|
||||
uintptr_t idx = ((uintptr_t)addr - (uintptr_t)mBuffer - mDummySize) / mSlotSize ;
|
||||
|
||||
U32* bits = &mUsageBits ;
|
||||
if(idx >= 32)
|
||||
|
|
@ -779,7 +773,7 @@ char* LLPrivateMemoryPool::LLMemoryChunk::allocate(U32 size)
|
|||
|
||||
void LLPrivateMemoryPool::LLMemoryChunk::freeMem(void* addr)
|
||||
{
|
||||
U32 blk_idx = getPageIndex(/*<ND/> 64 bit fix (U32)*/addr) ;
|
||||
U32 blk_idx = getPageIndex((uintptr_t)addr) ;
|
||||
LLMemoryBlock* blk = (LLMemoryBlock*)(mMetaBuffer + blk_idx * sizeof(LLMemoryBlock)) ;
|
||||
blk = blk->mSelf ;
|
||||
|
||||
|
|
@ -804,13 +798,7 @@ bool LLPrivateMemoryPool::LLMemoryChunk::empty()
|
|||
|
||||
bool LLPrivateMemoryPool::LLMemoryChunk::containsAddress(const char* addr) const
|
||||
{
|
||||
//return (U32)mBuffer <= (U32)addr && (U32)mBuffer + mBufferSize > (U32)addr ;
|
||||
// <FS:ND> 64 bit fix
|
||||
unsigned char const *pBuffer = reinterpret_cast<unsigned char const*>( mBuffer );
|
||||
unsigned char const *pAddr = reinterpret_cast<unsigned char const*>( addr );
|
||||
|
||||
return pBuffer <= pAddr && pBuffer + mBufferSize > pAddr ;
|
||||
// </FS:ND>
|
||||
return (uintptr_t)mBuffer <= (uintptr_t)addr && (uintptr_t)mBuffer + mBufferSize > (uintptr_t)addr ;
|
||||
}
|
||||
|
||||
//debug use
|
||||
|
|
@ -843,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 ; )
|
||||
|
|
@ -872,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++)
|
||||
|
|
@ -880,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 ;
|
||||
}
|
||||
}
|
||||
|
|
@ -891,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 ;
|
||||
}
|
||||
}
|
||||
|
|
@ -1167,16 +1155,9 @@ void LLPrivateMemoryPool::LLMemoryChunk::addToAvailBlockList(LLMemoryBlock* blk)
|
|||
return ;
|
||||
}
|
||||
|
||||
//U32 LLPrivateMemoryPool::LLMemoryChunk::getPageIndex(U32 addr)
|
||||
U32 LLPrivateMemoryPool::LLMemoryChunk::getPageIndex(void * addr) // <ND/> 64 bit fix
|
||||
U32 LLPrivateMemoryPool::LLMemoryChunk::getPageIndex(uintptr_t addr)
|
||||
{
|
||||
// return (addr - (U32)mDataBuffer) / mMinBlockSize ;
|
||||
// <FS:ND> 64 bit fix
|
||||
unsigned char *pAddr = reinterpret_cast< unsigned char* >( addr );
|
||||
unsigned char *pBuffer = reinterpret_cast< unsigned char* >( mDataBuffer );
|
||||
|
||||
return (pAddr - pBuffer) / mMinBlockSize ;
|
||||
// </FS:ND>
|
||||
return (addr - (uintptr_t)mDataBuffer) / mMinBlockSize ;
|
||||
}
|
||||
|
||||
//for mAvailBlockList
|
||||
|
|
@ -1514,13 +1495,7 @@ void LLPrivateMemoryPool::removeChunk(LLMemoryChunk* chunk)
|
|||
|
||||
U16 LLPrivateMemoryPool::findHashKey(const char* addr)
|
||||
{
|
||||
// return (((U32)addr) / CHUNK_SIZE) % mHashFactor ;
|
||||
// <FS:ND> 64 bit fix
|
||||
unsigned char const *pAddr = reinterpret_cast< unsigned char const *>( addr );
|
||||
U64 nAddr = reinterpret_cast<U64>(pAddr);
|
||||
|
||||
return ( nAddr / CHUNK_SIZE) % mHashFactor ;
|
||||
// </FS:ND>
|
||||
return (((uintptr_t)addr) / CHUNK_SIZE) % mHashFactor ;
|
||||
}
|
||||
|
||||
LLPrivateMemoryPool::LLMemoryChunk* LLPrivateMemoryPool::findChunk(const char* addr)
|
||||
|
|
@ -1745,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() ;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -435,9 +427,7 @@ public:
|
|||
{
|
||||
bool operator()(const LLMemoryBlock* const& lhs, const LLMemoryBlock* const& rhs)
|
||||
{
|
||||
//return (U32)lhs->getBuffer() < (U32)rhs->getBuffer();
|
||||
//<ND/> 64 bit fix
|
||||
return reinterpret_cast<unsigned char*>(lhs->getBuffer()) < reinterpret_cast<unsigned char*>(rhs->getBuffer());
|
||||
return (uintptr_t)lhs->getBuffer() < (uintptr_t)rhs->getBuffer();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
@ -468,8 +458,7 @@ public:
|
|||
void dump() ;
|
||||
|
||||
private:
|
||||
// U32 getPageIndex(U32 addr) ;
|
||||
U32 getPageIndex(void* addr) ; // <ND/> 64 bit fix
|
||||
U32 getPageIndex(uintptr_t addr) ;
|
||||
U32 getBlockLevel(U32 size) ;
|
||||
U16 getPageLevel(U32 size) ;
|
||||
LLMemoryBlock* addBlock(U32 blk_idx) ;
|
||||
|
|
|
|||
|
|
@ -148,6 +148,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
|
||||
|
|
|
|||
|
|
@ -47,11 +47,6 @@
|
|||
# define LL_X86 1
|
||||
#elif LL_MSVC && _M_IX86
|
||||
# define LL_X86 1
|
||||
#elif LL_CLANG && ( defined(__amd64__) || defined(__x86_64__) )
|
||||
# define LL_X86_64 1
|
||||
# define LL_X86 1
|
||||
#elif LL_CLANG && ( defined(__i386__) )
|
||||
# define LL_X86 1
|
||||
#elif LL_GNUC && ( defined(__amd64__) || defined(__x86_64__) )
|
||||
# define LL_X86_64 1
|
||||
# define LL_X86 1
|
||||
|
|
@ -402,7 +397,6 @@ 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);
|
||||
|
||||
|
|
|
|||
|
|
@ -63,10 +63,7 @@ void set_thread_name( DWORD dwThreadID, const char* threadName)
|
|||
|
||||
__try
|
||||
{
|
||||
// <FS:ND> Proper arguments for RaiseException
|
||||
// ::RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (DWORD*)&info );
|
||||
::RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (ULONG_PTR*)&info );
|
||||
// </FS:ND>
|
||||
}
|
||||
__except(EXCEPTION_CONTINUE_EXECUTION)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -151,7 +151,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
|
||||
|
|
@ -167,21 +167,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)
|
||||
|
||||
|
|
@ -217,7 +219,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 ""
|
||||
)
|
||||
|
|
|
|||
|
|
@ -50,14 +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
|
||||
{
|
||||
// <FS:ND> 64 bit compatibility
|
||||
// static const int shift(sizeof(unsigned long) * 4);
|
||||
static const int shift(sizeof(4 * 4));
|
||||
// </FS:ND>
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +65,7 @@ std::string HttpStatus::toHex() const
|
|||
std::ostringstream result;
|
||||
result.width(8);
|
||||
result.fill('0');
|
||||
result << std::hex << operator unsigned long() << std::dec;
|
||||
result << std::hex << operator U32();
|
||||
return result.str();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -34,16 +34,19 @@ import sys
|
|||
import time
|
||||
import select
|
||||
import getopt
|
||||
from threading import Thread
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
except ImportError:
|
||||
from StringIO import StringIO
|
||||
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
|
||||
from SocketServer import ThreadingMixIn
|
||||
|
||||
from llbase.fastest_elementtree import parse as xml_parse
|
||||
from llbase import llsd
|
||||
|
||||
# we're in llcorehttp/tests ; testrunner.py is found in llmessage/tests
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
|
||||
"llmessage", "tests"))
|
||||
|
||||
from testrunner import freeport, run, debug, VERBOSE
|
||||
|
||||
class TestHTTPRequestHandler(BaseHTTPRequestHandler):
|
||||
|
|
@ -269,7 +272,7 @@ class TestHTTPRequestHandler(BaseHTTPRequestHandler):
|
|||
# Suppress error output as well
|
||||
pass
|
||||
|
||||
class Server(ThreadingMixIn, HTTPServer):
|
||||
class Server(HTTPServer):
|
||||
# This pernicious flag is on by default in HTTPServer. But proper
|
||||
# operation of freeport() absolutely depends on it being off.
|
||||
allow_reuse_address = False
|
||||
|
|
@ -293,22 +296,26 @@ if __name__ == "__main__":
|
|||
if option == "-V" or option == "--valgrind":
|
||||
do_valgrind = True
|
||||
|
||||
# Instantiate a Server(TestHTTPRequestHandler) on the first free port
|
||||
# in the specified port range. Doing this inline is better than in a
|
||||
# daemon thread: if it blows up here, we'll get a traceback. If it blew up
|
||||
# in some other thread, the traceback would get eaten and we'd run the
|
||||
# subject test program anyway.
|
||||
httpd, port = freeport(xrange(8000, 8020),
|
||||
lambda port: Server(('127.0.0.1', port), TestHTTPRequestHandler))
|
||||
# function to make a server with specified port
|
||||
make_server = lambda port: Server(('127.0.0.1', port), TestHTTPRequestHandler)
|
||||
|
||||
if not sys.platform.startswith("win"):
|
||||
# Instantiate a Server(TestHTTPRequestHandler) on a port chosen by the
|
||||
# runtime.
|
||||
httpd = make_server(0)
|
||||
else:
|
||||
# "Then there's Windows"
|
||||
# Instantiate a Server(TestHTTPRequestHandler) on the first free port
|
||||
# in the specified port range.
|
||||
httpd, port = freeport(xrange(8000, 8020), make_server)
|
||||
|
||||
# Pass the selected port number to the subject test program via the
|
||||
# environment. We don't want to impose requirements on the test program's
|
||||
# command-line parsing -- and anyway, for C++ integration tests, that's
|
||||
# performed in TUT code rather than our own.
|
||||
os.environ["LL_TEST_PORT"] = str(port)
|
||||
debug("$LL_TEST_PORT = %s", port)
|
||||
os.environ["LL_TEST_PORT"] = str(httpd.server_port)
|
||||
debug("$LL_TEST_PORT = %s", httpd.server_port)
|
||||
if do_valgrind:
|
||||
args = ["valgrind", "--log-file=./valgrind.log"] + args
|
||||
path_search = True
|
||||
sys.exit(run(server=Thread(name="httpd", target=httpd.serve_forever), use_path=path_search, *args))
|
||||
|
||||
sys.exit(run(server_inst=httpd, use_path=path_search, *args))
|
||||
|
|
|
|||
|
|
@ -1,265 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
"""\
|
||||
@file testrunner.py
|
||||
@author Nat Goodspeed
|
||||
@date 2009-03-20
|
||||
@brief Utilities for writing wrapper scripts for ADD_COMM_BUILD_TEST unit tests
|
||||
|
||||
$LicenseInfo:firstyear=2009&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$
|
||||
"""
|
||||
|
||||
from __future__ import with_statement
|
||||
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
import errno
|
||||
import socket
|
||||
|
||||
VERBOSE = os.environ.get("INTEGRATION_TEST_VERBOSE", "0") # default to quiet
|
||||
# Support usage such as INTEGRATION_TEST_VERBOSE=off -- distressing to user if
|
||||
# that construct actually turns on verbosity...
|
||||
VERBOSE = not re.match(r"(0|off|false|quiet)$", VERBOSE, re.IGNORECASE)
|
||||
|
||||
if VERBOSE:
|
||||
def debug(fmt, *args):
|
||||
print fmt % args
|
||||
sys.stdout.flush()
|
||||
else:
|
||||
debug = lambda *args: None
|
||||
|
||||
def freeport(portlist, expr):
|
||||
"""
|
||||
Find a free server port to use. Specifically, evaluate 'expr' (a
|
||||
callable(port)) until it stops raising EADDRINUSE exception.
|
||||
|
||||
Pass:
|
||||
|
||||
portlist: an iterable (e.g. xrange()) of ports to try. If you exhaust the
|
||||
range, freeport() lets the socket.error exception propagate. If you want
|
||||
unbounded, you could pass itertools.count(baseport), though of course in
|
||||
practice the ceiling is 2^16-1 anyway. But it seems prudent to constrain
|
||||
the range much more sharply: if we're iterating an absurd number of times,
|
||||
probably something else is wrong.
|
||||
|
||||
expr: a callable accepting a port number, specifically one of the items
|
||||
from portlist. If calling that callable raises socket.error with
|
||||
EADDRINUSE, freeport() retrieves the next item from portlist and retries.
|
||||
|
||||
Returns: (expr(port), port)
|
||||
|
||||
port: the value from portlist for which expr(port) succeeded
|
||||
|
||||
Raises:
|
||||
|
||||
Any exception raised by expr(port) other than EADDRINUSE.
|
||||
|
||||
socket.error if, for every item from portlist, expr(port) raises
|
||||
socket.error. The exception you see is the one from the last item in
|
||||
portlist.
|
||||
|
||||
StopIteration if portlist is completely empty.
|
||||
|
||||
Example:
|
||||
|
||||
class Server(HTTPServer):
|
||||
# If you use BaseHTTPServer.HTTPServer, turning off this flag is
|
||||
# essential for proper operation of freeport()!
|
||||
allow_reuse_address = False
|
||||
# ...
|
||||
server, port = freeport(xrange(8000, 8010),
|
||||
lambda port: Server(("localhost", port),
|
||||
MyRequestHandler))
|
||||
# pass 'port' to client code
|
||||
# call server.serve_forever()
|
||||
"""
|
||||
try:
|
||||
# If portlist is completely empty, let StopIteration propagate: that's an
|
||||
# error because we can't return meaningful values. We have no 'port',
|
||||
# therefore no 'expr(port)'.
|
||||
portiter = iter(portlist)
|
||||
port = portiter.next()
|
||||
|
||||
while True:
|
||||
try:
|
||||
# If this value of port works, return as promised.
|
||||
value = expr(port)
|
||||
|
||||
except socket.error, err:
|
||||
# Anything other than 'Address already in use', propagate
|
||||
if err.args[0] != errno.EADDRINUSE:
|
||||
raise
|
||||
|
||||
# Here we want the next port from portiter. But on StopIteration,
|
||||
# we want to raise the original exception rather than
|
||||
# StopIteration. So save the original exc_info().
|
||||
type, value, tb = sys.exc_info()
|
||||
try:
|
||||
try:
|
||||
port = portiter.next()
|
||||
except StopIteration:
|
||||
raise type, value, tb
|
||||
finally:
|
||||
# Clean up local traceback, see docs for sys.exc_info()
|
||||
del tb
|
||||
|
||||
else:
|
||||
debug("freeport() returning %s on port %s", value, port)
|
||||
return value, port
|
||||
|
||||
# Recap of the control flow above:
|
||||
# If expr(port) doesn't raise, return as promised.
|
||||
# If expr(port) raises anything but EADDRINUSE, propagate that
|
||||
# exception.
|
||||
# If portiter.next() raises StopIteration -- that is, if the port
|
||||
# value we just passed to expr(port) was the last available -- reraise
|
||||
# the EADDRINUSE exception.
|
||||
# If we've actually arrived at this point, portiter.next() delivered a
|
||||
# new port value. Loop back to pass that to expr(port).
|
||||
|
||||
except Exception, err:
|
||||
debug("*** freeport() raising %s: %s", err.__class__.__name__, err)
|
||||
raise
|
||||
|
||||
def run(*args, **kwds):
|
||||
"""All positional arguments collectively form a command line, executed as
|
||||
a synchronous child process.
|
||||
In addition, pass server=new_thread_instance as an explicit keyword (to
|
||||
differentiate it from an additional command-line argument).
|
||||
new_thread_instance should be an instantiated but not yet started Thread
|
||||
subclass instance, e.g.:
|
||||
run("python", "-c", 'print "Hello, world!"', server=TestHTTPServer(name="httpd"))
|
||||
"""
|
||||
# If there's no server= keyword arg, don't start a server thread: simply
|
||||
# run a child process.
|
||||
try:
|
||||
thread = kwds.pop("server")
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
# Start server thread. Note that this and all other comm server
|
||||
# threads should be daemon threads: we'll let them run "forever,"
|
||||
# confident that the whole process will terminate when the main thread
|
||||
# terminates, which will be when the child process terminates.
|
||||
thread.setDaemon(True)
|
||||
thread.start()
|
||||
# choice of os.spawnv():
|
||||
# - [v vs. l] pass a list of args vs. individual arguments,
|
||||
# - [no p] don't use the PATH because we specifically want to invoke the
|
||||
# executable passed as our first arg,
|
||||
# - [no e] child should inherit this process's environment.
|
||||
debug("Running %s...", " ".join(args))
|
||||
if kwds.get("use_path", False):
|
||||
rc = os.spawnvp(os.P_WAIT, args[0], args)
|
||||
else:
|
||||
rc = os.spawnv(os.P_WAIT, args[0], args)
|
||||
debug("%s returned %s", args[0], rc)
|
||||
return rc
|
||||
|
||||
# ****************************************************************************
|
||||
# test code -- manual at this point, see SWAT-564
|
||||
# ****************************************************************************
|
||||
def test_freeport():
|
||||
# ------------------------------- Helpers --------------------------------
|
||||
from contextlib import contextmanager
|
||||
# helper Context Manager for expecting an exception
|
||||
# with exc(SomeError):
|
||||
# raise SomeError()
|
||||
# raises AssertionError otherwise.
|
||||
@contextmanager
|
||||
def exc(exception_class, *args):
|
||||
try:
|
||||
yield
|
||||
except exception_class, err:
|
||||
for i, expected_arg in enumerate(args):
|
||||
assert expected_arg == err.args[i], \
|
||||
"Raised %s, but args[%s] is %r instead of %r" % \
|
||||
(err.__class__.__name__, i, err.args[i], expected_arg)
|
||||
print "Caught expected exception %s(%s)" % \
|
||||
(err.__class__.__name__, ', '.join(repr(arg) for arg in err.args))
|
||||
else:
|
||||
assert False, "Failed to raise " + exception_class.__class__.__name__
|
||||
|
||||
# helper to raise specified exception
|
||||
def raiser(exception):
|
||||
raise exception
|
||||
|
||||
# the usual
|
||||
def assert_equals(a, b):
|
||||
assert a == b, "%r != %r" % (a, b)
|
||||
|
||||
# ------------------------ Sanity check the above ------------------------
|
||||
class SomeError(Exception): pass
|
||||
# Without extra args, accept any err.args value
|
||||
with exc(SomeError):
|
||||
raiser(SomeError("abc"))
|
||||
# With extra args, accept only the specified value
|
||||
with exc(SomeError, "abc"):
|
||||
raiser(SomeError("abc"))
|
||||
with exc(AssertionError):
|
||||
with exc(SomeError, "abc"):
|
||||
raiser(SomeError("def"))
|
||||
with exc(AssertionError):
|
||||
with exc(socket.error, errno.EADDRINUSE):
|
||||
raiser(socket.error(errno.ECONNREFUSED, 'Connection refused'))
|
||||
|
||||
# ----------- freeport() without engaging socket functionality -----------
|
||||
# If portlist is empty, freeport() raises StopIteration.
|
||||
with exc(StopIteration):
|
||||
freeport([], None)
|
||||
|
||||
assert_equals(freeport([17], str), ("17", 17))
|
||||
|
||||
# This is the magic exception that should prompt us to retry
|
||||
inuse = socket.error(errno.EADDRINUSE, 'Address already in use')
|
||||
# Get the iterator to our ports list so we can check later if we've used all
|
||||
ports = iter(xrange(5))
|
||||
with exc(socket.error, errno.EADDRINUSE):
|
||||
freeport(ports, lambda port: raiser(inuse))
|
||||
# did we entirely exhaust 'ports'?
|
||||
with exc(StopIteration):
|
||||
ports.next()
|
||||
|
||||
ports = iter(xrange(2))
|
||||
# Any exception but EADDRINUSE should quit immediately
|
||||
with exc(SomeError):
|
||||
freeport(ports, lambda port: raiser(SomeError()))
|
||||
assert_equals(ports.next(), 1)
|
||||
|
||||
# ----------- freeport() with platform-dependent socket stuff ------------
|
||||
# This is what we should've had unit tests to begin with (see CHOP-661).
|
||||
def newbind(port):
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sock.bind(('127.0.0.1', port))
|
||||
return sock
|
||||
|
||||
bound0, port0 = freeport(xrange(7777, 7780), newbind)
|
||||
assert_equals(port0, 7777)
|
||||
bound1, port1 = freeport(xrange(7777, 7780), newbind)
|
||||
assert_equals(port1, 7778)
|
||||
bound2, port2 = freeport(xrange(7777, 7780), newbind)
|
||||
assert_equals(port2, 7779)
|
||||
with exc(socket.error, errno.EADDRINUSE):
|
||||
bound3, port3 = freeport(xrange(7777, 7780), newbind)
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_freeport()
|
||||
|
|
@ -1244,10 +1244,11 @@ void LLImageRaw::fill( const LLColor4U& color )
|
|||
if( 4 == getComponents() )
|
||||
{
|
||||
U32* data = (U32*) getData();
|
||||
U32 mColor = color.asRGBA();
|
||||
|
||||
U32 rgbaColor = color.asRGBA();
|
||||
for( S32 i = 0; i < pixels; i++ )
|
||||
data[i] = mColor;
|
||||
{
|
||||
data[ i ] = rgbaColor;
|
||||
}
|
||||
}
|
||||
else
|
||||
if( 3 == getComponents() )
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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})
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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,21 +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!
|
||||
namespace kdu_core { // <FS:Ansariel> KDU >= 7.5 fix
|
||||
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 << "]";
|
||||
}
|
||||
} // <FS:Ansariel> KDU >= 7.5 fix
|
||||
|
||||
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();
|
||||
|
|
@ -105,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
|
||||
|
|
@ -148,11 +153,8 @@ std::string LLImageJ2CKDU::getEngineInfo() const
|
|||
class LLKDUDecodeState
|
||||
{
|
||||
public:
|
||||
// <FS:ND> KDU 7.3.2 upgrade
|
||||
// LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap);
|
||||
LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap, kdu_codestream &aStream );
|
||||
// </FS:ND>
|
||||
|
||||
LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap,
|
||||
kdu_codestream* codestreamp);
|
||||
~LLKDUDecodeState();
|
||||
bool processTileDecode(F32 decode_time, bool limit_time = true);
|
||||
|
||||
|
|
@ -354,9 +356,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) << "!")));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -577,12 +579,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;
|
||||
|
||||
// <FS:ND> KDU 7.3.2 upgrade
|
||||
// mDecodeState.reset(new LLKDUDecodeState(tile, buf, row_gap));
|
||||
mDecodeState.reset(new LLKDUDecodeState(tile, buf, row_gap, mCodeStreamp.get()));
|
||||
// </FS:ND>
|
||||
|
||||
mDecodeState.reset(new LLKDUDecodeState(tile, buf, row_gap,
|
||||
mCodeStreamp.get()));
|
||||
}
|
||||
// Do the actual processing
|
||||
F32 remaining_time = decode_time - decode_timer.getElapsedTimeF32();
|
||||
|
|
@ -1272,10 +1270,8 @@ all necessary level shifting, type conversion, rounding and truncation. */
|
|||
}
|
||||
}
|
||||
|
||||
// <FS:ND> KDU 7.3.2 upgrade
|
||||
// LLKDUDecodeState::LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap)
|
||||
LLKDUDecodeState::LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap, kdu_codestream &aStream )
|
||||
// </FS:ND>
|
||||
LLKDUDecodeState::LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap,
|
||||
kdu_codestream* codestreamp)
|
||||
{
|
||||
S32 c;
|
||||
|
||||
|
|
@ -1321,12 +1317,7 @@ LLKDUDecodeState::LLKDUDecodeState(kdu_tile tile, kdu_byte *buf, S32 row_gap, kd
|
|||
mEngines[c] = kdu_synthesis(res,&mAllocator,use_shorts);
|
||||
}
|
||||
}
|
||||
|
||||
// <FS:ND> KDU 7.3.2 upgrade
|
||||
// mAllocator.finalize(); // Actually creates buffering resources
|
||||
mAllocator.finalize( aStream ); // Actually creates buffering resources
|
||||
// </FS:ND>
|
||||
|
||||
mAllocator.finalize(*codestreamp); // Actually creates buffering resources
|
||||
for (c = 0; c < mNumComponents; c++)
|
||||
{
|
||||
mLines[c].create(); // Grabs resources from the allocator.
|
||||
|
|
@ -1384,7 +1375,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;
|
||||
|
||||
|
|
|
|||
|
|
@ -42,15 +42,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>
|
||||
|
|
@ -97,7 +90,6 @@ private:
|
|||
// private.
|
||||
// void findDiscardLevelsBoundaries(LLImageJ2C &base);
|
||||
|
||||
public:
|
||||
// Helper class to hold a kdu_codestream, which is a handle to the
|
||||
// underlying implementation object. When CodeStreamHolder is reset() or
|
||||
// destroyed, it calls kdu_codestream::destroy() -- which kdu_codestream
|
||||
|
|
@ -123,19 +115,19 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
kdu_codestream* operator->() { return &mCodeStream; }
|
||||
kdu_codestream& get() { 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;
|
||||
};
|
||||
|
||||
private:
|
||||
// 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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -27,54 +27,24 @@
|
|||
#ifndef LL_LLKDUMEM_H
|
||||
#define LL_LLKDUMEM_H
|
||||
|
||||
// <FS:ND> Disable warning 4263/4264
|
||||
// warning C4263: 'bool jpx_input_box::open_as(jpx_fragment_list,jp2_data_references,jp2_family_src *,kdu_uint32)' : member function does not override any base class virtual member function
|
||||
// warning C4264: 'bool jp2_input_box::open_as(kdu_uint32,jp2_family_src *,jp2_locator,jp2_locator,kdu_long)' : no override available for virtual member function from base 'jp2_input_box'; function is hidden
|
||||
#ifdef LL_WINDOWS
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4263)
|
||||
#pragma warning(disable:4264)
|
||||
#endif
|
||||
// </FS:ND>
|
||||
|
||||
// Support classes for reading and writing from memory buffers in KDU
|
||||
#define KDU_NO_THREADS
|
||||
// <FS:ND> Some magic to make KDU and the viewer agree with internal alignments
|
||||
#define KDU_X86_INTRINSICS
|
||||
// </FS:ND>
|
||||
// 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"
|
||||
|
||||
// <FS:ND> KDU >= 7.5.0 uses namespaces for nicer encapsulation. To avoid cluttering this all over LLs source we're going with this.
|
||||
#if KDU_MAJOR_VERSION >= 7 && KDU_MINOR_VERSION >= 5
|
||||
using namespace kdu_core;
|
||||
using namespace kd_supp_image_local;
|
||||
#endif
|
||||
// </FS:ND>
|
||||
|
||||
// <FS:ND> Disable warning 4263/4264
|
||||
#ifdef LL_WINDOWS
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
// </FS:ND>
|
||||
|
||||
class LLKDUMemSource: public kdu_compressed_source
|
||||
class LLKDUMemSource: public kdu_core::kdu_compressed_source
|
||||
{
|
||||
public:
|
||||
LLKDUMemSource(U8 *input_buffer, U32 size)
|
||||
|
|
@ -88,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;
|
||||
|
|
@ -113,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)
|
||||
|
|
@ -128,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;
|
||||
|
|
@ -152,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,
|
||||
|
|
@ -160,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;
|
||||
|
|
@ -172,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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ inline F64 llabs(const F64 a)
|
|||
|
||||
inline S32 lltrunc( F32 f )
|
||||
{
|
||||
#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && !defined(ND_BUILD64BIT_ARCH)
|
||||
#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 ) && !defined(ND_BUILD64BIT_ARCH)
|
||||
#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
|
||||
|
|
|
|||
|
|
@ -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 && !ND_BUILD64BIT_ARCH ) )
|
||||
#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
|
||||
|
||||
|
|
|
|||
|
|
@ -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<>
|
||||
|
|
|
|||
|
|
@ -118,34 +118,3 @@ BOOL LLColor4U::parseColor4U(const std::string& buf, LLColor4U* value)
|
|||
value->set( U8(v[0]), U8(v[1]), U8(v[2]), U8(v[3]) );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
U32 LLColor4U::asRGBA() const
|
||||
{
|
||||
U32 nRet(0);
|
||||
|
||||
// Little endian: values are swapped in memory. The original code access the array like a U32, so we need to swap here
|
||||
|
||||
nRet |= mV[3];
|
||||
nRet <<= 8;
|
||||
nRet |= mV[2];
|
||||
nRet <<= 8;
|
||||
nRet |= mV[1];
|
||||
nRet <<= 8;
|
||||
nRet |= mV[0];
|
||||
|
||||
return nRet;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,15 +46,8 @@ static const U32 LENGTHOFCOLOR4U = 4;
|
|||
class LLColor4U
|
||||
{
|
||||
public:
|
||||
//64bit compile fix - Do not put pointers into the LLColor4U union. FS:ND
|
||||
// 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)
|
||||
|
|
@ -83,9 +76,6 @@ public:
|
|||
return ret;
|
||||
}
|
||||
|
||||
U32 asRGBA() const;
|
||||
void fromRGBA( U32 aVal );
|
||||
|
||||
const LLColor4U& setToBlack(); // zero LLColor4U to (0, 0, 0, 1)
|
||||
const LLColor4U& setToWhite(); // zero LLColor4U to (0, 0, 0, 1)
|
||||
|
||||
|
|
@ -130,15 +120,14 @@ public:
|
|||
static BOOL parseColor4U(const std::string& buf, LLColor4U* value);
|
||||
|
||||
// conversion
|
||||
#ifdef LL_DARWIN
|
||||
operator /*const*/ LLColor4() const
|
||||
#else
|
||||
operator const LLColor4() const
|
||||
#endif
|
||||
{
|
||||
return LLColor4(*this);
|
||||
}
|
||||
|
||||
U32 asRGBA() const;
|
||||
void fromRGBA( U32 aVal );
|
||||
|
||||
static LLColor4U white;
|
||||
static LLColor4U black;
|
||||
static LLColor4U red;
|
||||
|
|
@ -572,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
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ $/LicenseInfo$
|
|||
|
||||
import os
|
||||
import sys
|
||||
from threading import Thread
|
||||
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
|
||||
|
||||
from llbase.fastest_elementtree import parse as xml_parse
|
||||
|
|
@ -155,17 +154,23 @@ class Server(HTTPServer):
|
|||
allow_reuse_address = False
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Instantiate a Server(TestHTTPRequestHandler) on the first free port
|
||||
# in the specified port range. Doing this inline is better than in a
|
||||
# daemon thread: if it blows up here, we'll get a traceback. If it blew up
|
||||
# in some other thread, the traceback would get eaten and we'd run the
|
||||
# subject test program anyway.
|
||||
httpd, port = freeport(xrange(8000, 8020),
|
||||
lambda port: Server(('127.0.0.1', port), TestHTTPRequestHandler))
|
||||
# function to make a server with specified port
|
||||
make_server = lambda port: Server(('127.0.0.1', port), TestHTTPRequestHandler)
|
||||
|
||||
if not sys.platform.startswith("win"):
|
||||
# Instantiate a Server(TestHTTPRequestHandler) on a port chosen by the
|
||||
# runtime.
|
||||
httpd = make_server(0)
|
||||
else:
|
||||
# "Then there's Windows"
|
||||
# Instantiate a Server(TestHTTPRequestHandler) on the first free port
|
||||
# in the specified port range.
|
||||
httpd, port = freeport(xrange(8000, 8020), make_server)
|
||||
|
||||
# Pass the selected port number to the subject test program via the
|
||||
# environment. We don't want to impose requirements on the test program's
|
||||
# command-line parsing -- and anyway, for C++ integration tests, that's
|
||||
# performed in TUT code rather than our own.
|
||||
os.environ["PORT"] = str(port)
|
||||
debug("$PORT = %s", port)
|
||||
sys.exit(run(server=Thread(name="httpd", target=httpd.serve_forever), *sys.argv[1:]))
|
||||
os.environ["PORT"] = str(httpd.server_port)
|
||||
debug("$PORT = %s", httpd.server_port)
|
||||
sys.exit(run(server_inst=httpd, *sys.argv[1:]))
|
||||
|
|
|
|||
|
|
@ -27,13 +27,12 @@ Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
|||
$/LicenseInfo$
|
||||
"""
|
||||
|
||||
from __future__ import with_statement
|
||||
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
import errno
|
||||
import socket
|
||||
import subprocess
|
||||
|
||||
VERBOSE = os.environ.get("INTEGRATION_TEST_VERBOSE", "0") # default to quiet
|
||||
# Support usage such as INTEGRATION_TEST_VERBOSE=off -- distressing to user if
|
||||
|
|
@ -47,6 +46,9 @@ if VERBOSE:
|
|||
else:
|
||||
debug = lambda *args: None
|
||||
|
||||
class Error(Exception):
|
||||
pass
|
||||
|
||||
def freeport(portlist, expr):
|
||||
"""
|
||||
Find a free server port to use. Specifically, evaluate 'expr' (a
|
||||
|
|
@ -141,34 +143,73 @@ def freeport(portlist, expr):
|
|||
raise
|
||||
|
||||
def run(*args, **kwds):
|
||||
"""All positional arguments collectively form a command line, executed as
|
||||
a synchronous child process.
|
||||
In addition, pass server=new_thread_instance as an explicit keyword (to
|
||||
differentiate it from an additional command-line argument).
|
||||
new_thread_instance should be an instantiated but not yet started Thread
|
||||
subclass instance, e.g.:
|
||||
run("python", "-c", 'print "Hello, world!"', server=TestHTTPServer(name="httpd"))
|
||||
"""
|
||||
# If there's no server= keyword arg, don't start a server thread: simply
|
||||
# run a child process.
|
||||
Run a specified command as a synchronous child process, optionally
|
||||
launching a server Thread during the run.
|
||||
|
||||
All positional arguments collectively form a command line. The first
|
||||
positional argument names the program file to execute.
|
||||
|
||||
Returns the termination code of the child process.
|
||||
|
||||
In addition, you may pass keyword-only arguments:
|
||||
|
||||
use_path=True: allow a simple filename as command and search PATH for that
|
||||
filename. (This argument is retained for backwards compatibility but is
|
||||
now the default behavior.)
|
||||
|
||||
server_inst: an instance of a subclass of SocketServer.BaseServer.
|
||||
|
||||
When you pass server_inst, run() calls its handle_request() method in a
|
||||
loop until the child process terminates.
|
||||
"""
|
||||
# server= keyword arg is discontinued
|
||||
try:
|
||||
thread = kwds.pop("server")
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
# Start server thread. Note that this and all other comm server
|
||||
# threads should be daemon threads: we'll let them run "forever,"
|
||||
# confident that the whole process will terminate when the main thread
|
||||
# terminates, which will be when the child process terminates.
|
||||
thread.setDaemon(True)
|
||||
thread.start()
|
||||
# choice of os.spawnv():
|
||||
# - [v vs. l] pass a list of args vs. individual arguments,
|
||||
# - [no p] don't use the PATH because we specifically want to invoke the
|
||||
# executable passed as our first arg,
|
||||
# - [no e] child should inherit this process's environment.
|
||||
raise Error("Obsolete call to testrunner.run(): pass server_inst=, not server=")
|
||||
|
||||
debug("Running %s...", " ".join(args))
|
||||
rc = os.spawnv(os.P_WAIT, args[0], args)
|
||||
|
||||
try:
|
||||
server_inst = kwds.pop("server_inst")
|
||||
except KeyError:
|
||||
# Without server_inst, this is very simple: just run child process.
|
||||
rc = subprocess.call(args)
|
||||
else:
|
||||
# We're being asked to run a local server while the child process
|
||||
# runs. We used to launch a daemon thread calling
|
||||
# server_inst.serve_forever(), then eventually call sys.exit() with
|
||||
# the daemon thread still running -- but in recent versions of Python
|
||||
# 2, even when you call sys.exit(0), apparently killing the thread
|
||||
# causes the Python runtime to force the process termination code
|
||||
# nonzero. So now we avoid the extra thread altogether.
|
||||
|
||||
# SocketServer.BaseServer.handle_request() honors a 'timeout'
|
||||
# attribute, if it's set to something other than None.
|
||||
# We pick 0.5 seconds because that's the default poll timeout for
|
||||
# BaseServer.serve_forever(), which is what we used to use.
|
||||
server_inst.timeout = 0.5
|
||||
|
||||
child = subprocess.Popen(args)
|
||||
while child.poll() is None:
|
||||
# Setting server_inst.timeout is what keeps this handle_request()
|
||||
# call from blocking "forever." Interestingly, looping over
|
||||
# handle_request() with a timeout is very like the implementation
|
||||
# of serve_forever(). We just check a different flag to break out.
|
||||
# It might be interesting if handle_request() returned an
|
||||
# indication of whether it in fact handled a request or timed out.
|
||||
# Oddly, it doesn't. We could discover that by overriding
|
||||
# handle_timeout(), whose default implementation does nothing --
|
||||
# but in fact we really don't care. All that matters is that we
|
||||
# regularly poll both the child process and the server socket.
|
||||
server_inst.handle_request()
|
||||
# We don't bother to capture the rc returned by child.poll() because
|
||||
# poll() is already defined to capture that in its returncode attr.
|
||||
rc = child.returncode
|
||||
|
||||
debug("%s returned %s", args[0], rc)
|
||||
return rc
|
||||
|
||||
|
|
|
|||
|
|
@ -56,15 +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)
|
||||
if( NOT ND_BUILD64BIT_ARCH )
|
||||
add_definitions(/FIXED:NO)
|
||||
endif( NOT ND_BUILD64BIT_ARCH )
|
||||
##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})
|
||||
|
||||
|
|
|
|||
|
|
@ -2060,11 +2060,7 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, S32 vert_count)
|
|||
}
|
||||
}
|
||||
|
||||
// Often happens with LLFontGL::render(), especially in LLScrollListText::draw()
|
||||
// Can be observed by opening the V1 style friends list for example
|
||||
if (mCount == 0)
|
||||
LL_DEBUGS() << "Vertex count was 0, prevented crashing." << LL_ENDL;
|
||||
else
|
||||
if( mCount > 0 ) // ND: Guard against crashes if mCount is zero, yes it can happen
|
||||
mVerticesp[mCount] = mVerticesp[mCount-1];
|
||||
}
|
||||
|
||||
|
|
@ -2188,15 +2184,11 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLCol
|
|||
}
|
||||
}
|
||||
|
||||
// Often happens with LLFontGL::render(), especially in LLScrollListText::draw()
|
||||
// Can be observed by opening the V1 style friends list for example
|
||||
if (mCount == 0)
|
||||
LL_DEBUGS() << "Vertex count was 0, prevented crashing." << LL_ENDL;
|
||||
else
|
||||
if (mCount > 0)
|
||||
{
|
||||
mVerticesp[mCount] = mVerticesp[mCount-1];
|
||||
mTexcoordsp[mCount] = mTexcoordsp[mCount-1];
|
||||
mColorsp[mCount] = mColorsp[mCount-1];
|
||||
mVerticesp[mCount] = mVerticesp[mCount - 1];
|
||||
mTexcoordsp[mCount] = mTexcoordsp[mCount - 1];
|
||||
mColorsp[mCount] = mColorsp[mCount - 1];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
|
|||
else
|
||||
{
|
||||
|
||||
static const GLenum array[] =
|
||||
GLenum array[] =
|
||||
{
|
||||
GL_VERTEX_ARRAY,
|
||||
GL_NORMAL_ARRAY,
|
||||
|
|
@ -456,7 +456,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
|
|||
GL_COLOR_ARRAY,
|
||||
};
|
||||
|
||||
static const GLenum mask[] =
|
||||
GLenum mask[] =
|
||||
{
|
||||
MAP_VERTEX,
|
||||
MAP_NORMAL,
|
||||
|
|
@ -1447,13 +1447,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*) (ptrdiff_t)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*) (ptrdiff_t)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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
size_t 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
|
||||
|
|
|
|||
|
|
@ -113,8 +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);
|
||||
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( mAppWindowHandle, GWLP_USERDATA );
|
||||
if (NULL != window_imp)
|
||||
{
|
||||
LLCoordGL gl_coord( 0, 0 );
|
||||
|
|
@ -169,8 +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);
|
||||
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( mAppWindowHandle, GWLP_USERDATA );
|
||||
if (NULL != window_imp)
|
||||
{
|
||||
LLCoordGL gl_coord( 0, 0 );
|
||||
|
|
@ -217,8 +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);
|
||||
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( mAppWindowHandle, GWLP_USERDATA );
|
||||
if (NULL != window_imp)
|
||||
{
|
||||
LLCoordGL gl_coord( 0, 0 );
|
||||
|
|
@ -235,7 +232,6 @@ 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 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1568,7 +1568,6 @@ 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
|
||||
|
|
@ -1897,8 +1896,8 @@ 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);
|
||||
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( h_wnd, GWLP_USERDATA );
|
||||
|
||||
|
||||
if (NULL != window_imp)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,18 +8,14 @@ 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)
|
||||
|
||||
if (WINDOWS OR LINUX)
|
||||
add_subdirectory(gstreamer10)
|
||||
endif (WINDOWS OR LINUX)
|
||||
|
|
|
|||
|
|
@ -28,11 +28,13 @@ include_directories(SYSTEM
|
|||
|
||||
### media_plugin_base
|
||||
|
||||
if(NOT WORD_SIZE EQUAL 32)
|
||||
if( NOT WINDOWS)
|
||||
if(NOT ADDRESS_SIZE EQUAL 32)
|
||||
if(WINDOWS)
|
||||
##add_definitions(/FIXED:NO)
|
||||
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
|
||||
add_definitions(-fPIC)
|
||||
endif(NOT WINDOWS)
|
||||
endif(NOT WORD_SIZE EQUAL 32)
|
||||
endif(WINDOWS)
|
||||
endif(NOT ADDRESS_SIZE EQUAL 32)
|
||||
|
||||
set(media_plugin_base_SOURCE_FILES
|
||||
media_plugin_base.cpp
|
||||
|
|
|
|||
|
|
@ -39,11 +39,13 @@ include_directories(SYSTEM
|
|||
|
||||
### media_plugin_cef
|
||||
|
||||
if(NOT WORD_SIZE EQUAL 32)
|
||||
if( NOT WINDOWS) # not windows therefore gcc LINUX and DARWIN
|
||||
if(NOT ADDRESS_SIZE EQUAL 32)
|
||||
if(WINDOWS)
|
||||
##add_definitions(/FIXED:NO)
|
||||
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
|
||||
add_definitions(-fPIC)
|
||||
endif(NOT WINDOWS)
|
||||
endif(NOT WORD_SIZE EQUAL 32)
|
||||
endif(WINDOWS)
|
||||
endif(NOT ADDRESS_SIZE EQUAL 32)
|
||||
|
||||
set(media_plugin_cef_SOURCE_FILES
|
||||
media_plugin_cef.cpp
|
||||
|
|
@ -108,8 +110,8 @@ if (WINDOWS)
|
|||
set_target_properties(
|
||||
media_plugin_cef
|
||||
PROPERTIES
|
||||
LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /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)
|
||||
|
||||
|
|
|
|||
|
|
@ -508,7 +508,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;
|
||||
|
|
@ -525,6 +528,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");
|
||||
|
|
|
|||
|
|
@ -42,44 +42,15 @@ private:
|
|||
VolumeCatcherImpl();
|
||||
~VolumeCatcherImpl();
|
||||
|
||||
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()
|
||||
|
|
@ -90,26 +61,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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -33,11 +33,13 @@ include_directories(SYSTEM
|
|||
|
||||
### media_plugin_libvlc
|
||||
|
||||
if(NOT WORD_SIZE EQUAL 32)
|
||||
if(NOT WINDOWS)
|
||||
if(NOT ADDRESS_SIZE EQUAL 32)
|
||||
if(WINDOWS)
|
||||
##add_definitions(/FIXED:NO)
|
||||
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
|
||||
add_definitions(-fPIC)
|
||||
endif(NOT WINDOWS)
|
||||
endif(NOT WORD_SIZE EQUAL 32)
|
||||
endif(WINDOWS)
|
||||
endif(NOT ADDRESS_SIZE EQUAL 32)
|
||||
|
||||
set(media_plugin_libvlc_SOURCE_FILES
|
||||
media_plugin_libvlc.cpp
|
||||
|
|
@ -56,11 +58,21 @@ target_link_libraries(media_plugin_libvlc
|
|||
${PLUGIN_API_WINDOWS_LIBRARIES}
|
||||
)
|
||||
|
||||
#add_dependencies(media_plugin_libvlc
|
||||
# ${LLPLUGIN_LIBRARIES}
|
||||
# ${MEDIA_PLUGIN_BASE_LIBRARIES}
|
||||
# ${LLCOMMON_LIBRARIES}
|
||||
#)
|
||||
add_dependencies(media_plugin_libvlc
|
||||
${LLPLUGIN_LIBRARIES}
|
||||
${MEDIA_PLUGIN_BASE_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)
|
||||
set_target_properties(
|
||||
|
|
|
|||
|
|
@ -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 "-stdlib=libc++ -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
|
|
@ -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
|
|
@ -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_PTR dwCallBack, DWORD dwFlags, HDRVR hdrvr, DWORD msg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR 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;
|
||||
|
|
@ -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
|
||||
|
|
@ -1,226 +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);
|
||||
}
|
||||
else if( DLL_PROCESS_DETACH == ul_reason_for_call )
|
||||
::DeleteCriticalSection( &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);
|
||||
|
||||
// <FS:ND/> For x64 we leave out the MMX loop as it needs to be rewritten with SSE2 (_m128) instead of _m64. Needs a check if winshim is even used for x64 before invessting more time.
|
||||
#ifndef _M_AMD64
|
||||
// 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();
|
||||
#else
|
||||
short *sample_64 = (short*)pwh->lpData;
|
||||
#endif
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,6 @@ include(DragDrop)
|
|||
include(EXPAT)
|
||||
include(FMODEX)
|
||||
include(GLOD)
|
||||
include(GooglePerfTools)
|
||||
include(Hunspell)
|
||||
include(JsonCpp)
|
||||
include(LLAppearance)
|
||||
|
|
@ -1753,7 +1752,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}/firestorm_icon.ico"
|
||||
|
|
@ -2056,7 +2055,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"
|
||||
)
|
||||
|
|
@ -2078,20 +2077,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
|
||||
|
|
@ -2169,7 +2156,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
|
||||
|
|
@ -2233,7 +2220,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}
|
||||
|
|
@ -2344,7 +2331,6 @@ target_link_libraries(${VIEWER_BINARY_NAME}
|
|||
${LLLOGIN_LIBRARIES}
|
||||
${LLPHYSICS_LIBRARIES}
|
||||
${LLPHYSICSEXTENSIONS_LIBRARIES}
|
||||
${TCMALLOC_LIBRARIES}
|
||||
${LLAPPEARANCE_LIBRARIES}
|
||||
${GROWL_LIBRARY}
|
||||
)
|
||||
|
|
@ -2397,7 +2383,7 @@ endif (NOT ENABLE_MEDIA_PLUGINS)
|
|||
--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
|
||||
|
|
@ -2424,7 +2410,7 @@ endif (NOT ENABLE_MEDIA_PLUGINS)
|
|||
--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
|
||||
|
|
@ -2487,7 +2473,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
|
||||
|
|
@ -2520,11 +2506,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
|
||||
|
|
@ -2542,9 +2527,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}/firestorm-symbols-windows.tar.bz2")
|
||||
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/firestorm-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}")
|
||||
|
|
@ -2558,14 +2544,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}/firestorm-symbols-darwin.tar.bz2")
|
||||
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/firestorm-symbols-darwin-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2")
|
||||
## set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger")
|
||||
set(VIEWER_EXE_GLOBS "'Firestorm' 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}/firestorm-symbols-linux.tar.bz2")
|
||||
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/firestorm-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-firestorm-bin SLPlugin")
|
||||
set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*")
|
||||
|
|
|
|||
|
|
@ -3592,7 +3592,7 @@
|
|||
<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>
|
||||
|
|
@ -8648,19 +8648,6 @@
|
|||
<key>Backup</key>
|
||||
<integer>0</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>
|
||||
<key>Backup</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>MenuAccessKeyTime</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -3859,6 +3859,7 @@ LLSD LLAppViewer::getViewerInfo() const
|
|||
info["BUILD_DATE"] = __DATE__;
|
||||
info["BUILD_TIME"] = __TIME__;
|
||||
info["CHANNEL"] = LLVersionInfo::getChannel();
|
||||
info["ADDRESS_SIZE"] = ADDRESS_SIZE;
|
||||
//std::string build_config = LLVersionInfo::getBuildConfig();
|
||||
//if (build_config != "Release")
|
||||
//{
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ bool LLAppViewerMacOSX::restoreErrorTrap()
|
|||
unsigned int reset_count = 0;
|
||||
|
||||
#define SET_SIG(S) sigaction(SIGABRT, &act, &old_act); \
|
||||
if((uintptr_t)act.sa_sigaction != (uintptr_t) old_act.sa_sigaction) \
|
||||
if(act.sa_sigaction != old_act.sa_sigaction) \
|
||||
++reset_count;
|
||||
// Synchronous signals
|
||||
SET_SIG(SIGABRT)
|
||||
|
|
|
|||
|
|
@ -41,6 +41,22 @@
|
|||
// [/RLVa:KB]
|
||||
#include "kcwlinterface.h"
|
||||
#include "quickprefs.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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,6 +51,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:
|
||||
|
|
|
|||
|
|
@ -2201,8 +2201,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(); //64bit compile fix FS:ND
|
||||
vec[0] = vec[1] = vec[2] = vec[3] = color.asRGBA();
|
||||
|
||||
src.loadua((F32*) vec);
|
||||
|
||||
|
|
@ -2238,8 +2237,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
|
|||
|
||||
LLColor4U glow4u = LLColor4U(0,0,0,glow);
|
||||
|
||||
//U32 glow32 = glow4u.mAll;
|
||||
U32 glow32 = glow4u.asRGBA(); //64bit compile fix FS:ND
|
||||
U32 glow32 = glow4u.asRGBA();
|
||||
|
||||
U32 vec[4];
|
||||
vec[0] = vec[1] = vec[2] = vec[3] = glow32;
|
||||
|
|
|
|||
|
|
@ -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,34 +100,32 @@ void LLFloaterBeacons::onClickUICheck(LLUICtrl *ctrl)
|
|||
else if(name == "moapbeacon") LLPipeline::setRenderMOAPBeacons(check->get());
|
||||
else if(name == "highlights")
|
||||
{
|
||||
LLPipeline::toggleRenderHighlights(NULL);
|
||||
// FS:LO Allow beacons to be turned off fully by unchecking both boxes
|
||||
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) )
|
||||
if (
|
||||
!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
|
||||
getChild<LLCheckBoxCtrl>("highlights")->setValue(FALSE);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
else if(name == "beacons")
|
||||
{
|
||||
LLPipeline::toggleRenderBeacons(NULL);
|
||||
// FS:LO Allow beacons to be turned off fully by unchecking both boxes
|
||||
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) )
|
||||
if (
|
||||
!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
|
||||
getChild<LLCheckBoxCtrl>("beacons")->setValue(FALSE);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,7 +234,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);
|
||||
|
|
|
|||
|
|
@ -292,7 +292,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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ BOOL LLFloaterMap::handleDoubleClick(S32 x, S32 y, MASK mask)
|
|||
LLVector3d pos_global = mMap->viewPosToGlobal(x, y);
|
||||
|
||||
// <FS:Ansariel> Synchronize double click handling throughout instances
|
||||
//LLTracker::stopTracking(NULL);
|
||||
//LLTracker::stopTracking(false);
|
||||
//LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance();
|
||||
//if (world_map)
|
||||
//{
|
||||
|
|
|
|||
|
|
@ -762,7 +762,7 @@ void LLFloaterWorldMap::trackAvatar( const LLUUID& avatar_id, const std::string&
|
|||
}
|
||||
else
|
||||
{
|
||||
LLTracker::stopTracking(NULL);
|
||||
LLTracker::stopTracking(false);
|
||||
}
|
||||
setDefaultBtn("Teleport");
|
||||
}
|
||||
|
|
@ -807,7 +807,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id )
|
|||
}
|
||||
else
|
||||
{
|
||||
LLTracker::stopTracking(NULL);
|
||||
LLTracker::stopTracking(false);
|
||||
}
|
||||
setDefaultBtn("Teleport");
|
||||
}
|
||||
|
|
@ -835,7 +835,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);
|
||||
|
|
@ -851,7 +851,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("");
|
||||
|
|
@ -1155,7 +1155,7 @@ void LLFloaterWorldMap::friendsChanged()
|
|||
(buddy_info && !buddy_info->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)) ||
|
||||
gAgent.isGodlike())
|
||||
{
|
||||
LLTracker::stopTracking(NULL);
|
||||
LLTracker::stopTracking(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1377,7 +1377,7 @@ void LLFloaterWorldMap::onLandmarkComboPrearrange( )
|
|||
|
||||
if( current_choice.isNull() || !list->setCurrentByID( current_choice ) )
|
||||
{
|
||||
LLTracker::stopTracking(NULL);
|
||||
LLTracker::stopTracking(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1387,7 +1387,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( )
|
||||
|
|
@ -1410,7 +1410,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);
|
||||
|
|
@ -1465,7 +1465,7 @@ void LLFloaterWorldMap::onAvatarComboPrearrange( )
|
|||
|
||||
if( !list->setCurrentByID( current_choice ) || current_choice.isNull() )
|
||||
{
|
||||
LLTracker::stopTracking(NULL);
|
||||
LLTracker::stopTracking(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1578,7 +1578,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
|
||||
|
|
|
|||
|
|
@ -1111,11 +1111,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)
|
||||
{
|
||||
// <FS:ND> FIRE-11832; using U32 truncates results for npos from 0xFFFFFFFF'FFFFFFFF to 0x00000000'FFFFFFFF
|
||||
// U32 divider_pos = stuff.find(NAME_TEXT_DIVIDER);
|
||||
std::string::size_type divider_pos = stuff.find(NAME_TEXT_DIVIDER);
|
||||
// </FS:ND>
|
||||
|
||||
if (divider_pos != std::string::npos && divider_pos < (stuff.length() - NAME_TEXT_DIVIDER.length()))
|
||||
{
|
||||
im[LL_IM_FROM] = stuff.substr(0, divider_pos);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
# ifdef SHOW_ASSERT
|
||||
# ifdef SHOW_ASSERT // same condition that controls llassert()
|
||||
const LLSD& face_data = *faceIter; // conditional to avoid unused variable warning
|
||||
# endif
|
||||
llassert(face_data.isMap());
|
||||
|
|
|
|||
|
|
@ -1871,7 +1871,7 @@ void LLNetMap::handleStopTracking (const LLSD& userdata)
|
|||
//mPopupMenu->setItemEnabled ("Stop Tracking", false);
|
||||
mPopupMenu->setItemVisible ("Stop Tracking", false);
|
||||
// </FS:Ansariel>
|
||||
LLTracker::stopTracking ((void*)(ptrdiff_t)LLTracker::isTracking(NULL));
|
||||
LLTracker::stopTracking (LLTracker::isTracking(NULL));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ namespace {
|
|||
U32 render_type = render_type_from_string( iter->asString() );
|
||||
if ( render_type != 0 )
|
||||
{
|
||||
LLPipeline::toggleRenderTypeControl( (void*)(intptr_t)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*)(intptr_t)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*)(intptr_t)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*)(intptr_t)info_display );
|
||||
LLPipeline::toggleRenderDebug( info_display );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,19 +123,19 @@ bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LL
|
|||
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);
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue