From 706249cf44b2309ab08d488a16b85a14a4faf6bb Mon Sep 17 00:00:00 2001
From: Drake Arconis <drake@alchemyviewer.org>
Date: Wed, 10 Dec 2014 12:45:32 -0500
Subject: [PATCH] This is so rude :(!!!!!!!

---
 indra/llcharacter/llkeyframemotion.cpp        |  2 +-
 indra/llimage/llimage.cpp                     | 16 ++---
 indra/llmath/llmath.h                         | 42 ++++++------
 indra/llmath/llquantize.h                     |  4 +-
 indra/llmath/llvolume.cpp                     |  2 +-
 indra/llmath/tests/llquaternion_test.cpp      |  4 +-
 indra/llmath/tests/mathmisc_test.cpp          | 24 +++----
 indra/llmath/tests/v4coloru_test.cpp          |  8 +--
 indra/llmath/v4coloru.h                       | 30 ++++-----
 indra/llmessage/llregionhandle.h              |  4 +-
 indra/llmessage/llthrottle.cpp                |  2 +-
 indra/llmessage/message.cpp                   |  2 +-
 indra/llprimitive/llmaterial.cpp              | 20 +++---
 indra/llprimitive/llprimitive.cpp             | 16 ++---
 indra/llprimitive/llvolumemessage.cpp         | 64 +++++++++----------
 indra/llrender/llfontfreetype.cpp             |  4 +-
 indra/llrender/llfontgl.cpp                   | 32 +++++-----
 indra/llrender/llrender2dutils.cpp            | 16 ++---
 indra/llrender/lluiimage.cpp                  |  4 +-
 indra/llui/llaccordionctrl.cpp                |  2 +-
 indra/llui/llbadge.cpp                        |  8 +--
 indra/llui/llbutton.cpp                       |  8 +--
 indra/llui/llfloater.cpp                      | 30 ++++-----
 indra/llui/llfocusmgr.h                       |  2 +-
 indra/llui/llfolderview.cpp                   |  8 +--
 indra/llui/llfolderviewitem.cpp               | 16 ++---
 indra/llui/lllayoutstack.cpp                  | 22 +++----
 indra/llui/lllineeditor.cpp                   | 20 +++---
 indra/llui/llmenugl.cpp                       |  6 +-
 indra/llui/llmodaldialog.cpp                  |  2 +-
 indra/llui/llprogressbar.cpp                  |  2 +-
 indra/llui/llscrollcontainer.cpp              |  2 +-
 indra/llui/llscrolllistctrl.cpp               |  4 +-
 indra/llui/llspinctrl.cpp                     |  2 +-
 indra/llui/llstatbar.cpp                      |  2 +-
 indra/llui/llstatgraph.cpp                    |  2 +-
 indra/llui/lltextbase.cpp                     |  6 +-
 indra/llui/lltexteditor.cpp                   |  2 +-
 indra/llui/lltimectrl.cpp                     |  2 +-
 indra/llui/llui.cpp                           | 16 ++---
 indra/llui/llurlentry.cpp                     |  6 +-
 indra/llwindow/llwindowmacosx.cpp             | 36 +++++------
 indra/newview/lldrawable.cpp                  |  2 +-
 indra/newview/lldrawpoolbump.cpp              |  4 +-
 indra/newview/llfasttimerview.cpp             | 12 ++--
 indra/newview/llflexibleobject.cpp            |  2 +-
 indra/newview/llfloaterbuyland.cpp            |  4 +-
 indra/newview/llfloaterland.cpp               |  8 +--
 indra/newview/llfloaterlandholdings.cpp       |  4 +-
 indra/newview/llfloatermap.cpp                |  4 +-
 .../llfloaterpathfindingcharacters.cpp        |  2 +-
 indra/newview/llfloaterpreference.cpp         |  4 +-
 indra/newview/llfloatersnapshot.cpp           |  4 +-
 indra/newview/llfloaterworldmap.cpp           |  6 +-
 indra/newview/llglsandbox.cpp                 |  8 +--
 indra/newview/llhudnametag.cpp                |  2 +-
 indra/newview/lllandmarkactions.cpp           | 10 +--
 indra/newview/llmanip.cpp                     |  4 +-
 indra/newview/llmaniprotate.cpp               | 10 +--
 indra/newview/llmanipscale.cpp                | 14 ++--
 indra/newview/llmaniptranslate.cpp            |  8 +--
 indra/newview/llmediactrl.cpp                 | 18 +++---
 indra/newview/llnetmap.cpp                    | 28 ++++----
 indra/newview/llpanelclassified.cpp           |  6 +-
 indra/newview/llpanelgrouplandmoney.cpp       |  4 +-
 indra/newview/llpanellandmarkinfo.cpp         |  6 +-
 indra/newview/llpanelobject.cpp               | 18 +++---
 indra/newview/llpanelpick.cpp                 |  6 +-
 indra/newview/llpanelplaceinfo.cpp            | 12 ++--
 indra/newview/llpanelplaceprofile.cpp         |  2 +-
 indra/newview/llpanelprimmediacontrols.cpp    |  8 +--
 indra/newview/llslurl.cpp                     | 24 +++----
 indra/newview/llsnapshotlivepreview.cpp       | 16 ++---
 indra/newview/llsurface.cpp                   | 12 ++--
 indra/newview/lltoolselectland.cpp            |  4 +-
 indra/newview/llviewerdisplay.cpp             |  8 +--
 indra/newview/llviewerkeyboard.cpp            |  6 +-
 indra/newview/llviewermedia.cpp               |  6 +-
 indra/newview/llviewerparcelmgr.cpp           | 18 +++---
 indra/newview/llviewerpartsim.cpp             |  2 +-
 indra/newview/llviewerpartsource.cpp          |  2 +-
 indra/newview/llviewertextureanim.cpp         |  2 +-
 indra/newview/llviewerwindow.cpp              | 52 +++++++--------
 indra/newview/llvlcomposition.cpp             | 12 ++--
 indra/newview/llvoavatar.cpp                  |  2 +-
 indra/newview/llvoicevivox.cpp                |  2 +-
 indra/newview/llvopartgroup.cpp               |  2 +-
 indra/newview/llvovolume.cpp                  |  8 +--
 indra/newview/llwlanimator.cpp                |  2 +-
 indra/newview/llworld.cpp                     |  4 +-
 indra/newview/llworldmapview.cpp              | 44 ++++++-------
 91 files changed, 475 insertions(+), 475 deletions(-)

diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index f4e0214589..c025762486 100755
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -1048,7 +1048,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
 
 	LLVector3 source_to_target = target_pos - keyframe_source_pos;
 	
-	S32 max_iteration_count = llmath::llround(clamp_rescale(
+	S32 max_iteration_count = ll_round(clamp_rescale(
 										  mCharacter->getPixelArea(),
 										  MAX_PIXEL_AREA_CONSTRAINTS,
 										  MIN_PIXEL_AREA_CONSTRAINTS,
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index f0918a7bff..98a80f0916 100755
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -1012,13 +1012,13 @@ void LLImageRaw::copyLineScaled( U8* in, U8* out, S32 in_pixel_len, S32 out_pixe
 			a *= norm_factor;  // skip conditional
 
 			S32 t4 = x * out_pixel_step * components;
-			out[t4 + 0] = U8(llmath::llround(r));
+			out[t4 + 0] = U8(ll_round(r));
 			if (components >= 2)
-				out[t4 + 1] = U8(llmath::llround(g));
+				out[t4 + 1] = U8(ll_round(g));
 			if (components >= 3)
-				out[t4 + 2] = U8(llmath::llround(b));
+				out[t4 + 2] = U8(ll_round(b));
 			if( components == 4)
-				out[t4 + 3] = U8(llmath::llround(a));
+				out[t4 + 3] = U8(ll_round(a));
 		}
 	}
 }
@@ -1093,10 +1093,10 @@ void LLImageRaw::compositeRowScaled4onto3( U8* in, U8* out, S32 in_pixel_len, S3
 			b *= norm_factor;
 			a *= norm_factor;
 
-			in_scaled_r = U8(llmath::llround(r));
-			in_scaled_g = U8(llmath::llround(g));
-			in_scaled_b = U8(llmath::llround(b));
-			in_scaled_a = U8(llmath::llround(a));
+			in_scaled_r = U8(ll_round(r));
+			in_scaled_g = U8(ll_round(g));
+			in_scaled_b = U8(ll_round(b));
+			in_scaled_a = U8(ll_round(a));
 		}
 
 		if( in_scaled_a )
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index de55600b4e..9137328f40 100755
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -27,6 +27,8 @@
 #ifndef LLMATH_H
 #define LLMATH_H
 
+#include "llpreprocessor.h"
+
 #include <cmath>
 #include <cstdlib>
 #include <vector>
@@ -39,6 +41,7 @@
 // llcommon depend on llmath.
 #include "is_approx_equal_fraction.h"
 
+
 // work around for Windows & older gcc non-standard function names.
 #if LL_WINDOWS
 #include <float.h>
@@ -211,35 +214,32 @@ inline S32 llceil( F32 f )
 	return (S32)ceil(f);
 }
 
-namespace llmath
+// Use this round.  Does an arithmetic round (0.5 always rounds up)
+inline S32 ll_round(const F32 val)
 {
-	// Use this round.  Does an arithmetic round (0.5 always rounds up)
-	inline S32 llround(const F32 val)
-	{
 #ifdef LL_CPP11
-		return (S32)round(val);
+	return (S32)round(val);
 #else
-		return llfloor(val + 0.5f);
+	return llfloor(val + 0.5f);
 #endif
-	}
+}
 
-	inline F32 llround(F32 val, F32 nearest)
-	{
+inline F32 ll_round(F32 val, F32 nearest)
+{
 #ifdef LL_CPP11
-		return F32(round(val * (1.0f / nearest))) * nearest;
+	return F32(round(val * (1.0f / nearest))) * nearest;
 #else
-		return F32(floor(val * (1.0f / nearest) + 0.5f)) * nearest;
+	return F32(floor(val * (1.0f / nearest) + 0.5f)) * nearest;
 #endif
-	}
+}
 
-	inline F64 llround(F64 val, F64 nearest)
-	{
+inline F64 ll_round(F64 val, F64 nearest)
+{
 #ifdef LL_CPP11
-		return F64(round(val * (1.0 / nearest))) * nearest;
+	return F64(round(val * (1.0 / nearest))) * nearest;
 #else
-		return F64(floor(val * (1.0 / nearest) + 0.5)) * nearest;
+	return F64(floor(val * (1.0 / nearest) + 0.5)) * nearest;
 #endif
-	}
 }
 
 // these provide minimum peak error
@@ -287,7 +287,7 @@ const S32 LL_SHIFT_AMOUNT			= 16;                    //16.16 fixed point represe
 	#define LL_MAN_INDEX				1
 #endif
 
-/* Deprecated: use llround(), lltrunc(), or llfloor() instead
+/* Deprecated: use ll_round(), lltrunc(), or llfloor() instead
 // ================================================================================================
 // Real2Int
 // ================================================================================================
@@ -329,7 +329,7 @@ static union
 #define LL_EXP_A (1048576 * OO_LN2) // use 1512775 for integer
 #define LL_EXP_C (60801)			// this value of C good for -4 < y < 4
 
-#define LL_FAST_EXP(y) (LLECO.n.i = llmath::llround(F32(LL_EXP_A*(y))) + (1072693248 - LL_EXP_C), LLECO.d)
+#define LL_FAST_EXP(y) (LLECO.n.i = ll_round(F32(LL_EXP_A*(y))) + (1072693248 - LL_EXP_C), LLECO.d)
 
 
 
@@ -348,8 +348,8 @@ inline F32 snap_to_sig_figs(F32 foo, S32 sig_figs)
 		bar *= 10.f;
 	}
 
-	//F32 new_foo = (F32)llround(foo * bar);
-	// the llround() implementation sucks.  Don't us it.
+	//F32 new_foo = (F32)ll_round(foo * bar);
+	// the ll_round() implementation sucks.  Don't us it.
 
 	F32 sign = (foo > 0.f) ? 1.f : -1.f;
 	F32 new_foo = F32( S64(foo * bar + sign * 0.5f));
diff --git a/indra/llmath/llquantize.h b/indra/llmath/llquantize.h
index b04bbcdbd5..10c950abbb 100755
--- a/indra/llmath/llquantize.h
+++ b/indra/llmath/llquantize.h
@@ -52,7 +52,7 @@ inline U16 F32_to_U16_ROUND(F32 val, F32 lower, F32 upper)
 	val /= (upper - lower);
 
 	// round the value.   Sreturn the U16
-	return (U16)(llmath::llround(val*U16MAX));
+	return (U16)(ll_round(val*U16MAX));
 }
 
 
@@ -92,7 +92,7 @@ inline U8 F32_to_U8_ROUND(F32 val, F32 lower, F32 upper)
 	val /= (upper - lower);
 
 	// return the rounded U8
-	return (U8)(llmath::llround(val*U8MAX));
+	return (U8)(ll_round(val*U8MAX));
 }
 
 
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index b5283f4208..1f5732f8e9 100755
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -560,7 +560,7 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3
 
 	// Scale to have size "match" scale.  Compensates to get object to generally fill bounding box.
 
-	S32 total_sides = llmath::llround(sides / ang_scale);	// Total number of sides all around
+	S32 total_sides = ll_round(sides / ang_scale);	// Total number of sides all around
 
 	if (total_sides < 8)
 	{
diff --git a/indra/llmath/tests/llquaternion_test.cpp b/indra/llmath/tests/llquaternion_test.cpp
index 97c120cfdd..1214d7efcf 100755
--- a/indra/llmath/tests/llquaternion_test.cpp
+++ b/indra/llmath/tests/llquaternion_test.cpp
@@ -175,10 +175,10 @@ namespace tut
 	void llquat_test_object_t::test<6>()
 	{
 		LLQuaternion quat1(3.0f, 2.0f, 6.0f, 0.0f), quat2(1.0f, 1.0f, 1.0f, 1.0f);
-		ensure("1. The two values are different", llmath::llround(12.000000f, 2) == llmath::llround(dot(quat1, quat2), 2));
+		ensure("1. The two values are different", llmath::ll_round(12.000000f, 2) == llmath::ll_round(dot(quat1, quat2), 2));
 
 		LLQuaternion quat0(3.0f, 9.334f, 34.5f, 23.0f), quat(34.5f, 23.23f, 2.0f, 45.5f);
-		ensure("2. The two values are different", llmath::llround(1435.828807f, 2) == llmath::llround(dot(quat0, quat), 2));
+		ensure("2. The two values are different", llmath::ll_round(1435.828807f, 2) == llmath::ll_round(dot(quat0, quat), 2));
 	}
 
 	//test case for LLQuaternion &LLQuaternion::constrain(F32 radians) fn.
diff --git a/indra/llmath/tests/mathmisc_test.cpp b/indra/llmath/tests/mathmisc_test.cpp
index 7e99af7408..f12140cf8f 100755
--- a/indra/llmath/tests/mathmisc_test.cpp
+++ b/indra/llmath/tests/mathmisc_test.cpp
@@ -128,33 +128,33 @@ namespace tut
 	void math_object::test<8>()
 	{
 		F32 val = 430903.2f;
-		S32 val1 = llmath::llround(val);
-		ensure("float llround value 1", (430903 == val1));
+		S32 val1 = ll_round(val);
+		ensure("float ll_round value 1", (430903 == val1));
 		val = -430903.9f;
-		val1 = llmath::llround(val);
-		ensure("float llround value 2", (-430904 == val1));
+		val1 = ll_round(val);
+		ensure("float ll_round value 2", (-430904 == val1));
 	}
 
 	template<> template<>
 	void math_object::test<9>()
 	{
 		F32 val = 430905.2654f, nearest = 100.f;
-		val = llmath::llround(val, nearest);
-		ensure("float llround value 1", (430900 == val));
+		val = ll_round(val, nearest);
+		ensure("float ll_round value 1", (430900 == val));
 		val = -430905.2654f, nearest = 10.f;
-		val = llmath::llround(val, nearest);
-		ensure("float llround value 1", (-430910 == val));
+		val = ll_round(val, nearest);
+		ensure("float ll_round value 1", (-430910 == val));
 	}
 
 	template<> template<>
 	void math_object::test<10>()
 	{
 		F64 val = 430905.2654, nearest = 100.0;
-		val = llmath::llround(val, nearest);
-		ensure("double llround value 1", (430900 == val));
+		val = ll_round(val, nearest);
+		ensure("double ll_round value 1", (430900 == val));
 		val = -430905.2654, nearest = 10.0;
-		val = llmath::llround(val, nearest);
-		ensure("double llround value 1", (-430910.00000 == val));
+		val = ll_round(val, nearest);
+		ensure("double ll_round value 1", (-430910.00000 == val));
 	}
 
 	template<> template<>
diff --git a/indra/llmath/tests/v4coloru_test.cpp b/indra/llmath/tests/v4coloru_test.cpp
index 845f7fdc07..04b7680d42 100755
--- a/indra/llmath/tests/v4coloru_test.cpp
+++ b/indra/llmath/tests/v4coloru_test.cpp
@@ -300,8 +300,8 @@ namespace tut
 		LLColor4U llcolor4u(r,g,b,a),llcolor4u1;
 		const F32 fVal = 3.f;
 		llcolor4u1 = llcolor4u.multAll(fVal);
-		ensure("multAll:Fail to multiply ", (((U8)llround(r * fVal) == llcolor4u1.mV[VX]) && (U8)llround(g * fVal) == llcolor4u1.mV[VY]
-											&& ((U8)llround(b * fVal) == llcolor4u1.mV[VZ])&& ((U8)llround(a * fVal) == llcolor4u1.mV[VW])));		
+		ensure("multAll:Fail to multiply ", (((U8)ll_round(r * fVal) == llcolor4u1.mV[VX]) && (U8)ll_round(g * fVal) == llcolor4u1.mV[VY]
+											&& ((U8)ll_round(b * fVal) == llcolor4u1.mV[VZ])&& ((U8)ll_round(a * fVal) == llcolor4u1.mV[VW])));		
 	}
 
 	template<> template<>
@@ -329,8 +329,8 @@ namespace tut
 		llcolor4u.setVecScaleClamp(color3);
 		const S32 MAX_COLOR = 255;
 		F32 color_scale_factor = MAX_COLOR/r;
-		S32 r2 = llmath::llround(r * color_scale_factor);
-		S32 g2 = llmath::llround(g * color_scale_factor);
+		S32 r2 = llmath::ll_round(r * color_scale_factor);
+		S32 g2 = llmath::ll_round(g * color_scale_factor);
 		ensure("setVecScaleClamp():Fail to add the value ",  ((r2 == llcolor4u.mV[VX]) && (g2 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
 	}
 }
diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h
index 479cf84fdb..2f81f8a933 100755
--- a/indra/llmath/v4coloru.h
+++ b/indra/llmath/v4coloru.h
@@ -180,10 +180,10 @@ inline LLColor4U::LLColor4U(const U8 *vec)
 
 inline LLColor4U::LLColor4U(const LLColor4& vec)
 {
-	mV[VX] = llclampb(llmath::llround(vec.mV[VRED] * 255.f));
-	mV[VY] = llclampb(llmath::llround(vec.mV[VGREEN] * 255.f));
-	mV[VZ] = llclampb(llmath::llround(vec.mV[VBLUE] * 255.f));
-	mV[VW] = llclampb(llmath::llround(vec.mV[VALPHA] * 255.f));
+	mV[VX] = llclampb(ll_round(vec.mV[VRED] * 255.f));
+	mV[VY] = llclampb(ll_round(vec.mV[VGREEN] * 255.f));
+	mV[VZ] = llclampb(ll_round(vec.mV[VBLUE] * 255.f));
+	mV[VW] = llclampb(ll_round(vec.mV[VALPHA] * 255.f));
 }
 
 /*
@@ -362,10 +362,10 @@ inline LLColor4U LLColor4U::multAll(const F32 k)
 {
 	// Round to nearest
 	return LLColor4U(
-		(U8)llmath::llround(mV[VX] * k),
-		(U8)llmath::llround(mV[VY] * k),
-		(U8)llmath::llround(mV[VZ] * k),
-		(U8)llmath::llround(mV[VW] * k));
+		(U8)ll_round(mV[VX] * k),
+		(U8)ll_round(mV[VY] * k),
+		(U8)ll_round(mV[VZ] * k),
+		(U8)ll_round(mV[VW] * k));
 }
 /*
 inline LLColor4U operator*(const LLColor4U &a, U8 k)
@@ -480,7 +480,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color)
 		color_scale_factor /= max_color;
 	}
 	const S32 MAX_COLOR = 255;
-	S32 r = llmath::llround(color.mV[0] * color_scale_factor);
+	S32 r = ll_round(color.mV[0] * color_scale_factor);
 	if (r > MAX_COLOR)
 	{
 		r = MAX_COLOR;
@@ -491,7 +491,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color)
 	}
 	mV[0] = r;
 
-	S32 g = llmath::llround(color.mV[1] * color_scale_factor);
+	S32 g = ll_round(color.mV[1] * color_scale_factor);
 	if (g > MAX_COLOR)
 	{
 		g = MAX_COLOR;
@@ -502,7 +502,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color)
 	}
 	mV[1] = g;
 
-	S32 b = llmath::llround(color.mV[2] * color_scale_factor);
+	S32 b = ll_round(color.mV[2] * color_scale_factor);
 	if (b > MAX_COLOR)
 	{
 		b = MAX_COLOR;
@@ -514,7 +514,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color)
 	mV[2] = b;
 
 	// Alpha shouldn't be scaled, just clamped...
-	S32 a = llmath::llround(color.mV[3] * MAX_COLOR);
+	S32 a = ll_round(color.mV[3] * MAX_COLOR);
 	if (a > MAX_COLOR)
 	{
 		a = MAX_COLOR;
@@ -536,7 +536,7 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color)
 	}
 
 	const S32 MAX_COLOR = 255;
-	S32 r = llmath::llround(color.mV[0] * color_scale_factor);
+	S32 r = ll_round(color.mV[0] * color_scale_factor);
 	if (r > MAX_COLOR)
 	{
 		r = MAX_COLOR;
@@ -548,7 +548,7 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color)
 	}
 	mV[0] = r;
 
-	S32 g = llmath::llround(color.mV[1] * color_scale_factor);
+	S32 g = ll_round(color.mV[1] * color_scale_factor);
 	if (g > MAX_COLOR)
 	{
 		g = MAX_COLOR;
@@ -560,7 +560,7 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color)
 	}
 	mV[1] = g;
 
-	S32 b = llmath::llround(color.mV[2] * color_scale_factor);
+	S32 b = ll_round(color.mV[2] * color_scale_factor);
 	if (b > MAX_COLOR)
 	{
 		b = MAX_COLOR;
diff --git a/indra/llmessage/llregionhandle.h b/indra/llmessage/llregionhandle.h
index 94c68546dc..085757dcbc 100755
--- a/indra/llmessage/llregionhandle.h
+++ b/indra/llmessage/llregionhandle.h
@@ -73,7 +73,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl
 	}
 	else
 	{
-		x_int = (U32)llmath::llround(x_pos);
+		x_int = (U32)ll_round(x_pos);
 	}
 	if (y_pos < 0.f)
 	{
@@ -82,7 +82,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl
 	}
 	else
 	{
-		y_int = (U32)llmath::llround(y_pos);
+		y_int = (U32)ll_round(y_pos);
 	}
 	*region_handle = to_region_handle(x_int, y_int);
 	return TRUE;
diff --git a/indra/llmessage/llthrottle.cpp b/indra/llmessage/llthrottle.cpp
index bd9dbe14ec..7605da4d3f 100755
--- a/indra/llmessage/llthrottle.cpp
+++ b/indra/llmessage/llthrottle.cpp
@@ -391,7 +391,7 @@ BOOL LLThrottleGroup::dynamicAdjust()
 		}
 
 		mBitsSentThisPeriod[i] = 0;
-		total += llmath::llround(mBitsSentHistory[i]);
+		total += ll_round(mBitsSentHistory[i]);
 	}
 
 	// Look for busy channels
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index 55a3bd5df2..0c3c14969b 100755
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -2752,7 +2752,7 @@ void LLMessageSystem::dumpReceiveCounts()
 			if (mt->mReceiveCount > 0)
 			{
 				LL_INFOS("Messaging") << "Num: " << std::setw(3) << mt->mReceiveCount << " Bytes: " << std::setw(6) << mt->mReceiveBytes
-						<< " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << llmath::llround(100 * mt->mDecodeTimeThisFrame / mReceiveTime.value()) << "%" << LL_ENDL;
+						<< " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << ll_round(100 * mt->mDecodeTimeThisFrame / mReceiveTime.value()) << "%" << LL_ENDL;
 			}
 		}
 	}
diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp
index de2cd52960..57ceb3e11b 100644
--- a/indra/llprimitive/llmaterial.cpp
+++ b/indra/llprimitive/llmaterial.cpp
@@ -119,18 +119,18 @@ LLSD LLMaterial::asLLSD() const
 	LLSD material_data;
 
 	material_data[MATERIALS_CAP_NORMAL_MAP_FIELD] = mNormalID;
-	material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = llmath::llround(mNormalOffsetX * MATERIALS_MULTIPLIER);
-	material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = llmath::llround(mNormalOffsetY * MATERIALS_MULTIPLIER);
-	material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = llmath::llround(mNormalRepeatX * MATERIALS_MULTIPLIER);
-	material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = llmath::llround(mNormalRepeatY * MATERIALS_MULTIPLIER);
-	material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = llmath::llround(mNormalRotation * MATERIALS_MULTIPLIER);
+	material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = ll_round(mNormalOffsetX * MATERIALS_MULTIPLIER);
+	material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = ll_round(mNormalOffsetY * MATERIALS_MULTIPLIER);
+	material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = ll_round(mNormalRepeatX * MATERIALS_MULTIPLIER);
+	material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = ll_round(mNormalRepeatY * MATERIALS_MULTIPLIER);
+	material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = ll_round(mNormalRotation * MATERIALS_MULTIPLIER);
 
 	material_data[MATERIALS_CAP_SPECULAR_MAP_FIELD] = mSpecularID;
-	material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = llmath::llround(mSpecularOffsetX * MATERIALS_MULTIPLIER);
-	material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = llmath::llround(mSpecularOffsetY * MATERIALS_MULTIPLIER);
-	material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = llmath::llround(mSpecularRepeatX * MATERIALS_MULTIPLIER);
-	material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = llmath::llround(mSpecularRepeatY * MATERIALS_MULTIPLIER);
-	material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = llmath::llround(mSpecularRotation * MATERIALS_MULTIPLIER);
+	material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = ll_round(mSpecularOffsetX * MATERIALS_MULTIPLIER);
+	material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = ll_round(mSpecularOffsetY * MATERIALS_MULTIPLIER);
+	material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = ll_round(mSpecularRepeatX * MATERIALS_MULTIPLIER);
+	material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = ll_round(mSpecularRepeatY * MATERIALS_MULTIPLIER);
+	material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = ll_round(mSpecularRotation * MATERIALS_MULTIPLIER);
 
 	material_data[MATERIALS_CAP_SPECULAR_COLOR_FIELD]     = mSpecularLightColor.getValue();
 	material_data[MATERIALS_CAP_SPECULAR_EXP_FIELD]       = mSpecularLightExponent;
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index 07d0bab79a..18f7ce1379 100755
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -1148,12 +1148,12 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
 			const LLTextureEntry* te = getTE(face_index);
 			scale_s[face_index] = (F32) te->mScaleS;
 			scale_t[face_index] = (F32) te->mScaleT;
-			offset_s[face_index] = (S16) llmath::llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
-			offset_t[face_index] = (S16) llmath::llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
-			image_rot[face_index] = (S16) llmath::llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
+			offset_s[face_index] = (S16) ll_round((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
+			offset_t[face_index] = (S16) ll_round((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
+			image_rot[face_index] = (S16) ll_round(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
 			bump[face_index] = te->getBumpShinyFullbright();
 			media_flags[face_index] = te->getMediaTexGen();
-			glow[face_index] = (U8) llmath::llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
+			glow[face_index] = (U8) ll_round((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
 
 			// Directly sending material_ids is not safe!
 			memcpy(&material_data[face_index*16],getTE(face_index)->getMaterialID().get(),16);	/* Flawfinder: ignore */ 
@@ -1233,12 +1233,12 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const
 			const LLTextureEntry* te = getTE(face_index);
 			scale_s[face_index] = (F32) te->mScaleS;
 			scale_t[face_index] = (F32) te->mScaleT;
-			offset_s[face_index] = (S16) llmath::llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
-			offset_t[face_index] = (S16) llmath::llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
-			image_rot[face_index] = (S16) llmath::llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
+			offset_s[face_index] = (S16) ll_round((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
+			offset_t[face_index] = (S16) ll_round((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
+			image_rot[face_index] = (S16) ll_round(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
 			bump[face_index] = te->getBumpShinyFullbright();
 			media_flags[face_index] = te->getMediaTexGen();
-            glow[face_index] = (U8) llmath::llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
+            glow[face_index] = (U8) ll_round((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
 
 			// Directly sending material_ids is not safe!
 			memcpy(&material_data[face_index*16],getTE(face_index)->getMaterialID().get(),16);	/* Flawfinder: ignore */ 
diff --git a/indra/llprimitive/llvolumemessage.cpp b/indra/llprimitive/llvolumemessage.cpp
index 7ed2d5be62..8d47a7147f 100755
--- a/indra/llprimitive/llvolumemessage.cpp
+++ b/indra/llprimitive/llvolumemessage.cpp
@@ -52,13 +52,13 @@ bool LLVolumeMessage::packProfileParams(
 	tempU8 = params->getCurveType();
 	mesgsys->addU8Fast(_PREHASH_ProfileCurve, tempU8);
 
-	tempU16 = (U16) llmath::llround( params->getBegin() / CUT_QUANTA);
+	tempU16 = (U16) ll_round( params->getBegin() / CUT_QUANTA);
 	mesgsys->addU16Fast(_PREHASH_ProfileBegin, tempU16);
 
-	tempU16 = 50000 - (U16) llmath::llround(params->getEnd() / CUT_QUANTA);
+	tempU16 = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
 	mesgsys->addU16Fast(_PREHASH_ProfileEnd, tempU16);
 
-	tempU16 = (U16) llmath::llround(params->getHollow() / HOLLOW_QUANTA);
+	tempU16 = (U16) ll_round(params->getHollow() / HOLLOW_QUANTA);
 	mesgsys->addU16Fast(_PREHASH_ProfileHollow, tempU16);
 
 	return true;
@@ -80,13 +80,13 @@ bool LLVolumeMessage::packProfileParams(
 	tempU8 = params->getCurveType();
 	dp.packU8(tempU8, "Curve");
 
-	tempU16 = (U16) llmath::llround( params->getBegin() / CUT_QUANTA);
+	tempU16 = (U16) ll_round( params->getBegin() / CUT_QUANTA);
 	dp.packU16(tempU16, "Begin");
 
-	tempU16 = 50000 - (U16) llmath::llround(params->getEnd() / CUT_QUANTA);
+	tempU16 = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
 	dp.packU16(tempU16, "End");
 
-	tempU16 = (U16) llmath::llround(params->getHollow() / HOLLOW_QUANTA);
+	tempU16 = (U16) ll_round(params->getHollow() / HOLLOW_QUANTA);
 	dp.packU16(tempU16, "Hollow");
 	return true;
 }
@@ -217,46 +217,46 @@ bool LLVolumeMessage::packPathParams(
 	U8 curve = params->getCurveType();
 	mesgsys->addU8Fast(_PREHASH_PathCurve, curve);
 
-	U16 begin = (U16) llmath::llround(params->getBegin() / CUT_QUANTA);
+	U16 begin = (U16) ll_round(params->getBegin() / CUT_QUANTA);
 	mesgsys->addU16Fast(_PREHASH_PathBegin, begin);
 
-	U16 end = 50000 - (U16) llmath::llround(params->getEnd() / CUT_QUANTA);
+	U16 end = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
 	mesgsys->addU16Fast(_PREHASH_PathEnd, end);
 
 	// Avoid truncation problem with direct F32->U8 cast.
 	// (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50.
 
-	U8 pack_scale_x = 200 - (U8) llmath::llround(params->getScaleX() / SCALE_QUANTA);
+	U8 pack_scale_x = 200 - (U8) ll_round(params->getScaleX() / SCALE_QUANTA);
 	mesgsys->addU8Fast(_PREHASH_PathScaleX, pack_scale_x );
 
-	U8 pack_scale_y = 200 - (U8) llmath::llround(params->getScaleY() / SCALE_QUANTA);
+	U8 pack_scale_y = 200 - (U8) ll_round(params->getScaleY() / SCALE_QUANTA);
 	mesgsys->addU8Fast(_PREHASH_PathScaleY, pack_scale_y );
 
-	U8 pack_shear_x = (U8) llmath::llround(params->getShearX() / SHEAR_QUANTA);
+	U8 pack_shear_x = (U8) ll_round(params->getShearX() / SHEAR_QUANTA);
 	mesgsys->addU8Fast(_PREHASH_PathShearX, pack_shear_x );
 
-	U8 pack_shear_y = (U8) llmath::llround(params->getShearY() / SHEAR_QUANTA);
+	U8 pack_shear_y = (U8) ll_round(params->getShearY() / SHEAR_QUANTA);
 	mesgsys->addU8Fast(_PREHASH_PathShearY, pack_shear_y );
 
-	S8 twist = (S8) llmath::llround(params->getTwist() / SCALE_QUANTA);
+	S8 twist = (S8) ll_round(params->getTwist() / SCALE_QUANTA);
 	mesgsys->addS8Fast(_PREHASH_PathTwist, twist);
 
-	S8 twist_begin = (S8) llmath::llround(params->getTwistBegin() / SCALE_QUANTA);
+	S8 twist_begin = (S8) ll_round(params->getTwistBegin() / SCALE_QUANTA);
 	mesgsys->addS8Fast(_PREHASH_PathTwistBegin, twist_begin);
 
-	S8 radius_offset = (S8) llmath::llround(params->getRadiusOffset() / SCALE_QUANTA);
+	S8 radius_offset = (S8) ll_round(params->getRadiusOffset() / SCALE_QUANTA);
 	mesgsys->addS8Fast(_PREHASH_PathRadiusOffset, radius_offset);
 
-	S8 taper_x = (S8) llmath::llround(params->getTaperX() / TAPER_QUANTA);
+	S8 taper_x = (S8) ll_round(params->getTaperX() / TAPER_QUANTA);
 	mesgsys->addS8Fast(_PREHASH_PathTaperX, taper_x);
 
-	S8 taper_y = (S8) llmath::llround(params->getTaperY() / TAPER_QUANTA);
+	S8 taper_y = (S8) ll_round(params->getTaperY() / TAPER_QUANTA);
 	mesgsys->addS8Fast(_PREHASH_PathTaperY, taper_y);
 
-	U8 revolutions = (U8) llmath::llround( (params->getRevolutions() - 1.0f) / REV_QUANTA);
+	U8 revolutions = (U8) ll_round( (params->getRevolutions() - 1.0f) / REV_QUANTA);
 	mesgsys->addU8Fast(_PREHASH_PathRevolutions, revolutions);
 
-	S8 skew = (S8) llmath::llround(params->getSkew() / SCALE_QUANTA);
+	S8 skew = (S8) ll_round(params->getSkew() / SCALE_QUANTA);
 	mesgsys->addS8Fast(_PREHASH_PathSkew, skew);
 
 	return true;
@@ -274,46 +274,46 @@ bool LLVolumeMessage::packPathParams(
 	U8 curve = params->getCurveType();
 	dp.packU8(curve, "Curve");
 
-	U16 begin = (U16) llmath::llround(params->getBegin() / CUT_QUANTA);
+	U16 begin = (U16) ll_round(params->getBegin() / CUT_QUANTA);
 	dp.packU16(begin, "Begin");
 
-	U16 end = 50000 - (U16) llmath::llround(params->getEnd() / CUT_QUANTA);
+	U16 end = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
 	dp.packU16(end, "End");
 
 	// Avoid truncation problem with direct F32->U8 cast.
 	// (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50.
 
-	U8 pack_scale_x = 200 - (U8) llmath::llround(params->getScaleX() / SCALE_QUANTA);
+	U8 pack_scale_x = 200 - (U8) ll_round(params->getScaleX() / SCALE_QUANTA);
 	dp.packU8(pack_scale_x, "ScaleX");
 
-	U8 pack_scale_y = 200 - (U8) llmath::llround(params->getScaleY() / SCALE_QUANTA);
+	U8 pack_scale_y = 200 - (U8) ll_round(params->getScaleY() / SCALE_QUANTA);
 	dp.packU8(pack_scale_y, "ScaleY");
 
-	S8 pack_shear_x = (S8) llmath::llround(params->getShearX() / SHEAR_QUANTA);
+	S8 pack_shear_x = (S8) ll_round(params->getShearX() / SHEAR_QUANTA);
 	dp.packU8(*(U8 *)&pack_shear_x, "ShearX");
 
-	S8 pack_shear_y = (S8) llmath::llround(params->getShearY() / SHEAR_QUANTA);
+	S8 pack_shear_y = (S8) ll_round(params->getShearY() / SHEAR_QUANTA);
 	dp.packU8(*(U8 *)&pack_shear_y, "ShearY");
 
-	S8 twist = (S8) llmath::llround(params->getTwist() / SCALE_QUANTA);
+	S8 twist = (S8) ll_round(params->getTwist() / SCALE_QUANTA);
 	dp.packU8(*(U8 *)&twist, "Twist");
 	
-	S8 twist_begin = (S8) llmath::llround(params->getTwistBegin() / SCALE_QUANTA);
+	S8 twist_begin = (S8) ll_round(params->getTwistBegin() / SCALE_QUANTA);
 	dp.packU8(*(U8 *)&twist_begin, "TwistBegin");
 
-	S8 radius_offset = (S8) llmath::llround(params->getRadiusOffset() / SCALE_QUANTA);
+	S8 radius_offset = (S8) ll_round(params->getRadiusOffset() / SCALE_QUANTA);
 	dp.packU8(*(U8 *)&radius_offset, "RadiusOffset");
 
-	S8 taper_x = (S8) llmath::llround(params->getTaperX() / TAPER_QUANTA);
+	S8 taper_x = (S8) ll_round(params->getTaperX() / TAPER_QUANTA);
 	dp.packU8(*(U8 *)&taper_x, "TaperX");
 
-	S8 taper_y = (S8) llmath::llround(params->getTaperY() / TAPER_QUANTA);
+	S8 taper_y = (S8) ll_round(params->getTaperY() / TAPER_QUANTA);
 	dp.packU8(*(U8 *)&taper_y, "TaperY");
 
-	U8 revolutions = (U8) llmath::llround( (params->getRevolutions() - 1.0f) / REV_QUANTA);
+	U8 revolutions = (U8) ll_round( (params->getRevolutions() - 1.0f) / REV_QUANTA);
 	dp.packU8(*(U8 *)&revolutions, "Revolutions");
 
-	S8 skew = (S8) llmath::llround(params->getSkew() / SCALE_QUANTA);
+	S8 skew = (S8) ll_round(params->getSkew() / SCALE_QUANTA);
 	dp.packU8(*(U8 *)&skew, "Skew");
 
 	return true;
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index 2c75d78a9d..e887ae90ba 100755
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -180,8 +180,8 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
 	mDescender = -mFTFace->descender * pixels_per_unit;
 	mLineHeight = mFTFace->height * pixels_per_unit;
 
-	S32 max_char_width = llmath::llround(0.5f + (x_max - x_min));
-	S32 max_char_height = llmath::llround(0.5f + (y_max - y_min));
+	S32 max_char_width = ll_round(0.5f + (x_max - x_min));
+	S32 max_char_height = ll_round(0.5f + (y_max - y_min));
 
 	mFontBitmapCachep->init(components, max_char_width, max_char_height);
 	claimMem(mFontBitmapCachep);
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index fb504d329f..58d832fc33 100755
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -217,10 +217,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 	case LEFT:
 		break;
 	case RIGHT:
-	  	cur_x -= llmin(scaled_max_pixels, llmath::llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX));
+	  	cur_x -= llmin(scaled_max_pixels, ll_round(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX));
 		break;
 	case HCENTER:
-	    cur_x -= llmin(scaled_max_pixels, llmath::llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)) / 2;
+	    cur_x -= llmin(scaled_max_pixels, ll_round(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)) / 2;
 		break;
 	default:
 		break;
@@ -229,7 +229,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 	cur_render_y = cur_y;
 	cur_render_x = cur_x;
 
-	F32 start_x = (F32)llmath::llround(cur_x);
+	F32 start_x = (F32)ll_round(cur_x);
 
 	const LLFontBitmapCache* font_bitmap_cache = mFontFreetype->getFontBitmapCache();
 
@@ -243,12 +243,12 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 	if (use_ellipses)
 	{
 		// check for too long of a string
-		S32 string_width = llmath::llround(getWidthF32(wstr.c_str(), begin_offset, max_chars) * sScaleX);
+		S32 string_width = ll_round(getWidthF32(wstr.c_str(), begin_offset, max_chars) * sScaleX);
 		if (string_width > scaled_max_pixels)
 		{
 			// use four dots for ellipsis width to generate padding
 			const LLWString dots(utf8str_to_wstring(std::string("....")));
-			scaled_max_pixels = llmax(0, scaled_max_pixels - llmath::llround(getWidthF32(dots.c_str())));
+			scaled_max_pixels = llmax(0, scaled_max_pixels - ll_round(getWidthF32(dots.c_str())));
 			draw_ellipses = TRUE;
 		}
 	}
@@ -313,10 +313,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 				(fgi->mXBitmapOffset + fgi->mWidth) * inv_width,
 				(fgi->mYBitmapOffset - PAD_UVY) * inv_height);
 		// snap glyph origin to whole screen pixel
-		LLRectf screen_rect((F32)llmath::llround(cur_render_x + (F32)fgi->mXBearing),
-				    (F32)llmath::llround(cur_render_y + (F32)fgi->mYBearing),
-				    (F32)llmath::llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
-				    (F32)llmath::llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
+		LLRectf screen_rect((F32)ll_round(cur_render_x + (F32)fgi->mXBearing),
+				    (F32)ll_round(cur_render_y + (F32)fgi->mYBearing),
+				    (F32)ll_round(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
+				    (F32)ll_round(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
 		
 		if (glyph_count >= GLYPH_BATCH_SIZE)
 		{
@@ -347,8 +347,8 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
 		// Must do this to cur_x, not just to cur_render_x, otherwise you
 		// will squish sub-pixel kerned characters too close together.
 		// For example, "CCCCC" looks bad.
-		cur_x = (F32)llmath::llround(cur_x);
-		//cur_y = (F32)llmath::llround(cur_y);
+		cur_x = (F32)ll_round(cur_x);
+		//cur_y = (F32)ll_round(cur_y);
 
 		cur_render_x = cur_x;
 		cur_render_y = cur_y;
@@ -461,7 +461,7 @@ S32 LLFontGL::getWidth(const std::string& utf8text, S32 begin_offset, S32 max_ch
 S32 LLFontGL::getWidth(const llwchar* wchars, S32 begin_offset, S32 max_chars) const
 {
 	F32 width = getWidthF32(wchars, begin_offset, max_chars);
-	return llmath::llround(width);
+	return ll_round(width);
 }
 
 F32 LLFontGL::getWidthF32(const std::string& utf8text) const
@@ -523,7 +523,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars
 			cur_x += mFontFreetype->getXKerning(fgi, next_glyph);
 		}
 		// Round after kerning.
-		cur_x = (F32)llmath::llround(cur_x);
+		cur_x = (F32)ll_round(cur_x);
 	}
 
 	// add in extra pixels for last character's width past its xadvance
@@ -631,7 +631,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
 		}
 
 		// Round after kerning.
-		cur_x = (F32)llmath::llround(cur_x);
+		cur_x = (F32)ll_round(cur_x);
 	}
 
 	if( clip )
@@ -701,7 +701,7 @@ S32	LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_
 		}
 
 		// Round after kerning.
-		total_width = (F32)llmath::llround(total_width);
+		total_width = (F32)ll_round(total_width);
 	}
 
 	if (drawable_chars == 0)
@@ -784,7 +784,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t
 
 
 		// Round after kerning.
-		cur_x = (F32)llmath::llround(cur_x);
+		cur_x = (F32)ll_round(cur_x);
 	}
 
 	return llmin(max_chars, pos - begin_offset);
diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp
index e3859d3576..667f7b11f6 100644
--- a/indra/llrender/llrender2dutils.cpp
+++ b/indra/llrender/llrender2dutils.cpp
@@ -433,8 +433,8 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
 		F32 image_width = image->getWidth(0);
 		F32 image_height = image->getHeight(0);
 
-		S32 image_natural_width = llmath::llround(image_width * uv_width);
-		S32 image_natural_height = llmath::llround(image_height * uv_height);
+		S32 image_natural_width = ll_round(image_width * uv_width);
+		S32 image_natural_height = ll_round(image_height * uv_height);
 
 		LLRectf draw_center_rect(	uv_center_rect.mLeft * image_width,
 									uv_center_rect.mTop * image_height,
@@ -468,10 +468,10 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
 			draw_center_rect.setCenterAndSize(uv_center_rect.getCenterX() * width, uv_center_rect.getCenterY() * height, scaled_width, scaled_height);
 		}
 
-		draw_center_rect.mLeft   = llmath::llround(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * ui_scale.mV[VX]);
-		draw_center_rect.mTop    = llmath::llround(ui_translation.mV[VY] + (F32)draw_center_rect.mTop * ui_scale.mV[VY]);
-		draw_center_rect.mRight  = llmath::llround(ui_translation.mV[VX] + (F32)draw_center_rect.mRight * ui_scale.mV[VX]);
-		draw_center_rect.mBottom = llmath::llround(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * ui_scale.mV[VY]);
+		draw_center_rect.mLeft   = ll_round(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * ui_scale.mV[VX]);
+		draw_center_rect.mTop    = ll_round(ui_translation.mV[VY] + (F32)draw_center_rect.mTop * ui_scale.mV[VY]);
+		draw_center_rect.mRight  = ll_round(ui_translation.mV[VX] + (F32)draw_center_rect.mRight * ui_scale.mV[VX]);
+		draw_center_rect.mBottom = ll_round(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * ui_scale.mV[VY]);
 
 		LLRectf draw_outer_rect(ui_translation.mV[VX], 
 								ui_translation.mV[VY] + height * ui_scale.mV[VY], 
@@ -703,8 +703,8 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
 			ui_translation.mV[VY] += y;
 			ui_translation.scaleVec(ui_scale);
 			S32 index = 0;
-			S32 scaled_width = llmath::llround(width * ui_scale.mV[VX]);
-			S32 scaled_height = llmath::llround(height * ui_scale.mV[VY]);
+			S32 scaled_width = ll_round(width * ui_scale.mV[VX]);
+			S32 scaled_height = ll_round(height * ui_scale.mV[VY]);
 
 			uv[index] = LLVector2(uv_rect.mRight, uv_rect.mTop);
 			pos[index].set(ui_translation.mV[VX] + scaled_width, ui_translation.mV[VY] + scaled_height, 0.f);
diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp
index 6b9756fe46..5d8f92b2e6 100644
--- a/indra/llrender/lluiimage.cpp
+++ b/indra/llrender/lluiimage.cpp
@@ -149,13 +149,13 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c
 S32 LLUIImage::getWidth() const
 { 
 	// return clipped dimensions of actual image area
-	return llmath::llround((F32)mImage->getWidth(0) * mClipRegion.getWidth()); 
+	return ll_round((F32)mImage->getWidth(0) * mClipRegion.getWidth()); 
 }
 
 S32 LLUIImage::getHeight() const
 { 
 	// return clipped dimensions of actual image area
-	return llmath::llround((F32)mImage->getHeight(0) * mClipRegion.getHeight()); 
+	return ll_round((F32)mImage->getHeight(0) * mClipRegion.getHeight()); 
 }
 
 S32 LLUIImage::getTextureWidth() const
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp
index 4043c4cfee..b5c80a430a 100755
--- a/indra/llui/llaccordionctrl.cpp
+++ b/indra/llui/llaccordionctrl.cpp
@@ -613,7 +613,7 @@ BOOL LLAccordionCtrl::autoScroll		(S32 x, S32 y)
 
 		// autoscroll region should take up no more than one third of visible scroller area
 		S32 auto_scroll_region_height = llmin(rect_local.getHeight() / 3, 10);
-		S32 auto_scroll_speed = llmath::llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
+		S32 auto_scroll_speed = ll_round(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
 
 		LLRect bottom_scroll_rect = screen_local_extents;
 		bottom_scroll_rect.mTop = rect_local.mBottom + auto_scroll_region_height;
diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp
index 2c08de52cb..363195fd93 100755
--- a/indra/llui/llbadge.cpp
+++ b/indra/llui/llbadge.cpp
@@ -196,10 +196,10 @@ void renderBadgeBackground(F32 centerX, F32 centerY, F32 width, F32 height, cons
 	F32 x = LLFontGL::sCurOrigin.mX + centerX - width * 0.5f;
 	F32 y = LLFontGL::sCurOrigin.mY + centerY - height * 0.5f;
 	
-	LLRectf screen_rect(llmath::llround(x),
-						llmath::llround(y),
-						llmath::llround(x) + width,
-						llmath::llround(y) + height);
+	LLRectf screen_rect(ll_round(x),
+						ll_round(y),
+						ll_round(x) + width,
+						ll_round(y) + height);
 	
 	// LLVector3 vertices[4];
 	// vertices[0] = LLVector3(screen_rect.mRight, screen_rect.mTop,    1.0f);
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 2176011768..d54dae059a 100755
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -608,8 +608,8 @@ void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height)
 	overlay_height = mImageOverlay->getHeight();
 
 	F32 scale_factor = llmin((F32)getRect().getWidth() / (F32)overlay_width, (F32)getRect().getHeight() / (F32)overlay_height, 1.f);
-	overlay_width = llmath::llround((F32)overlay_width * scale_factor);
-	overlay_height = llmath::llround((F32)overlay_height * scale_factor);
+	overlay_width = ll_round((F32)overlay_width * scale_factor);
+	overlay_height = ll_round((F32)overlay_height * scale_factor);
 }
 
 
@@ -778,7 +778,7 @@ void LLButton::draw()
 	if (hasFocus())
 	{
 		F32 lerp_amt = gFocusMgr.getFocusFlashAmt();
-		drawBorder(imagep, gFocusMgr.getFocusColor() % alpha, llmath::llround(lerp(1.f, 3.f, lerp_amt)));
+		drawBorder(imagep, gFocusMgr.getFocusColor() % alpha, ll_round(lerp(1.f, 3.f, lerp_amt)));
 	}
 	
 	if (use_glow_effect)
@@ -1069,7 +1069,7 @@ void LLButton::resize(LLUIString label)
 		{
 			S32 overlay_width = mImageOverlay->getWidth();
 			F32 scale_factor = (getRect().getHeight() - (mImageOverlayBottomPad + mImageOverlayTopPad)) / (F32)mImageOverlay->getHeight();
-			overlay_width = llmath::llround((F32)overlay_width * scale_factor);
+			overlay_width = ll_round((F32)overlay_width * scale_factor);
 
 			switch(mImageOverlayAlignment)
 			{
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 36cd52c9aa..bf45ceb74b 100755
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1956,7 +1956,7 @@ void	LLFloater::drawShadow(LLPanel* panel)
 	}
 	gl_drop_shadow(left, top, right, bottom, 
 		shadow_color % getCurrentTransparency(),
-		llmath::llround(shadow_offset));
+		ll_round(shadow_offset));
 }
 
 void LLFloater::updateTransparency(LLView* view, ETypeTransparency transparency_type)
@@ -2084,16 +2084,16 @@ void LLFloater::updateTitleButtons()
 				btn_rect.setLeftTopAndSize(
 					LLPANEL_BORDER_WIDTH,
 					getRect().getHeight() - close_box_from_top - (floater_close_box_size + 1) * button_count,
-					llmath::llround((F32)floater_close_box_size * mButtonScale),
-					llmath::llround((F32)floater_close_box_size * mButtonScale));
+					ll_round((F32)floater_close_box_size * mButtonScale),
+					ll_round((F32)floater_close_box_size * mButtonScale));
 			}
 			else
 			{
 				btn_rect.setLeftTopAndSize(
 					getRect().getWidth() - LLPANEL_BORDER_WIDTH - (floater_close_box_size + 1) * button_count,
 					getRect().getHeight() - close_box_from_top,
-					llmath::llround((F32)floater_close_box_size * mButtonScale),
-					llmath::llround((F32)floater_close_box_size * mButtonScale));
+					ll_round((F32)floater_close_box_size * mButtonScale),
+					ll_round((F32)floater_close_box_size * mButtonScale));
 			}
 
 			// first time here, init 'buttons_rect'
@@ -2144,16 +2144,16 @@ void LLFloater::buildButtons(const Params& floater_params)
 			btn_rect.setLeftTopAndSize(
 				LLPANEL_BORDER_WIDTH,
 				getRect().getHeight() - close_box_from_top - (floater_close_box_size + 1) * (i + 1),
-				llmath::llround(floater_close_box_size * mButtonScale),
-				llmath::llround(floater_close_box_size * mButtonScale));
+				ll_round(floater_close_box_size * mButtonScale),
+				ll_round(floater_close_box_size * mButtonScale));
 		}
 		else
 		{
 			btn_rect.setLeftTopAndSize(
 				getRect().getWidth() - LLPANEL_BORDER_WIDTH - (floater_close_box_size + 1) * (i + 1),
 				getRect().getHeight() - close_box_from_top,
-				llmath::llround(floater_close_box_size * mButtonScale),
-				llmath::llround(floater_close_box_size * mButtonScale));
+				ll_round(floater_close_box_size * mButtonScale),
+				ll_round(floater_close_box_size * mButtonScale));
 		}
 
 		LLButton::Params p;
@@ -3471,28 +3471,28 @@ LLCoordCommon LL_COORD_FLOATER::convertToCommon() const
 	LLCoordCommon out;
 	if (self.mX < -0.5f)
 	{
-		out.mX = llmath::llround(rescale(self.mX, -1.f, -0.5f, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft));
+		out.mX = ll_round(rescale(self.mX, -1.f, -0.5f, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft));
 	}
 	else if (self.mX > 0.5f)
 	{
-		out.mX = llmath::llround(rescale(self.mX, 0.5f, 1.f, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS));
+		out.mX = ll_round(rescale(self.mX, 0.5f, 1.f, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS));
 	}
 	else
 	{
-		out.mX = llmath::llround(rescale(self.mX, -0.5f, 0.5f, snap_rect.mLeft, snap_rect.mRight - floater_width));
+		out.mX = ll_round(rescale(self.mX, -0.5f, 0.5f, snap_rect.mLeft, snap_rect.mRight - floater_width));
 	}
 
 	if (self.mY < -0.5f)
 	{
-		out.mY = llmath::llround(rescale(self.mY, -1.f, -0.5f, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom));
+		out.mY = ll_round(rescale(self.mY, -1.f, -0.5f, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom));
 	}
 	else if (self.mY > 0.5f)
 	{
-		out.mY = llmath::llround(rescale(self.mY, 0.5f, 1.f, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS));
+		out.mY = ll_round(rescale(self.mY, 0.5f, 1.f, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS));
 	}
 	else
 	{
-		out.mY = llmath::llround(rescale(self.mY, -0.5f, 0.5f, snap_rect.mBottom, snap_rect.mTop - floater_height));
+		out.mY = ll_round(rescale(self.mY, -0.5f, 0.5f, snap_rect.mBottom, snap_rect.mTop - floater_height));
 	}
 
 	// return center point instead of lower left
diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h
index 85534e5c09..afd2a8ce06 100755
--- a/indra/llui/llfocusmgr.h
+++ b/indra/llui/llfocusmgr.h
@@ -92,7 +92,7 @@ public:
 	void			setKeystrokesOnly(BOOL keystrokes_only) { mKeystrokesOnly = keystrokes_only; }
 
 	F32				getFocusFlashAmt() const;
-	S32				getFocusFlashWidth() const { return llmath::llround(lerp(1.f, 3.f, getFocusFlashAmt())); }
+	S32				getFocusFlashWidth() const { return ll_round(lerp(1.f, 3.f, getFocusFlashAmt())); }
 	LLColor4		getFocusColor() const;
 	void			triggerFocusFlash();
 	BOOL			getAppHasFocus() const { return mAppHasFocus; }
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index e699d6ca5c..5a1dd2afa5 100755
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -316,18 +316,18 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height )
 	LLFolderViewFolder::arrange(&mMinWidth, &target_height);
 
 	LLRect scroll_rect = (mScrollContainer ? mScrollContainer->getContentWindowRect() : LLRect());
-	reshape( llmax(scroll_rect.getWidth(), mMinWidth), llmath::llround(mCurHeight) );
+	reshape( llmax(scroll_rect.getWidth(), mMinWidth), ll_round(mCurHeight) );
 
 	LLRect new_scroll_rect = (mScrollContainer ? mScrollContainer->getContentWindowRect() : LLRect());
 	if (new_scroll_rect.getWidth() != scroll_rect.getWidth())
 	{
-		reshape( llmax(scroll_rect.getWidth(), mMinWidth), llmath::llround(mCurHeight) );
+		reshape( llmax(scroll_rect.getWidth(), mMinWidth), ll_round(mCurHeight) );
 	}
 
 	// move item renamer text field to item's new position
 	updateRenamerPosition();
 
-	return llmath::llround(mTargetHeight);
+	return ll_round(mTargetHeight);
 }
 
 static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View");
@@ -352,7 +352,7 @@ void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent)
 		scroll_rect = mScrollContainer->getContentWindowRect();
 	}
 	width  = llmax(mMinWidth, scroll_rect.getWidth());
-	height = llmax(llmath::llround(mCurHeight), scroll_rect.getHeight());
+	height = llmax(ll_round(mCurHeight), scroll_rect.getHeight());
 
 	// Restrict width within scroll container's width
 	if (mUseEllipses && mScrollContainer)
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index ae47a17746..5989622d08 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -862,7 +862,7 @@ void LLFolderViewItem::draw()
 
 	if (filter_string_length > 0)
 	{
-		S32 left = llmath::llround(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2;
+		S32 left = ll_round(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2;
 		S32 right = left + font->getWidth(combined_string, mViewModelItem->getFilterStringOffset(), filter_string_length) + 2;
 		S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD);
 		S32 top = getRect().getHeight() - TOP_PAD;
@@ -1046,7 +1046,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
 				{
 					S32 child_width = *width;
 					S32 child_height = 0;
-					S32 child_top = parent_item_height - llmath::llround(running_height);
+					S32 child_top = parent_item_height - ll_round(running_height);
 
 					target_height += folderp->arrange( &child_width, &child_height );
 
@@ -1065,7 +1065,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
 				{
 					S32 child_width = *width;
 					S32 child_height = 0;
-					S32 child_top = parent_item_height - llmath::llround(running_height);
+					S32 child_top = parent_item_height - ll_round(running_height);
 
 					target_height += itemp->arrange( &child_width, &child_height );
 					// don't change width, as this item is as wide as its parent folder by construction
@@ -1102,7 +1102,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
 			folders_t::iterator fit = iter++;
 			// number of pixels that bottom of folder label is from top of parent folder
 			if (getRect().getHeight() - (*fit)->getRect().mTop + (*fit)->getItemHeight() 
-				> llmath::llround(mCurHeight) + mMaxFolderItemOverlap)
+				> ll_round(mCurHeight) + mMaxFolderItemOverlap)
 			{
 				// hide if beyond current folder height
 				(*fit)->setVisible(FALSE);
@@ -1115,7 +1115,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
 			items_t::iterator iit = iter++;
 			// number of pixels that bottom of item label is from top of parent folder
 			if (getRect().getHeight() - (*iit)->getRect().mBottom
-				> llmath::llround(mCurHeight) + mMaxFolderItemOverlap)
+				> ll_round(mCurHeight) + mMaxFolderItemOverlap)
 			{
 				(*iit)->setVisible(FALSE);
 			}
@@ -1127,12 +1127,12 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
 	}
 
 	// don't change width as this item is already as wide as its parent folder
-	reshape(getRect().getWidth(),llmath::llround(mCurHeight));
+	reshape(getRect().getWidth(),ll_round(mCurHeight));
 
 	// pass current height value back to parent
-	*height = llmath::llround(mCurHeight);
+	*height = ll_round(mCurHeight);
 
-	return llmath::llround(mTargetHeight);
+	return ll_round(mTargetHeight);
 }
 
 BOOL LLFolderViewFolder::needsArrange()
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 3ca95b252b..69246a2f57 100755
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -103,7 +103,7 @@ F32 LLLayoutPanel::getVisibleAmount() const
 
 S32 LLLayoutPanel::getLayoutDim() const
 {
-	return llmath::llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
+	return ll_round((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
 					? getRect().getWidth()
 					: getRect().getHeight()));
 }
@@ -130,7 +130,7 @@ void LLLayoutPanel::setTargetDim(S32 value)
 S32 LLLayoutPanel::getVisibleDim() const
 {
 	F32 min_dim = getRelevantMinDim();
-	return llmath::llround(mVisibleAmt
+	return ll_round(mVisibleAmt
 					* (min_dim
 						+ (((F32)mTargetDim - min_dim) * (1.f - mCollapseAmt))));
 }
@@ -138,7 +138,7 @@ S32 LLLayoutPanel::getVisibleDim() const
 void LLLayoutPanel::setOrientation( LLView::EOrientation orientation )
 {
 	mOrientation = orientation;
-	S32 layout_dim = llmath::llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
+	S32 layout_dim = ll_round((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
 		? getRect().getWidth()
 		: getRect().getHeight()));
 
@@ -381,14 +381,14 @@ void LLLayoutStack::updateLayout()
 		{
 			panelp->mTargetDim = panelp->getRelevantMinDim();
 		}
-		space_to_distribute -= panelp->getVisibleDim() + llmath::llround((F32)mPanelSpacing * panelp->getVisibleAmount());
+		space_to_distribute -= panelp->getVisibleDim() + ll_round((F32)mPanelSpacing * panelp->getVisibleAmount());
 		total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor();
 	}
 
 	llassert(total_visible_fraction < 1.05f);
 
 	// don't need spacing after last panel
-	space_to_distribute += panelp ? llmath::llround((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
+	space_to_distribute += panelp ? ll_round((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
 
 	S32 remaining_space = space_to_distribute;
 	F32 fraction_distributed = 0.f;
@@ -399,7 +399,7 @@ void LLLayoutStack::updateLayout()
 			if (panelp->mAutoResize)
 			{
 				F32 fraction_to_distribute = (panelp->mFractionalSize * panelp->getAutoResizeFactor()) / (total_visible_fraction);
-				S32 delta = llmath::llround((F32)space_to_distribute * fraction_to_distribute);
+				S32 delta = ll_round((F32)space_to_distribute * fraction_to_distribute);
 				fraction_distributed += fraction_to_distribute;
 				panelp->mTargetDim += delta;
 				remaining_space -= delta;
@@ -431,23 +431,23 @@ void LLLayoutStack::updateLayout()
 		LLRect panel_rect;
 		if (mOrientation == HORIZONTAL)
 		{
-			panel_rect.setLeftTopAndSize(llmath::llround(cur_pos),
+			panel_rect.setLeftTopAndSize(ll_round(cur_pos),
 										getRect().getHeight(),
-										llmath::llround(panel_dim),
+										ll_round(panel_dim),
 										getRect().getHeight());
 		}
 		else
 		{
 			panel_rect.setLeftTopAndSize(0,
-										llmath::llround(cur_pos),
+										ll_round(cur_pos),
 										getRect().getWidth(),
-										llmath::llround(panel_dim));
+										ll_round(panel_dim));
 		}
 
 		LLRect resize_bar_rect(panel_rect);
 		F32 panel_spacing = (F32)mPanelSpacing * panelp->getVisibleAmount();
 		F32 panel_visible_dim = panelp->getVisibleDim();
-		S32 panel_spacing_round = (S32)(llmath::llround(panel_spacing));
+		S32 panel_spacing_round = (S32)(ll_round(panel_spacing));
 
 		if (mOrientation == HORIZONTAL)
 		{
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 9b41fd5df3..ec3520c487 100755
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -829,7 +829,7 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask)
 		// Scroll if mouse cursor outside of bounds
 		if (mScrollTimer.hasExpired())
 		{
-			S32 increment = llmath::llround(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME);
+			S32 increment = ll_round(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME);
 			mScrollTimer.reset();
 			mScrollTimer.setTimerExpirySec(AUTO_SCROLL_TIME);
 			if( (x < mTextLeftEdge) && (mScrollHPos > 0 ) )
@@ -1870,7 +1870,7 @@ void LLLineEditor::draw()
 				0,
 				LLFontGL::NO_SHADOW,
 				select_left - mScrollHPos,
-				mTextRightEdge - llmath::llround(rendered_pixels_right),
+				mTextRightEdge - ll_round(rendered_pixels_right),
 				&rendered_pixels_right);
 		}
 		
@@ -1880,8 +1880,8 @@ void LLLineEditor::draw()
 			color.setAlpha(alpha);
 			// selected middle
 			S32 width = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos + rendered_text, select_right - mScrollHPos - rendered_text);
-			width = llmin(width, mTextRightEdge - llmath::llround(rendered_pixels_right));
-			gl_rect_2d(llmath::llround(rendered_pixels_right), cursor_top, llmath::llround(rendered_pixels_right)+width, cursor_bottom, color);
+			width = llmin(width, mTextRightEdge - ll_round(rendered_pixels_right));
+			gl_rect_2d(ll_round(rendered_pixels_right), cursor_top, ll_round(rendered_pixels_right)+width, cursor_bottom, color);
 
 			LLColor4 tmp_color( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], alpha );
 			rendered_text += mGLFont->render( 
@@ -1892,7 +1892,7 @@ void LLLineEditor::draw()
 				0,
 				LLFontGL::NO_SHADOW,
 				select_right - mScrollHPos - rendered_text,
-				mTextRightEdge - llmath::llround(rendered_pixels_right),
+				mTextRightEdge - ll_round(rendered_pixels_right),
 				&rendered_pixels_right);
 		}
 
@@ -1907,7 +1907,7 @@ void LLLineEditor::draw()
 				0,
 				LLFontGL::NO_SHADOW,
 				S32_MAX,
-				mTextRightEdge - llmath::llround(rendered_pixels_right),
+				mTextRightEdge - ll_round(rendered_pixels_right),
 				&rendered_pixels_right);
 		}
 	}
@@ -1921,7 +1921,7 @@ void LLLineEditor::draw()
 			0,
 			LLFontGL::NO_SHADOW,
 			S32_MAX,
-			mTextRightEdge - llmath::llround(rendered_pixels_right),
+			mTextRightEdge - ll_round(rendered_pixels_right),
 			&rendered_pixels_right);
 	}
 #if 1 // for when we're ready for image art.
@@ -2081,7 +2081,7 @@ void LLLineEditor::draw()
 							0,
 							LLFontGL::NO_SHADOW,
 							S32_MAX,
-							mTextRightEdge - llmath::llround(rendered_pixels_right),
+							mTextRightEdge - ll_round(rendered_pixels_right),
 							&rendered_pixels_right, FALSE);
 		}
 
@@ -2106,7 +2106,7 @@ void LLLineEditor::draw()
 							0,
 							LLFontGL::NO_SHADOW,
 							S32_MAX,
-							mTextRightEdge - llmath::llround(rendered_pixels_right),
+							mTextRightEdge - ll_round(rendered_pixels_right),
 							&rendered_pixels_right, FALSE);
 		}
 		// Draw children (border)
@@ -2610,7 +2610,7 @@ void LLLineEditor::markAsPreedit(S32 position, S32 length)
 
 S32 LLLineEditor::getPreeditFontSize() const
 {
-	return llmath::llround(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]);
+	return ll_round(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]);
 }
 
 void LLLineEditor::setReplaceNewlinesWithSpaces(BOOL replace)
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index c79c5fd9cc..cd05783091 100755
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -1580,7 +1580,7 @@ void LLMenuItemBranchDownGL::draw( void )
 		std::string::size_type offset = upper_case_label.find(getJumpKey());
 		if (offset != std::string::npos)
 		{
-			S32 x_offset = llmath::llround((F32)getRect().getWidth() / 2.f - getFont()->getWidthF32(mLabel.getString(), 0, S32_MAX) / 2.f);
+			S32 x_offset = ll_round((F32)getRect().getWidth() / 2.f - getFont()->getWidthF32(mLabel.getString(), 0, S32_MAX) / 2.f);
 			S32 x_begin = x_offset + getFont()->getWidth(mLabel, 0, offset);
 			S32 x_end = x_offset + getFont()->getWidth(mLabel, 0, offset + 1);
 			gl_line_2d(x_begin, LABEL_BOTTOM_PAD_PIXELS, x_end, LABEL_BOTTOM_PAD_PIXELS);
@@ -3012,8 +3012,8 @@ BOOL LLMenuGL::handleHover( S32 x, S32 y, MASK mask )
 	LLVector2 mouse_avg_dir((F32)mMouseVelX, (F32)mMouseVelY);
 	mouse_avg_dir.normVec();
 	F32 interp = 0.5f * (llclamp(mouse_dir * mouse_avg_dir, 0.f, 1.f));
-	mMouseVelX = llmath::llround(lerp((F32)mouse_delta_x, (F32)mMouseVelX, interp));
-	mMouseVelY = llmath::llround(lerp((F32)mouse_delta_y, (F32)mMouseVelY, interp));
+	mMouseVelX = ll_round(lerp((F32)mouse_delta_x, (F32)mMouseVelX, interp));
+	mMouseVelY = ll_round(lerp((F32)mouse_delta_y, (F32)mMouseVelY, interp));
 	mLastMouseX = x;
 	mLastMouseY = y;
 
diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp
index 6460012138..8cf88ad5eb 100755
--- a/indra/llui/llmodaldialog.cpp
+++ b/indra/llui/llmodaldialog.cpp
@@ -287,7 +287,7 @@ void LLModalDialog::draw()
 void LLModalDialog::centerOnScreen()
 {
 	LLVector2 window_size = LLUI::getWindowSize();
-	centerWithin(LLRect(0, 0, llmath::llround(window_size.mV[VX]), llmath::llround(window_size.mV[VY])));
+	centerWithin(LLRect(0, 0, ll_round(window_size.mV[VX]), ll_round(window_size.mV[VY])));
 }
 
 
diff --git a/indra/llui/llprogressbar.cpp b/indra/llui/llprogressbar.cpp
index 6443d46132..f9c2c344bd 100755
--- a/indra/llui/llprogressbar.cpp
+++ b/indra/llui/llprogressbar.cpp
@@ -78,7 +78,7 @@ void LLProgressBar::draw()
 	LLColor4 bar_color = mColorBar.get();
 	bar_color.mV[VALPHA] *= alpha; // modulate alpha
 	LLRect progress_rect = getLocalRect();
-	progress_rect.mRight = llmath::llround(getRect().getWidth() * (mPercentDone / 100.f));
+	progress_rect.mRight = ll_round(getRect().getWidth() * (mPercentDone / 100.f));
 	mImageFill->draw(progress_rect, bar_color);
 }
 
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index 476afa8acd..a8a0e9b7a5 100755
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -315,7 +315,7 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y)
 		// clip rect against root view
 		inner_rect_local.intersectWith(screen_local_extents);
 
-		S32 auto_scroll_speed = llmath::llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
+		S32 auto_scroll_speed = ll_round(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
 		// autoscroll region should take up no more than one third of visible scroller area
 		S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, 10); 
 		S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, 10); 
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 987ca3a013..98d8fd4355 100755
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -664,7 +664,7 @@ bool LLScrollListCtrl::updateColumnWidths()
 		S32 new_width = 0;
 		if (column->mRelWidth >= 0)
 		{
-			new_width = (S32)llmath::llround(column->mRelWidth*mItemListRect.getWidth());
+			new_width = (S32)ll_round(column->mRelWidth*mItemListRect.getWidth());
 		}
 		else if (column->mDynamicWidth)
 		{
@@ -2727,7 +2727,7 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params
 			}
 			if (new_column->mRelWidth >= 0)
 			{
-				new_column->setWidth((S32)llmath::llround(new_column->mRelWidth*mItemListRect.getWidth()));
+				new_column->setWidth((S32)ll_round(new_column->mRelWidth*mItemListRect.getWidth()));
 			}
 			else if(new_column->mDynamicWidth)
 			{
diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp
index 35d1809817..bee56bdece 100755
--- a/indra/llui/llspinctrl.cpp
+++ b/indra/llui/llspinctrl.cpp
@@ -153,7 +153,7 @@ F32 clamp_precision(F32 value, S32 decimal_precision)
 	for (S32 i = 0; i < decimal_precision; i++)
 		clamped_value *= 10.0;
 
-	clamped_value = llmath::llround((F32)clamped_value);
+	clamped_value = ll_round((F32)clamped_value);
 
 	for (S32 i = 0; i < decimal_precision; i++)
 		clamped_value /= 10.0;
diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp
index 8c876c3608..f156d3feae 100755
--- a/indra/llui/llstatbar.cpp
+++ b/indra/llui/llstatbar.cpp
@@ -714,7 +714,7 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect )
 				if (tick_begin > last_label + MIN_LABEL_SPACING)
 				{
 					gl_rect_2d(tick_begin, bar_rect.mTop, tick_end, bar_rect.mBottom - TICK_LENGTH, LLColor4(1.f, 1.f, 1.f, 0.25f));
-					S32 label_pos = tick_begin - llmath::llround((F32)tick_label_width * ((F32)tick_begin / (F32)bar_rect.getWidth()));
+					S32 label_pos = tick_begin - ll_round((F32)tick_label_width * ((F32)tick_begin / (F32)bar_rect.getWidth()));
 					LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, label_pos, bar_rect.mBottom - TICK_LENGTH,
 						LLColor4(1.f, 1.f, 1.f, 0.5f),
 						LLFontGL::LEFT, LLFontGL::TOP);
diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp
index 97adbb8147..3fe314e77a 100755
--- a/indra/llui/llstatgraph.cpp
+++ b/indra/llui/llstatgraph.cpp
@@ -111,7 +111,7 @@ void LLStatGraph::draw()
 	
 	color = it->mColor;
 	gGL.color4fv(color.mV);
-	gl_rect_2d(1, llmath::llround(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE);
+	gl_rect_2d(1, ll_round(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE);
 }
 
 void LLStatGraph::setMin(const F32 min)
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 75b1191913..35f71eae9d 100755
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1557,7 +1557,7 @@ void LLTextBase::reflow()
 											line_count));
 
 				line_start_index = segment->getStart() + seg_offset;
-				cur_top -= llmath::llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
+				cur_top -= ll_round((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
 				remaining_pixels = text_available_width;
 				line_height = 0;
 			}
@@ -1569,7 +1569,7 @@ void LLTextBase::reflow()
 											last_segment_char_on_line, 
 											line_rect, 
 											line_count));
-				cur_top -= llmath::llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
+				cur_top -= ll_round((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
 				break;
 			}
 			// ...or finished a segment and there are segments remaining on this line
@@ -1584,7 +1584,7 @@ void LLTextBase::reflow()
 												line_rect, 
 												line_count));
 					line_start_index = segment->getStart() + seg_offset;
-					cur_top -= llmath::llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
+					cur_top -= ll_round((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
 					line_height = 0;
 					remaining_pixels = text_available_width;
 				}
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index d6c13d5d98..7aa0fd32d5 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2914,7 +2914,7 @@ void LLTextEditor::markAsPreedit(S32 position, S32 length)
 
 S32 LLTextEditor::getPreeditFontSize() const
 {
-	return llmath::llround((F32)mFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]);
+	return ll_round((F32)mFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]);
 }
 
 BOOL LLTextEditor::isDirty() const
diff --git a/indra/llui/lltimectrl.cpp b/indra/llui/lltimectrl.cpp
index 4019293cfd..3f05d6f4c8 100755
--- a/indra/llui/lltimectrl.cpp
+++ b/indra/llui/lltimectrl.cpp
@@ -153,7 +153,7 @@ U32 LLTimeCtrl::getMinutes() const
 void LLTimeCtrl::setTime24(F32 time)
 {
 	time = llclamp(time, 0.0f, 23.99f); // fix out of range values
-	mTime = llmath::llround(time * MINUTES_PER_HOUR); // fixes values like 4.99999
+	mTime = ll_round(time * MINUTES_PER_HOUR); // fixes values like 4.99999
 
 	updateText();
 }
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index ff84055f8b..aabc7ed2e4 100755
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -236,8 +236,8 @@ void LLUI::dirtyRect(LLRect rect)
 void LLUI::setMousePositionScreen(S32 x, S32 y)
 {
 	S32 screen_x, screen_y;
-	screen_x = llmath::llround((F32)x * getScaleFactor().mV[VX]);
-	screen_y = llmath::llround((F32)y * getScaleFactor().mV[VY]);
+	screen_x = ll_round((F32)x * getScaleFactor().mV[VX]);
+	screen_y = ll_round((F32)y * getScaleFactor().mV[VY]);
 	
 	LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert());
 }
@@ -248,8 +248,8 @@ void LLUI::getMousePositionScreen(S32 *x, S32 *y)
 	LLCoordWindow cursor_pos_window;
 	getWindow()->getCursorPosition(&cursor_pos_window);
 	LLCoordGL cursor_pos_gl(cursor_pos_window.convert());
-	*x = llmath::llround((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]);
-	*y = llmath::llround((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]);
+	*x = ll_round((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]);
+	*y = ll_round((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]);
 }
 
 //static 
@@ -369,15 +369,15 @@ LLVector2 LLUI::getWindowSize()
 //static
 void LLUI::screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y)
 {
-	*gl_x = llmath::llround((F32)screen_x * getScaleFactor().mV[VX]);
-	*gl_y = llmath::llround((F32)screen_y * getScaleFactor().mV[VY]);
+	*gl_x = ll_round((F32)screen_x * getScaleFactor().mV[VX]);
+	*gl_y = ll_round((F32)screen_y * getScaleFactor().mV[VY]);
 }
 
 //static
 void LLUI::glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y)
 {
-	*screen_x = llmath::llround((F32)gl_x / getScaleFactor().mV[VX]);
-	*screen_y = llmath::llround((F32)gl_y / getScaleFactor().mV[VY]);
+	*screen_x = ll_round((F32)gl_x / getScaleFactor().mV[VX]);
+	*screen_y = ll_round((F32)gl_y / getScaleFactor().mV[VY]);
 }
 
 //static
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 44623e910b..a4366871e7 100755
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -837,9 +837,9 @@ void LLUrlEntryParcel::processParcelInfo(const LLParcelData& parcel_data)
 	// If parcel name is empty use Sim_name (x, y, z) for parcel label.
 	else if (!parcel_data.sim_name.empty())
 	{
-		S32 region_x = llmath::llround(parcel_data.global_x) % REGION_WIDTH_UNITS;
-		S32 region_y = llmath::llround(parcel_data.global_y) % REGION_WIDTH_UNITS;
-		S32 region_z = llmath::llround(parcel_data.global_z);
+		S32 region_x = ll_round(parcel_data.global_x) % REGION_WIDTH_UNITS;
+		S32 region_y = ll_round(parcel_data.global_y) % REGION_WIDTH_UNITS;
+		S32 region_z = ll_round(parcel_data.global_z);
 
 		label = llformat("%s (%d, %d, %d)",
 				parcel_data.sim_name.c_str(), region_x, region_y, region_z);
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 02f5165ea1..a9a2bab2b7 100755
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -244,8 +244,8 @@ void callRightMouseDown(float *pos, MASK mask)
     }
     
 	LLCoordGL		outCoords;
-	outCoords.mX = llmath::llround(pos[0]);
-	outCoords.mY  =llmath::llround(pos[1]);
+	outCoords.mX = ll_round(pos[0]);
+	outCoords.mY = ll_round(pos[1]);
 	gWindowImplementation->getCallbacks()->handleRightMouseDown(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
 }
 
@@ -257,8 +257,8 @@ void callRightMouseUp(float *pos, MASK mask)
     }
     
 	LLCoordGL		outCoords;
-	outCoords.mX = llmath::llround(pos[0]);
-	outCoords.mY = llmath::llround(pos[1]);
+	outCoords.mX = ll_round(pos[0]);
+	outCoords.mY = ll_round(pos[1]);
 	gWindowImplementation->getCallbacks()->handleRightMouseUp(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
 }
 
@@ -270,8 +270,8 @@ void callLeftMouseDown(float *pos, MASK mask)
     }
     
 	LLCoordGL		outCoords;
-	outCoords.mX = llmath::llround(pos[0]);
-	outCoords.mY = llmath::llround(pos[1]);
+	outCoords.mX = ll_round(pos[0]);
+	outCoords.mY = ll_round(pos[1]);
 	gWindowImplementation->getCallbacks()->handleMouseDown(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
 }
 
@@ -283,8 +283,8 @@ void callLeftMouseUp(float *pos, MASK mask)
     }
     
 	LLCoordGL		outCoords;
-	outCoords.mX = llmath::llround(pos[0]);
-	outCoords.mY = llmath::llround(pos[1]);
+	outCoords.mX = ll_round(pos[0]);
+	outCoords.mY = ll_round(pos[1]);
 	gWindowImplementation->getCallbacks()->handleMouseUp(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
 	
 }
@@ -297,8 +297,8 @@ void callDoubleClick(float *pos, MASK mask)
     }
     
 	LLCoordGL	outCoords;
-	outCoords.mX = llmath::llround(pos[0]);
-	outCoords.mY = llmath::llround(pos[1]);
+	outCoords.mX = ll_round(pos[0]);
+	outCoords.mY = ll_round(pos[1]);
 	gWindowImplementation->getCallbacks()->handleDoubleClick(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
 }
 
@@ -313,8 +313,8 @@ void callResize(unsigned int width, unsigned int height)
 void callMouseMoved(float *pos, MASK mask)
 {
 	LLCoordGL		outCoords;
-	outCoords.mX = llmath::llround(pos[0]);
-	outCoords.mY = llmath::llround(pos[1]);
+	outCoords.mX = ll_round(pos[0]);
+	outCoords.mY = ll_round(pos[1]);
 	double deltas[2];
 	gWindowImplementation->getMouseDeltas(deltas);
 	outCoords.mX += deltas[0];
@@ -360,8 +360,8 @@ void callDeltaUpdate(double *delta, MASK mask)
 void callMiddleMouseDown(float *pos, MASK mask)
 {
 	LLCoordGL		outCoords;
-	outCoords.mX = llmath::llround(pos[0]);
-	outCoords.mY = llmath::llround(pos[1]);
+	outCoords.mX = ll_round(pos[0]);
+	outCoords.mY = ll_round(pos[1]);
 	double deltas[2];
 	gWindowImplementation->getMouseDeltas(deltas);
 	outCoords.mX += deltas[0];
@@ -372,8 +372,8 @@ void callMiddleMouseDown(float *pos, MASK mask)
 void callMiddleMouseUp(float *pos, MASK mask)
 {
 	LLCoordGL outCoords;
-	outCoords.mX = llmath::llround(pos[0]);
-	outCoords.mY = llmath::llround(pos[1]);
+	outCoords.mX = ll_round(pos[0]);
+	outCoords.mY = ll_round(pos[1]);
 	double deltas[2];
 	gWindowImplementation->getMouseDeltas(deltas);
 	outCoords.mX += deltas[0];
@@ -510,8 +510,8 @@ void LLWindowMacOSX::updateMouseDeltas(double* deltas)
 {
 	if (mCursorDecoupled)
 	{
-		mCursorLastEventDeltaX = llmath::llround(deltas[0]);
-		mCursorLastEventDeltaY = llmath::llround(-deltas[1]);
+		mCursorLastEventDeltaX = ll_round(deltas[0]);
+		mCursorLastEventDeltaY = ll_round(-deltas[1]);
 		
 		if (mCursorIgnoreNextDelta)
 		{
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 80dcfcbfaf..bb22e02ea2 100755
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -874,7 +874,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
 		}
 
 		pos -= camera.getOrigin();	
-		mDistanceWRTCamera = llmath::llround(pos.magVec(), 0.01f);
+		mDistanceWRTCamera = ll_round(pos.magVec(), 0.01f);
 		mVObjp->updateLOD();
 	}
 }
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 93be22da10..d094a240f6 100755
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1331,7 +1331,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
 					for( i = minimum; i <= maximum; i++ )
 					{
 						F32 minus_one_to_one = F32(maximum - i) * twice_one_over_range - 1.f;
-						bias_and_scale_lut[i] = llclampb(llmath::llround(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128));
+						bias_and_scale_lut[i] = llclampb(ll_round(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128));
 					}
 				}
 				else
@@ -1339,7 +1339,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
 					for( i = minimum; i <= maximum; i++ )
 					{
 						F32 minus_one_to_one = F32(i - minimum) * twice_one_over_range - 1.f;
-						bias_and_scale_lut[i] = llclampb(llmath::llround(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128));
+						bias_and_scale_lut[i] = llclampb(ll_round(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128));
 					}
 				}
 
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 7b5f8600fe..17b38f63ec 100755
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -219,7 +219,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask)
 	if (hasMouseCapture())
 	{
 		F32 lerp = llclamp(1.f - (F32) (x - mGraphRect.mLeft) / (F32) mGraphRect.getWidth(), 0.f, 1.f);
-		mScrollIndex = llmath::llround( lerp * (F32)(mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY));
+		mScrollIndex = ll_round( lerp * (F32)(mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY));
 		mScrollIndex = llclamp(	mScrollIndex, 0, (S32)mRecording.getNumRecordedPeriods());
 		return TRUE;
 	}
@@ -1131,7 +1131,7 @@ void LLFastTimerView::drawLineGraph()
 		max_time = llmax(F32Microseconds(1.f), F32Microseconds(cur_max));
 	}
 
-	max_calls = llmath::llround(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f)));
+	max_calls = ll_round(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f)));
 	if (llabs((S32)(max_calls - cur_max_calls)) <= 1)
 	{
 		max_calls = cur_max_calls;
@@ -1466,7 +1466,7 @@ void LLFastTimerView::drawBars()
 		LLRect frame_bar_rect;
 		frame_bar_rect.setLeftTopAndSize(mBarRect.mLeft, 
 										bars_top, 
-										llmath::llround((mAverageTimerRow.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()), 
+										ll_round((mAverageTimerRow.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()), 
 										bar_height);
 		mAverageTimerRow.mTop = frame_bar_rect.mTop;
 		mAverageTimerRow.mBottom = frame_bar_rect.mBottom;
@@ -1480,7 +1480,7 @@ void LLFastTimerView::drawBars()
 			row.mTop = frame_bar_rect.mTop;
 			row.mBottom = frame_bar_rect.mBottom;
 			frame_bar_rect.mRight = frame_bar_rect.mLeft 
-									+ llmath::llround((row.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth());
+									+ ll_round((row.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth());
  			drawBar(frame_bar_rect, row, image_width, image_height);
 
 			frame_bar_rect.translate(0, -(bar_height + vpad));
@@ -1611,8 +1611,8 @@ S32 LLFastTimerView::drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width,
 	}
 
 	LLRect children_rect;
-	children_rect.mLeft  = llmath::llround(timer_bar.mChildrenStart / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft;
-	children_rect.mRight = llmath::llround(timer_bar.mChildrenEnd   / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft;
+	children_rect.mLeft  = ll_round(timer_bar.mChildrenStart / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft;
+	children_rect.mRight = ll_round(timer_bar.mChildrenEnd   / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft;
 
 	if (bar_rect.getHeight() > MIN_BAR_HEIGHT)
 	{
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index d3b068d990..b6e61f83b1 100755
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -308,7 +308,7 @@ void LLVolumeImplFlexible::updateRenderRes()
 	mRenderRes = (S32) (12.f*app_angle);
 #else //legacy behavior
 	//number of segments only cares about z axis
-	F32 app_angle = llmath::llround((F32) atan2( mVO->getScale().mV[2]*2.f, drawablep->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
+	F32 app_angle = ll_round((F32) atan2( mVO->getScale().mV[2]*2.f, drawablep->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
 
  	// Rendering sections increases with visible angle on the screen
 	mRenderRes = (S32)(FLEXIBLE_OBJECT_MAX_SECTIONS*4*app_angle*DEG_TO_RAD/LLViewerCamera::getInstance()->getView());
diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp
index f4ca80455e..eb26dd8341 100755
--- a/indra/newview/llfloaterbuyland.cpp
+++ b/indra/newview/llfloaterbuyland.cpp
@@ -392,9 +392,9 @@ void LLFloaterBuyLandUI::updateParcelInfo()
 	}
 
 	mParcelBillableArea =
-		llmath::llround(mRegion->getBillableFactor() * mParcelActualArea);
+		ll_round(mRegion->getBillableFactor() * mParcelActualArea);
 
- 	mParcelSupportedObjects = llmath::llround(
+ 	mParcelSupportedObjects = ll_round(
 		parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); 
  	// Can't have more than region max tasks, regardless of parcel 
  	// object bonus factor. 
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 6baa66ecc1..8c4feff1d9 100755
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -1224,7 +1224,7 @@ void LLPanelLandObjects::refresh()
 	{
 		S32 sw_max = parcel->getSimWideMaxPrimCapacity();
 		S32 sw_total = parcel->getSimWidePrimCount();
-		S32 max = llmath::llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus());
+		S32 max = ll_round(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus());
 		S32 total = parcel->getPrimCount();
 		S32 owned = parcel->getOwnerPrimCount();
 		S32 group = parcel->getGroupPrimCount();
@@ -2049,9 +2049,9 @@ void LLPanelLandOptions::refresh()
 		else
 		{
 			mLocationText->setTextArg("[LANDING]",llformat("%d, %d, %d (%d\xC2\xB0)",
-														   llmath::llround(pos.mV[VX]),
-														   llmath::llround(pos.mV[VY]),
-		   												   llmath::llround(pos.mV[VZ]),
+														   ll_round(pos.mV[VX]),
+														   ll_round(pos.mV[VY]),
+		   												   ll_round(pos.mV[VZ]),
 														   user_look_at_angle));
 		}
 
diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp
index 83d44c742b..f34760a6bf 100755
--- a/indra/newview/llfloaterlandholdings.cpp
+++ b/indra/newview/llfloaterlandholdings.cpp
@@ -208,8 +208,8 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
 			self->mActualArea += actual_area;
 			self->mBillableArea += billable_area;
 
-			S32 region_x = llmath::llround(global_x) % REGION_WIDTH_UNITS;
-			S32 region_y = llmath::llround(global_y) % REGION_WIDTH_UNITS;
+			S32 region_x = ll_round(global_x) % REGION_WIDTH_UNITS;
+			S32 region_y = ll_round(global_y) % REGION_WIDTH_UNITS;
 
 			std::string location;
 			location = llformat("%s (%d, %d)", sim_name.c_str(), region_x, region_y);
diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp
index ab5e9beb6c..719bf6ec19 100755
--- a/indra/newview/llfloatermap.cpp
+++ b/indra/newview/llfloatermap.cpp
@@ -159,8 +159,8 @@ void LLFloaterMap::setDirectionPos( LLTextBox* text_box, F32 rotation )
 	radius -= 8.f;
 
 	text_box->setOrigin( 
-		llmath::llround(map_half_width - text_half_width + radius * cos( rotation )),
-		llmath::llround(map_half_height - text_half_height + radius * sin( rotation )) );
+		ll_round(map_half_width - text_half_width + radius * cos( rotation )),
+		ll_round(map_half_height - text_half_height + radius * sin( rotation )) );
 }
 
 void LLFloaterMap::updateMinorDirections()
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp
index 98287947d8..87f927ff65 100755
--- a/indra/newview/llfloaterpathfindingcharacters.cpp
+++ b/indra/newview/llfloaterpathfindingcharacters.cpp
@@ -224,7 +224,7 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListItemData(const LLPa
 	columns[2]["column"] = "owner";
 	columns[2]["value"] = getOwnerName(pCharacterPtr);
 
-	S32 cpuTime = llmath::llround(pCharacterPtr->getCPUTime());
+	S32 cpuTime = ll_round(pCharacterPtr->getCPUTime());
 	std::string cpuTimeString = llformat("%d", cpuTime);
 	LLStringUtil::format_map_t string_args;
 	string_args["[CPU_TIME]"] = cpuTimeString;
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 4d2f24f331..6cd7c823bf 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -291,8 +291,8 @@ void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator)
 	{
 		if (fmodf((decimal_val * test_denominator) + 0.01f, 1.f) < 0.02f)
 		{
-			numerator = llmath::llround(decimal_val * test_denominator);
-			denominator = llmath::llround(test_denominator);
+			numerator = ll_round(decimal_val * test_denominator);
+			denominator = ll_round(test_denominator);
 			break;
 		}
 	}
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index dd8d8b4df2..bfcde3a1e6 100755
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -911,11 +911,11 @@ BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S3
 		//change another value proportionally
 		if(isWidthChanged)
 		{
-			height = llmath::llround(width / aspect_ratio) ;
+			height = ll_round(width / aspect_ratio) ;
 		}
 		else
 		{
-			width = llmath::llround(height * aspect_ratio) ;
+			width = ll_round(height * aspect_ratio) ;
 		}
 
 		//bound w/h by the max_value
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index bf17d6722a..f37d65b241 100755
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -663,9 +663,9 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
 	F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS );
 	std::string full_name = llformat("%s (%d, %d, %d)", 
 									 sim_name.c_str(), 
-									 llmath::llround(region_x), 
-									 llmath::llround(region_y),
-									 llmath::llround((F32)pos_global.mdV[VZ]));
+									 ll_round(region_x), 
+									 ll_round(region_y),
+									 ll_round((F32)pos_global.mdV[VZ]));
 	
 	std::string tooltip("");
 	mTrackedStatus = LLTracker::TRACKING_LOCATION;
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index c0ae9c5eac..c80dec0e75 100755
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -80,10 +80,10 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
 	S32 top =	llmax(y, mDragStartY);
 	S32 bottom =llmin(y, mDragStartY);
 
-	left = llmath::llround((F32) left * LLUI::getScaleFactor().mV[VX]);
-	right = llmath::llround((F32) right * LLUI::getScaleFactor().mV[VX]);
-	top = llmath::llround((F32) top * LLUI::getScaleFactor().mV[VY]);
-	bottom = llmath::llround((F32) bottom * LLUI::getScaleFactor().mV[VY]);
+	left = ll_round((F32) left * LLUI::getScaleFactor().mV[VX]);
+	right = ll_round((F32) right * LLUI::getScaleFactor().mV[VX]);
+	top = ll_round((F32) top * LLUI::getScaleFactor().mV[VY]);
+	bottom = ll_round((F32) bottom * LLUI::getScaleFactor().mV[VY]);
 
 	F32 old_far_plane = LLViewerCamera::getInstance()->getFar();
 	F32 old_near_plane = LLViewerCamera::getInstance()->getNear();
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index c4ff7b4b84..6f2995e43c 100755
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -316,7 +316,7 @@ void LLHUDNameTag::renderText(BOOL for_select)
 	{
 		LLUIImagePtr rect_top_image = LLUI::getUIImage("Rounded_Rect_Top");
 		LLRect label_top_rect = screen_rect;
-		const S32 label_height = llmath::llround((mFontp->getLineHeight() * (F32)mLabelSegments.size() + (VERTICAL_PADDING / 3.f)));
+		const S32 label_height = ll_round((mFontp->getLineHeight() * (F32)mLabelSegments.size() + (VERTICAL_PADDING / 3.f)));
 		label_top_rect.mBottom = label_top_rect.mTop - label_height;
 		LLColor4 label_top_color = text_color;
 		label_top_color.mV[VALPHA] = bubble_opacity * alpha_factor;
diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp
index 5f40a9f8ea..9c00243f44 100755
--- a/indra/newview/lllandmarkactions.cpp
+++ b/indra/newview/lllandmarkactions.cpp
@@ -74,9 +74,9 @@ public:
 		if (!landmark->getGlobalPos(landmark_global_pos))
 			return false;
 		//we have to round off each coordinates to compare positions properly
-		return llmath::llround(mPos.mdV[VX]) ==  llmath::llround(landmark_global_pos.mdV[VX])
-				&& llmath::llround(mPos.mdV[VY]) ==  llmath::llround(landmark_global_pos.mdV[VY])
-				&& llmath::llround(mPos.mdV[VZ]) ==  llmath::llround(landmark_global_pos.mdV[VZ]);
+		return ll_round(mPos.mdV[VX]) ==  ll_round(landmark_global_pos.mdV[VX])
+				&& ll_round(mPos.mdV[VY]) ==  ll_round(landmark_global_pos.mdV[VY])
+				&& ll_round(mPos.mdV[VZ]) ==  ll_round(landmark_global_pos.mdV[VZ]);
 	}
 };
 
@@ -320,7 +320,7 @@ void LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(const LLVector3d& gl
 	{
 		LLVector3 pos = sim_infop->getLocalPos(global_pos);
 		std::string name = sim_infop->getName() ;
-		cb(name, llmath::llround(pos.mV[VX]), llmath::llround(pos.mV[VY]),llmath::llround(pos.mV[VZ]));
+		cb(name, ll_round(pos.mV[VX]), ll_round(pos.mV[VY]),ll_round(pos.mV[VZ]));
 	}
 	else
 	{
@@ -364,7 +364,7 @@ void LLLandmarkActions::onRegionResponseNameAndCoords(region_name_and_coords_cal
 	{
 		LLVector3 local_pos = sim_infop->getLocalPos(global_pos);
 		std::string name = sim_infop->getName() ;
-		cb(name, llmath::llround(local_pos.mV[VX]), llmath::llround(local_pos.mV[VY]), llmath::llround(local_pos.mV[VZ]));
+		cb(name, ll_round(local_pos.mV[VX]), ll_round(local_pos.mV[VY]), ll_round(local_pos.mV[VZ]));
 	}
 }
 
diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp
index 7f9ea0a85f..d6758a9632 100755
--- a/indra/newview/llmanip.cpp
+++ b/indra/newview/llmanip.cpp
@@ -522,8 +522,8 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string
 
 	std::string val_string;
 	std::string fraction_string;
-	F32 val_to_print = llmath::llround(value, 0.001f);
-	S32 fractional_portion = llmath::llround(fmodf(llabs(val_to_print), 1.f) * 100.f);
+	F32 val_to_print = ll_round(value, 0.001f);
+	S32 fractional_portion = ll_round(fmodf(llabs(val_to_print), 1.f) * 100.f);
 	if (val_to_print < 0.f)
 	{
 		if (fractional_portion == 0)
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp
index cea93debfd..9c9e0ef5a8 100755
--- a/indra/newview/llmaniprotate.cpp
+++ b/indra/newview/llmaniprotate.cpp
@@ -368,9 +368,9 @@ void LLManipRotate::render()
 	LLQuaternion object_rot = first_object->getRotationEdit();
 	object_rot.getEulerAngles(&(euler_angles.mV[VX]), &(euler_angles.mV[VY]), &(euler_angles.mV[VZ]));
 	euler_angles *= RAD_TO_DEG;
-	euler_angles.mV[VX] = llmath::llround(fmodf(euler_angles.mV[VX] + 360.f, 360.f), 0.05f);
-	euler_angles.mV[VY] = llmath::llround(fmodf(euler_angles.mV[VY] + 360.f, 360.f), 0.05f);
-	euler_angles.mV[VZ] = llmath::llround(fmodf(euler_angles.mV[VZ] + 360.f, 360.f), 0.05f);
+	euler_angles.mV[VX] = ll_round(fmodf(euler_angles.mV[VX] + 360.f, 360.f), 0.05f);
+	euler_angles.mV[VY] = ll_round(fmodf(euler_angles.mV[VY] + 360.f, 360.f), 0.05f);
+	euler_angles.mV[VZ] = ll_round(fmodf(euler_angles.mV[VZ] + 360.f, 360.f), 0.05f);
 
 	renderXYZ(euler_angles);
 }
@@ -1524,7 +1524,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
 				F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f);
 				
 				F32 relative_mouse_angle = fmodf(mouse_angle + (SNAP_ANGLE_DETENTE / 2), SNAP_ANGLE_INCREMENT);
-				//fmodf(llmath::llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f);
+				//fmodf(ll_round(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f);
 	
 				LLVector3 object_axis;
 				getObjectAxisClosestToMouse(object_axis);
@@ -1608,7 +1608,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
 			F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f);
 			
 			F32 relative_mouse_angle = fmodf(mouse_angle + (SNAP_ANGLE_DETENTE / 2), SNAP_ANGLE_INCREMENT);
-			//fmodf(llmath::llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f);
+			//fmodf(ll_round(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f);
 
 			LLVector3 object_axis;
 			getObjectAxisClosestToMouse(object_axis);
diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp
index 9232b652a8..0cb41b4139 100755
--- a/indra/newview/llmanipscale.cpp
+++ b/indra/newview/llmanipscale.cpp
@@ -1554,8 +1554,8 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
 	mScaleSnapUnit1 = mScaleSnapUnit1 / (mSnapDir1 * mScaleDir);
 	mScaleSnapUnit2 = mScaleSnapUnit2 / (mSnapDir2 * mScaleDir);
 
-	mTickPixelSpacing1 = llmath::llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length());
-	mTickPixelSpacing2 = llmath::llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length());
+	mTickPixelSpacing1 = ll_round((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length());
+	mTickPixelSpacing2 = ll_round((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length());
 
 	if (uniform)
 	{
@@ -1626,8 +1626,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
 		F32 grid_offset2 = fmodf(dist_grid_axis, smallest_subdivision2);
 
 		// how many smallest grid units are we away from largest grid scale?
-		S32 sub_div_offset_1 = llmath::llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / smallest_subdivision1);
-		S32 sub_div_offset_2 = llmath::llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / smallest_subdivision2);
+		S32 sub_div_offset_1 = ll_round(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / smallest_subdivision1);
+		S32 sub_div_offset_2 = ll_round(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / smallest_subdivision2);
 
 		S32 num_ticks_per_side1 = llmax(1, lltrunc(0.5f * mSnapGuideLength / smallest_subdivision1));
 		S32 num_ticks_per_side2 = llmax(1, lltrunc(0.5f * mSnapGuideLength / smallest_subdivision2));
@@ -1681,7 +1681,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
 		LLVector2 screen_translate_axis(llabs(mScaleDir * LLViewerCamera::getInstance()->getLeftAxis()), llabs(mScaleDir * LLViewerCamera::getInstance()->getUpAxis()));
 		screen_translate_axis.normalize();
 
-		S32 tick_label_spacing = llmath::llround(screen_translate_axis * sTickLabelSpacing);
+		S32 tick_label_spacing = ll_round(screen_translate_axis * sTickLabelSpacing);
 
 		for (pass = 0; pass < 3; pass++)
 		{
@@ -1761,8 +1761,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
 		stop_tick = llmin(max_ticks1, num_ticks_per_side1);
 
 		F32 grid_resolution = mObjectSelection->getSelectType() == SELECT_TYPE_HUD ? 0.25f : llmax(gSavedSettings.getF32("GridResolution"), 0.001f);
-		S32 label_sub_div_offset_1 = llmath::llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1  * 32.f) / smallest_subdivision1);
-		S32 label_sub_div_offset_2 = llmath::llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2  * 32.f) / smallest_subdivision2);
+		S32 label_sub_div_offset_1 = ll_round(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1  * 32.f) / smallest_subdivision1);
+		S32 label_sub_div_offset_2 = ll_round(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2  * 32.f) / smallest_subdivision2);
 
 		for (S32 i = start_tick; i <= stop_tick; i++)
 		{
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index 15dce93cf3..4a576d07f7 100755
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -1246,7 +1246,7 @@ void LLManipTranslate::renderSnapGuides()
 		// find distance to nearest smallest grid unit
 		F32 offset_nearest_grid_unit = fmodf(dist_grid_axis, smallest_grid_unit_scale);
 		// how many smallest grid units are we away from largest grid scale?
-		S32 sub_div_offset = llmath::llround(fmodf(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale);
+		S32 sub_div_offset = ll_round(fmodf(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale);
 		S32 num_ticks_per_side = llmax(1, llfloor(0.5f * guide_size_meters / smallest_grid_unit_scale));
 
 		LLGLDepthTest gls_depth(GL_FALSE);
@@ -1361,12 +1361,12 @@ void LLManipTranslate::renderSnapGuides()
 			}
 		}
 
-		sub_div_offset = llmath::llround(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale);
+		sub_div_offset = ll_round(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale);
 
 		LLVector2 screen_translate_axis(llabs(translate_axis * LLViewerCamera::getInstance()->getLeftAxis()), llabs(translate_axis * LLViewerCamera::getInstance()->getUpAxis()));
 		screen_translate_axis.normVec();
 
-		S32 tick_label_spacing = llmath::llround(screen_translate_axis * sTickLabelSpacing);
+		S32 tick_label_spacing = ll_round(screen_translate_axis * sTickLabelSpacing);
         
 		// render tickmark values
 		for (S32 i = -num_ticks_per_side; i <= num_ticks_per_side; i++)
@@ -1404,7 +1404,7 @@ void LLManipTranslate::renderSnapGuides()
 				F32 offset_val = 0.5f * tick_offset.mV[ARROW_TO_AXIS[mManipPart]] / getMinGridScale();
 				EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode();
 				F32 text_highlight = 0.8f;
-				if(i - llmath::llround(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime)
+				if(i - ll_round(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime)
 				{
 					text_highlight = 1.f;
 				}
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index e6d675cb59..f67cf5810d 100755
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -122,8 +122,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
 
 	if(!getDecoupleTextureSize())
 	{
-		S32 screen_width = llmath::llround((F32)getRect().getWidth() * LLUI::getScaleFactor().mV[VX]);
-		S32 screen_height = llmath::llround((F32)getRect().getHeight() * LLUI::getScaleFactor().mV[VY]);
+		S32 screen_width = ll_round((F32)getRect().getWidth() * LLUI::getScaleFactor().mV[VX]);
+		S32 screen_height = ll_round((F32)getRect().getHeight() * LLUI::getScaleFactor().mV[VY]);
 			
 		setTextureSize(screen_width, screen_height);
 	}
@@ -476,8 +476,8 @@ void LLMediaCtrl::reshape( S32 width, S32 height, BOOL called_from_parent )
 {
 	if(!getDecoupleTextureSize())
 	{
-		S32 screen_width = llmath::llround((F32)width * LLUI::getScaleFactor().mV[VX]);
-		S32 screen_height = llmath::llround((F32)height * LLUI::getScaleFactor().mV[VY]);
+		S32 screen_width = ll_round((F32)width * LLUI::getScaleFactor().mV[VX]);
+		S32 screen_height = ll_round((F32)height * LLUI::getScaleFactor().mV[VY]);
 
 		// when floater is minimized, these sizes are negative
 		if ( screen_height > 0 && screen_width > 0 )
@@ -791,13 +791,13 @@ void LLMediaCtrl::draw()
 					{
 						// max width, adjusted height
 						width = r.getWidth();
-						height = llmin(llmax(llmath::llround(width / media_aspect), 0), r.getHeight());
+						height = llmin(llmax(ll_round(width / media_aspect), 0), r.getHeight());
 					}
 					else
 					{
 						// max height, adjusted width
 						height = r.getHeight();
-						width = llmin(llmax(llmath::llround(height * media_aspect), 0), r.getWidth());
+						width = llmin(llmax(ll_round(height * media_aspect), 0), r.getWidth());
 					}
 				}
 				else
@@ -881,14 +881,14 @@ void LLMediaCtrl::convertInputCoords(S32& x, S32& y)
 		coords_opengl = mMediaSource->getMediaPlugin()->getTextureCoordsOpenGL();
 	}
 	
-	x = llmath::llround((F32)x * LLUI::getScaleFactor().mV[VX]);
+	x = ll_round((F32)x * LLUI::getScaleFactor().mV[VX]);
 	if ( ! coords_opengl )
 	{
-		y = llmath::llround((F32)(y) * LLUI::getScaleFactor().mV[VY]);
+		y = ll_round((F32)(y) * LLUI::getScaleFactor().mV[VY]);
 	}
 	else
 	{
-		y = llmath::llround((F32)(getRect().getHeight() - y) * LLUI::getScaleFactor().mV[VY]);
+		y = ll_round((F32)(getRect().getHeight() - y) * LLUI::getScaleFactor().mV[VY]);
 	};
 }
 
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index e0017f30b7..9ddf596077 100755
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -227,7 +227,7 @@ void LLNetMap::draw()
 		}
 
 		// figure out where agent is
-		S32 region_width = llmath::llround(LLWorld::getInstance()->getRegionWidthInMeters());
+		S32 region_width = ll_round(LLWorld::getInstance()->getRegionWidthInMeters());
 
 		LLWorld::region_list_t::const_iterator end_it = LLWorld::getInstance()->getRegionList().cend();
 		for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
@@ -427,8 +427,8 @@ void LLNetMap::draw()
 						(pos_map.mV[VX] >= getRect().getWidth()) ||
 						(pos_map.mV[VY] >= getRect().getHeight()) )
 					{
-						S32 x = llmath::llround( pos_map.mV[VX] );
-						S32 y = llmath::llround( pos_map.mV[VY] );
+						S32 x = ll_round( pos_map.mV[VX] );
+						S32 y = ll_round( pos_map.mV[VY] );
 						LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10);
 					}
 					else
@@ -468,12 +468,12 @@ void LLNetMap::draw()
 
 		// Draw dot for self avatar position
 		pos_map = globalPosToView(gAgent.getPositionGlobal());
-		S32 dot_width = llmath::llround(mDotRadius * 2.f);
+		S32 dot_width = ll_round(mDotRadius * 2.f);
 		LLUIImagePtr you = LLWorldMapView::sAvatarYouLargeImage;
 		if (you)
 		{
-			you->draw(llmath::llround(pos_map.mV[VX] - mDotRadius),
-					  llmath::llround(pos_map.mV[VY] - mDotRadius),
+			you->draw(ll_round(pos_map.mV[VX] - mDotRadius),
+					  ll_round(pos_map.mV[VY] - mDotRadius),
 					  dot_width,
 					  dot_width);
 
@@ -601,8 +601,8 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color,
 	{
 		if (draw_arrow)
 		{
-			S32 x = llmath::llround( pos_local.mV[VX] );
-			S32 y = llmath::llround( pos_local.mV[VY] );
+			S32 x = ll_round( pos_local.mV[VX] );
+			S32 y = ll_round( pos_local.mV[VY] );
 			LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10 );
 			LLWorldMapView::drawTrackingArrow( getRect(), x, y, color );
 		}
@@ -618,8 +618,8 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color,
 
 LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y )
 {
-	x -= llmath::llround(getRect().getWidth() / 2 + mCurPan.mV[VX]);
-	y -= llmath::llround(getRect().getHeight() / 2 + mCurPan.mV[VY]);
+	x -= ll_round(getRect().getWidth() / 2 + mCurPan.mV[VX]);
+	y -= ll_round(getRect().getHeight() / 2 + mCurPan.mV[VY]);
 
 	LLVector3 pos_local( (F32)x, (F32)y, 0 );
 
@@ -760,7 +760,7 @@ void LLNetMap::renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &
 	LLVector3 local_pos;
 	local_pos.setVec( pos - mObjectImageCenterGlobal );
 
-	S32 diameter_pixels = llmath::llround(2 * radius_meters * mObjectMapTPM);
+	S32 diameter_pixels = ll_round(2 * radius_meters * mObjectMapTPM);
 	renderPoint( local_pos, color, diameter_pixels );
 }
 
@@ -776,8 +776,8 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color,
 	const S32 image_width = (S32)mObjectImagep->getWidth();
 	const S32 image_height = (S32)mObjectImagep->getHeight();
 
-	S32 x_offset = llmath::llround(pos_local.mV[VX] * mObjectMapTPM + image_width / 2);
-	S32 y_offset = llmath::llround(pos_local.mV[VY] * mObjectMapTPM + image_height / 2);
+	S32 x_offset = ll_round(pos_local.mV[VX] * mObjectMapTPM + image_width / 2);
+	S32 y_offset = ll_round(pos_local.mV[VY] * mObjectMapTPM + image_height / 2);
 
 	if ((x_offset < 0) || (x_offset >= image_width))
 	{
@@ -856,7 +856,7 @@ void LLNetMap::createObjectImage()
 	// ... which is, the diagonal of the rect.
 	F32 width = (F32)getRect().getWidth();
 	F32 height = (F32)getRect().getHeight();
-	S32 square_size = llmath::llround( sqrt(width*width + height*height) );
+	S32 square_size = ll_round( sqrt(width*width + height*height) );
 
 	// Find the least power of two >= the minimum size.
 	const S32 MIN_SIZE = 64;
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index e9317a2e93..a59a743b60 100755
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -464,9 +464,9 @@ std::string LLPanelClassifiedInfo::createLocationText(
 
 	if (!pos_global.isNull())
 	{
-		S32 region_x = llmath::llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
-		S32 region_y = llmath::llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
-		S32 region_z = llmath::llround((F32)pos_global.mdV[VZ]);
+		S32 region_x = ll_round((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
+		S32 region_y = ll_round((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
+		S32 region_z = ll_round((F32)pos_global.mdV[VZ]);
 		location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z));
 	}
 
diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp
index 2540b8edc2..7f82eecdb0 100755
--- a/indra/newview/llpanelgrouplandmoney.cpp
+++ b/indra/newview/llpanelgrouplandmoney.cpp
@@ -473,8 +473,8 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
 				land_type = LLTrans::getString("land_type_unknown");
 			}
 
-			S32 region_x = llmath::llround(global_x) % REGION_WIDTH_UNITS;
-			S32 region_y = llmath::llround(global_y) % REGION_WIDTH_UNITS;
+			S32 region_x = ll_round(global_x) % REGION_WIDTH_UNITS;
+			S32 region_y = ll_round(global_y) % REGION_WIDTH_UNITS;
 			std::string location = sim_name + llformat(" (%d, %d)", region_x, region_y);
 			std::string area;
 			committed+=billable_area;
diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp
index 3b2a6f4522..a660cb3b21 100755
--- a/indra/newview/llpanellandmarkinfo.cpp
+++ b/indra/newview/llpanellandmarkinfo.cpp
@@ -131,9 +131,9 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type)
 
 			if (name.empty())
 			{
-				S32 region_x = llmath::llround(agent_pos.mV[VX]);
-				S32 region_y = llmath::llround(agent_pos.mV[VY]);
-				S32 region_z = llmath::llround(agent_pos.mV[VZ]);
+				S32 region_x = ll_round(agent_pos.mV[VX]);
+				S32 region_y = ll_round(agent_pos.mV[VY]);
+				S32 region_z = ll_round(agent_pos.mV[VZ]);
 
 				std::string region_name;
 				LLViewerRegion* region = parcel_mgr->getSelectionRegion();
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index f8e5339253..9e70d0c98a 100755
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -442,9 +442,9 @@ void LLPanelObject::getState( )
 	LLQuaternion object_rot = objectp->getRotationEdit();
 	object_rot.getEulerAngles(&(mCurEulerDegrees.mV[VX]), &(mCurEulerDegrees.mV[VY]), &(mCurEulerDegrees.mV[VZ]));
 	mCurEulerDegrees *= RAD_TO_DEG;
-	mCurEulerDegrees.mV[VX] = fmod(llmath::llround(mCurEulerDegrees.mV[VX], OBJECT_ROTATION_PRECISION) + 360.f, 360.f);
-	mCurEulerDegrees.mV[VY] = fmod(llmath::llround(mCurEulerDegrees.mV[VY], OBJECT_ROTATION_PRECISION) + 360.f, 360.f);
-	mCurEulerDegrees.mV[VZ] = fmod(llmath::llround(mCurEulerDegrees.mV[VZ], OBJECT_ROTATION_PRECISION) + 360.f, 360.f);
+	mCurEulerDegrees.mV[VX] = fmod(ll_round(mCurEulerDegrees.mV[VX], OBJECT_ROTATION_PRECISION) + 360.f, 360.f);
+	mCurEulerDegrees.mV[VY] = fmod(ll_round(mCurEulerDegrees.mV[VY], OBJECT_ROTATION_PRECISION) + 360.f, 360.f);
+	mCurEulerDegrees.mV[VZ] = fmod(ll_round(mCurEulerDegrees.mV[VZ], OBJECT_ROTATION_PRECISION) + 360.f, 360.f);
 
 	if (enable_rotate)
 	{
@@ -1600,9 +1600,9 @@ void LLPanelObject::sendRotation(BOOL btn_down)
 	if (mObject.isNull()) return;
 
 	LLVector3 new_rot(mCtrlRotX->get(), mCtrlRotY->get(), mCtrlRotZ->get());
-	new_rot.mV[VX] = llmath::llround(new_rot.mV[VX], OBJECT_ROTATION_PRECISION);
-	new_rot.mV[VY] = llmath::llround(new_rot.mV[VY], OBJECT_ROTATION_PRECISION);
-	new_rot.mV[VZ] = llmath::llround(new_rot.mV[VZ], OBJECT_ROTATION_PRECISION);
+	new_rot.mV[VX] = ll_round(new_rot.mV[VX], OBJECT_ROTATION_PRECISION);
+	new_rot.mV[VY] = ll_round(new_rot.mV[VY], OBJECT_ROTATION_PRECISION);
+	new_rot.mV[VZ] = ll_round(new_rot.mV[VZ], OBJECT_ROTATION_PRECISION);
 
 	// Note: must compare before conversion to radians
 	LLVector3 delta = new_rot - mCurEulerDegrees;
@@ -2139,9 +2139,9 @@ void LLPanelObject::onClickBtnPasteData(const LLSD& userdata)
 		const LLQuaternion rotation_data = ll_quaternion_from_sd(mCopiedObjectData[param_data]);
 		rotation_data.getEulerAngles(&(euler_angles.mV[VX]), &(euler_angles.mV[VY]), &(euler_angles.mV[VZ]));
 		euler_angles *= RAD_TO_DEG;
-		euler_angles.mV[VX] = llmath::llround(fmodf(euler_angles.mV[VX] + 360.f, 360.f), OBJECT_ROTATION_PRECISION);
-		euler_angles.mV[VY] = llmath::llround(fmodf(euler_angles.mV[VY] + 360.f, 360.f), OBJECT_ROTATION_PRECISION);
-		euler_angles.mV[VZ] = llmath::llround(fmodf(euler_angles.mV[VZ] + 360.f, 360.f), OBJECT_ROTATION_PRECISION);
+		euler_angles.mV[VX] = ll_round(fmodf(euler_angles.mV[VX] + 360.f, 360.f), OBJECT_ROTATION_PRECISION);
+		euler_angles.mV[VY] = ll_round(fmodf(euler_angles.mV[VY] + 360.f, 360.f), OBJECT_ROTATION_PRECISION);
+		euler_angles.mV[VZ] = ll_round(fmodf(euler_angles.mV[VZ] + 360.f, 360.f), OBJECT_ROTATION_PRECISION);
 
 		mCtrlRotX->set(euler_angles.mV[VX]);
 		mCtrlRotY->set(euler_angles.mV[VY]);
diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp
index 4c2091a7ef..8fa9aac024 100755
--- a/indra/newview/llpanelpick.cpp
+++ b/indra/newview/llpanelpick.cpp
@@ -284,9 +284,9 @@ std::string LLPanelPickInfo::createLocationText(const std::string& owner_name, c
 
 	if (!pos_global.isNull())
 	{
-		S32 region_x = llmath::llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
-		S32 region_y = llmath::llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
-		S32 region_z = llmath::llround((F32)pos_global.mdV[VZ]);
+		S32 region_x = ll_round((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
+		S32 region_y = ll_round((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
+		S32 region_z = ll_round((F32)pos_global.mdV[VZ]);
 		location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z));
 	}
 	return location_text;
diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp
index 36cba1a9a5..e62b5a4f1d 100755
--- a/indra/newview/llpanelplaceinfo.cpp
+++ b/indra/newview/llpanelplaceinfo.cpp
@@ -231,15 +231,15 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data)
 	// If the region position is zero, grab position from the global
 	if(mPosRegion.isExactlyZero())
 	{
-		region_x = llmath::llround(parcel_data.global_x) % REGION_WIDTH_UNITS;
-		region_y = llmath::llround(parcel_data.global_y) % REGION_WIDTH_UNITS;
-		region_z = llmath::llround(parcel_data.global_z);
+		region_x = ll_round(parcel_data.global_x) % REGION_WIDTH_UNITS;
+		region_y = ll_round(parcel_data.global_y) % REGION_WIDTH_UNITS;
+		region_z = ll_round(parcel_data.global_z);
 	}
 	else
 	{
-		region_x = llmath::llround(mPosRegion.mV[VX]);
-		region_y = llmath::llround(mPosRegion.mV[VY]);
-		region_z = llmath::llround(mPosRegion.mV[VZ]);
+		region_x = ll_round(mPosRegion.mV[VX]);
+		region_y = ll_round(mPosRegion.mV[VY]);
+		region_z = ll_round(mPosRegion.mV[VZ]);
 	}
 
 	if (!parcel_data.name.empty())
diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp
index a0b69ba7da..4568cd3803 100755
--- a/indra/newview/llpanelplaceprofile.cpp
+++ b/indra/newview/llpanelplaceprofile.cpp
@@ -551,7 +551,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
 
 		// Can't have more than region max tasks, regardless of parcel
 		// object bonus factor.
-		S32 primitives = llmin(llmath::llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()),
+		S32 primitives = llmin(ll_round(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()),
 							   (S32)region->getMaxTasks());
 
 		const std::string available = getString("available");
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 2f265b78f1..f42df221e4 100755
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -630,12 +630,12 @@ void LLPanelPrimMediaControls::updateShape()
 		// convert screenspace bbox to pixels (in screen coords)
 		LLRect window_rect = gViewerWindow->getWorldViewRectScaled();
 		LLCoordGL screen_min;
-		screen_min.mX = llmath::llround((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (min.mV[VX] + 1.f) * 0.5f);
-		screen_min.mY = llmath::llround((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (min.mV[VY] + 1.f) * 0.5f);
+		screen_min.mX = ll_round((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (min.mV[VX] + 1.f) * 0.5f);
+		screen_min.mY = ll_round((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (min.mV[VY] + 1.f) * 0.5f);
 		
 		LLCoordGL screen_max;
-		screen_max.mX = llmath::llround((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (max.mV[VX] + 1.f) * 0.5f);
-		screen_max.mY = llmath::llround((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (max.mV[VY] + 1.f) * 0.5f);
+		screen_max.mX = ll_round((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (max.mV[VX] + 1.f) * 0.5f);
+		screen_max.mY = ll_round((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (max.mV[VY] + 1.f) * 0.5f);
 		
 		// grow panel so that screenspace bounding box fits inside "media_region" element of panel
 		LLRect media_panel_rect;
diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp
index 886e67cbe8..728fc69723 100755
--- a/indra/newview/llslurl.cpp
+++ b/indra/newview/llslurl.cpp
@@ -323,9 +323,9 @@ LLSLURL::LLSLURL(const std::string& grid,
 {
 	mGrid = grid;
 	mRegion = region;
-	S32 x = llmath::llround( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) );
-	S32 y = llmath::llround( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) );
-	S32 z = llmath::llround( (F32)position[VZ] );
+	S32 x = ll_round( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) );
+	S32 y = ll_round( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) );
+	S32 z = ll_round( (F32)position[VZ] );
 	mType = LOCATION;
 	mPosition = LLVector3(x, y, z);
 }
@@ -379,9 +379,9 @@ std::string LLSLURL::getSLURLString() const
 		case LOCATION:
 			{
 				// lookup the grid
-				S32 x = llmath::llround( (F32)mPosition[VX] );
-				S32 y = llmath::llround( (F32)mPosition[VY] );
-				S32 z = llmath::llround( (F32)mPosition[VZ] );	
+				S32 x = ll_round( (F32)mPosition[VX] );
+				S32 y = ll_round( (F32)mPosition[VY] );
+				S32 z = ll_round( (F32)mPosition[VZ] );	
 				return LLGridManager::getInstance()->getSLURLBase(mGrid) + 
 				LLURI::escape(mRegion) + llformat("/%d/%d/%d",x,y,z); 
 			}
@@ -416,9 +416,9 @@ std::string LLSLURL::getLoginString() const
 		case LOCATION:
 			unescaped_start << "uri:" 
 			<< mRegion << "&" 
-			<< llmath::llround(mPosition[0]) << "&" 
-			<< llmath::llround(mPosition[1]) << "&" 
-			<< llmath::llround(mPosition[2]);
+			<< ll_round(mPosition[0]) << "&" 
+			<< ll_round(mPosition[1]) << "&" 
+			<< ll_round(mPosition[2]);
 			break;
 		case HOME_LOCATION:
 			unescaped_start << "home";
@@ -462,9 +462,9 @@ std::string LLSLURL::getLocationString() const
 {
 	return llformat("%s/%d/%d/%d",
 					mRegion.c_str(),
-					(int)llmath::llround(mPosition[0]),
-					(int)llmath::llround(mPosition[1]),
-					(int)llmath::llround(mPosition[2]));						 
+					(int)ll_round(mPosition[0]),
+					(int)ll_round(mPosition[1]),
+					(int)ll_round(mPosition[2]));						 
 }
 
 // static
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 2744ccc575..bbc4dd86d8 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -177,14 +177,14 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail
             if (image_aspect_ratio > window_aspect_ratio)
             {
                 // trim off top and bottom
-                S32 new_height = llmath::llround((F32)getRect().getWidth() / image_aspect_ratio); 
+                S32 new_height = ll_round((F32)getRect().getWidth() / image_aspect_ratio); 
                 rect.mBottom += (getRect().getHeight() - new_height) / 2;
                 rect.mTop -= (getRect().getHeight() - new_height) / 2;
             }
             else if (image_aspect_ratio < window_aspect_ratio)
             {
                 // trim off left and right
-                S32 new_width = llmath::llround((F32)getRect().getHeight() * image_aspect_ratio); 
+                S32 new_width = ll_round((F32)getRect().getHeight() * image_aspect_ratio); 
                 rect.mLeft += (getRect().getWidth() - new_width) / 2;
                 rect.mRight -= (getRect().getWidth() - new_width) / 2;
             }
@@ -345,9 +345,9 @@ void LLSnapshotLivePreview::draw()
 			LLLocalClipRect clip(getLocalRect());
 			{
 				// draw diagonal stripe with gradient that passes over screen
-				S32 x1 = gViewerWindow->getWindowWidthScaled() * llmath::llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f)));
-				S32 x2 = x1 + llmath::llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
-				S32 x3 = x2 + llmath::llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
+				S32 x1 = gViewerWindow->getWindowWidthScaled() * ll_round((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f)));
+				S32 x2 = x1 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
+				S32 x3 = x2 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
 				S32 y1 = 0;
 				S32 y2 = gViewerWindow->getWindowHeightScaled();
 
@@ -429,7 +429,7 @@ void LLSnapshotLivePreview::draw()
 			gGL.pushMatrix();
 			{
 				LLRect& rect = mImageRect[old_image_index];
-				gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - llmath::llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f);
+				gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - ll_round(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f);
 				gGL.rotatef(-45.f * fall_interp, 0.f, 0.f, 1.f);
 				gGL.begin(LLRender::QUADS);
 				{
@@ -483,13 +483,13 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize()
 	{
 		// image too wide, shrink to width
 		mThumbnailWidth = max_width;
-		mThumbnailHeight = llmath::llround((F32)max_width / aspect_ratio);
+		mThumbnailHeight = ll_round((F32)max_width / aspect_ratio);
 	}
 	else
 	{
 		// image too tall, shrink to height
 		mThumbnailHeight = max_height;
-		mThumbnailWidth = llmath::llround((F32)max_height * aspect_ratio);
+		mThumbnailWidth = ll_round((F32)max_height * aspect_ratio);
 	}
     
 	if (mThumbnailWidth > width || mThumbnailHeight > height)
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp
index 9071c1e1a0..503dd6747d 100755
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -1232,10 +1232,10 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y,
 
 	S32 x_begin, y_begin, x_end, y_end;
 
-	x_begin = llmath::llround(x * scale_inv);
-	y_begin = llmath::llround(y * scale_inv);
-	x_end = llmath::llround((x + width) * scale_inv);
-	y_end = llmath::llround((y + width) * scale_inv);
+	x_begin = ll_round(x * scale_inv);
+	y_begin = ll_round(y * scale_inv);
+	x_end = ll_round((x + width) * scale_inv);
+	y_end = ll_round((y + width) * scale_inv);
 
 	if (x_end > tex_width)
 	{
@@ -1283,9 +1283,9 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y,
 				// Want non-linear curve for transparency gradient
 				coloru = MAX_WATER_COLOR;
 				const F32 frac = 1.f - 2.f/(2.f - (height - WATER_HEIGHT));
-				S32 alpha = 64 + llmath::llround((255-64)*frac);
+				S32 alpha = 64 + ll_round((255-64)*frac);
 
-				alpha = llmin(llmath::llround((F32)MAX_WATER_COLOR.mV[3]), alpha);
+				alpha = llmin(ll_round((F32)MAX_WATER_COLOR.mV[3]), alpha);
 				alpha = llmax(64, alpha);
 
 				coloru.mV[3] = alpha;
diff --git a/indra/newview/lltoolselectland.cpp b/indra/newview/lltoolselectland.cpp
index 0ec172b8f7..ff991dc9fd 100755
--- a/indra/newview/lltoolselectland.cpp
+++ b/indra/newview/lltoolselectland.cpp
@@ -219,8 +219,8 @@ void LLToolSelectLand::handleDeselect()
 
 void LLToolSelectLand::roundXY(LLVector3d &vec)
 {
-	vec.mdV[VX] = llmath::llround( vec.mdV[VX], (F64)PARCEL_GRID_STEP_METERS );
-	vec.mdV[VY] = llmath::llround( vec.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
+	vec.mdV[VX] = ll_round( vec.mdV[VX], (F64)PARCEL_GRID_STEP_METERS );
+	vec.mdV[VY] = ll_round( vec.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
 }
 
 
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index c74192f0b3..40c608b869 100755
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -1187,8 +1187,8 @@ LLRect get_whole_screen_region()
 	if (zoom_factor > 1.f)
 	{
 		S32 num_horizontal_tiles = llceil(zoom_factor);
-		S32 tile_width = llmath::llround((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor);
-		S32 tile_height = llmath::llround((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor);
+		S32 tile_width = ll_round((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor);
+		S32 tile_height = ll_round((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor);
 		int tile_y = sub_region / num_horizontal_tiles;
 		int tile_x = sub_region - (tile_y * num_horizontal_tiles);
 			
@@ -1483,8 +1483,8 @@ void render_ui_2d()
 		int pos_y = sub_region / llceil(zoom_factor);
 		int pos_x = sub_region - (pos_y*llceil(zoom_factor));
 		// offset for this tile
-		LLFontGL::sCurOrigin.mX -= llmath::llround((F32)gViewerWindow->getWindowWidthScaled() * (F32)pos_x / zoom_factor);
-		LLFontGL::sCurOrigin.mY -= llmath::llround((F32)gViewerWindow->getWindowHeightScaled() * (F32)pos_y / zoom_factor);
+		LLFontGL::sCurOrigin.mX -= ll_round((F32)gViewerWindow->getWindowWidthScaled() * (F32)pos_x / zoom_factor);
+		LLFontGL::sCurOrigin.mY -= ll_round((F32)gViewerWindow->getWindowHeightScaled() * (F32)pos_y / zoom_factor);
 	}
 
 	stop_glerror();
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index ad1c8ff0e7..26108e79f3 100755
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -66,7 +66,7 @@ void agent_jump( EKeystate s )
 {
 	if( KEYSTATE_UP == s  ) return;
 	F32 time = gKeyboard->getCurKeyElapsedTime();
-	S32 frame_count = llmath::llround(gKeyboard->getCurKeyElapsedFrameCount());
+	S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount());
 
 	if( time < FLY_TIME 
 		|| frame_count <= FLY_FRAMES 
@@ -126,7 +126,7 @@ static void agent_push_forwardbackward( EKeystate s, S32 direction, LLAgent::EDo
 	if (KEYSTATE_UP == s) return;
 
 	F32 time = gKeyboard->getCurKeyElapsedTime();
-	S32 frame_count = llmath::llround(gKeyboard->getCurKeyElapsedFrameCount());
+	S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount());
 
 	if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES)
 	{
@@ -177,7 +177,7 @@ static void agent_slide_leftright( EKeystate s, S32 direction, LLAgent::EDoubleT
 	agent_handle_doubletap_run(s, mode);
 	if( KEYSTATE_UP == s ) return;
 	F32 time = gKeyboard->getCurKeyElapsedTime();
-	S32 frame_count = llmath::llround(gKeyboard->getCurKeyElapsedFrameCount());
+	S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount());
 
 	if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES)
 	{
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index ba89633e5b..83669cd3df 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -925,7 +925,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 					{
 						F32 approximate_interest_dimension = (F32) sqrt(pimpl->getInterest());
 					
-						pimpl->setLowPrioritySizeLimit(llmath::llround(approximate_interest_dimension));
+						pimpl->setLowPrioritySizeLimit(ll_round(approximate_interest_dimension));
 					}
 				}
 				else
@@ -2332,8 +2332,8 @@ void LLViewerMediaImpl::scaleTextureCoords(const LLVector2& texture_coords, S32
 		texture_y = 1.0 + texture_y;
 
 	// scale x and y to texel units.
-	*x = llmath::llround(texture_x * mMediaSource->getTextureWidth());
-	*y = llmath::llround((1.0f - texture_y) * mMediaSource->getTextureHeight());
+	*x = ll_round(texture_x * mMediaSource->getTextureWidth());
+	*y = ll_round((1.0f - texture_y) * mMediaSource->getTextureHeight());
 
 	// Adjust for the difference between the actual texture height and the amount of the texture in use.
 	*y -= (mMediaSource->getTextureHeight() - mMediaSource->getHeight());
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 138804b54c..e85d8198aa 100755
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -281,7 +281,7 @@ S32 LLViewerParcelMgr::getSelectedArea() const
 		F64 width = mEastNorth.mdV[VX] - mWestSouth.mdV[VX];
 		F64 height = mEastNorth.mdV[VY] - mWestSouth.mdV[VY];
 		F32 area = (F32)(width * height);
-		rv = llmath::llround(area);
+		rv = ll_round(area);
 	}
 	return rv;
 }
@@ -301,10 +301,10 @@ void LLViewerParcelMgr::writeHighlightSegments(F32 west, F32 south, F32 east,
 											   F32 north)
 {
 	S32 x, y;
-	S32 min_x = llmath::llround( west / PARCEL_GRID_STEP_METERS );
-	S32 max_x = llmath::llround( east / PARCEL_GRID_STEP_METERS );
-	S32 min_y = llmath::llround( south / PARCEL_GRID_STEP_METERS );
-	S32 max_y = llmath::llround( north / PARCEL_GRID_STEP_METERS );
+	S32 min_x = ll_round( west / PARCEL_GRID_STEP_METERS );
+	S32 max_x = ll_round( east / PARCEL_GRID_STEP_METERS );
+	S32 min_y = ll_round( south / PARCEL_GRID_STEP_METERS );
+	S32 max_y = ll_round( north / PARCEL_GRID_STEP_METERS );
 
 	const S32 STRIDE = mParcelsPerEdge+1;
 
@@ -416,12 +416,12 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectParcelAt(const LLVector3d& pos_
 	LLVector3d northeast = pos_global;
 
 	southwest -= LLVector3d( PARCEL_GRID_STEP_METERS/2, PARCEL_GRID_STEP_METERS/2, 0 );
-	southwest.mdV[VX] = llmath::llround( southwest.mdV[VX], (F64)PARCEL_GRID_STEP_METERS );
-	southwest.mdV[VY] = llmath::llround( southwest.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
+	southwest.mdV[VX] = ll_round( southwest.mdV[VX], (F64)PARCEL_GRID_STEP_METERS );
+	southwest.mdV[VY] = ll_round( southwest.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
 
 	northeast += LLVector3d( PARCEL_GRID_STEP_METERS/2, PARCEL_GRID_STEP_METERS/2, 0 );
-	northeast.mdV[VX] = llmath::llround( northeast.mdV[VX], (F64)PARCEL_GRID_STEP_METERS );
-	northeast.mdV[VY] = llmath::llround( northeast.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
+	northeast.mdV[VX] = ll_round( northeast.mdV[VX], (F64)PARCEL_GRID_STEP_METERS );
+	northeast.mdV[VY] = ll_round( northeast.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
 
 	// Snap to parcel
 	return selectLand( southwest, northeast, TRUE );
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp
index 8225a35644..367312ecc5 100755
--- a/indra/newview/llviewerpartsim.cpp
+++ b/indra/newview/llviewerpartsim.cpp
@@ -391,7 +391,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt)
 		}
 
 		// Do glow interpolation
-		part->mGlow.mV[3] = (U8) llmath::llround(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f);
+		part->mGlow.mV[3] = (U8) ll_round(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f);
 
 		// Set the last update time to now.
 		part->mLastUpdateTime = cur_time;
diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp
index a4e8fb30b0..7efa821bbf 100755
--- a/indra/newview/llviewerpartsource.cpp
+++ b/indra/newview/llviewerpartsource.cpp
@@ -313,7 +313,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
 
 			part->mStartGlow = mPartSysData.mPartData.mStartGlow;
 			part->mEndGlow = mPartSysData.mPartData.mEndGlow;
-			part->mGlow = LLColor4U(0, 0, 0, (U8) llmath::llround(part->mStartGlow*255.f));
+			part->mGlow = LLColor4U(0, 0, 0, (U8) ll_round(part->mStartGlow*255.f));
 			
 			if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_DROP)
 			{
diff --git a/indra/newview/llviewertextureanim.cpp b/indra/newview/llviewertextureanim.cpp
index 2565b4e307..9af92d7377 100755
--- a/indra/newview/llviewertextureanim.cpp
+++ b/indra/newview/llviewertextureanim.cpp
@@ -179,7 +179,7 @@ S32 LLViewerTextureAnim::animateTextures(F32 &off_s, F32 &off_t,
 
 	if (!(mMode & SMOOTH))
 	{
-		frame_counter = (F32)llmath::llround(frame_counter);
+		frame_counter = (F32)ll_round(frame_counter);
 	}
 
 	//
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 64c2f31853..09578053de 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -898,8 +898,8 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window,  LLCoordGL pos, MASK
 	const char* buttonstatestr = "";
 	S32 x = pos.mX;
 	S32 y = pos.mY;
-	x = llmath::llround((F32)x / mDisplayScale.mV[VX]);
-	y = llmath::llround((F32)y / mDisplayScale.mV[VY]);
+	x = ll_round((F32)x / mDisplayScale.mV[VX]);
+	y = ll_round((F32)y / mDisplayScale.mV[VY]);
 
 	// only send mouse clicks to UI if UI is visible
 	if(gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
@@ -1065,8 +1065,8 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window,  LLCoordGL pos, MASK
 {
 	S32 x = pos.mX;
 	S32 y = pos.mY;
-	x = llmath::llround((F32)x / mDisplayScale.mV[VX]);
-	y = llmath::llround((F32)y / mDisplayScale.mV[VY]);
+	x = ll_round((F32)x / mDisplayScale.mV[VX]);
+	y = ll_round((F32)y / mDisplayScale.mV[VY]);
 
 	BOOL down = TRUE;
 	BOOL handle = handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_RIGHT,down);
@@ -1263,8 +1263,8 @@ void LLViewerWindow::handleMouseMove(LLWindow *window,  LLCoordGL pos, MASK mask
 	S32 x = pos.mX;
 	S32 y = pos.mY;
 
-	x = llmath::llround((F32)x / mDisplayScale.mV[VX]);
-	y = llmath::llround((F32)y / mDisplayScale.mV[VY]);
+	x = ll_round((F32)x / mDisplayScale.mV[VX]);
+	y = ll_round((F32)y / mDisplayScale.mV[VY]);
 
 	mMouseInWindow = TRUE;
 
@@ -1722,7 +1722,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
 		LLCoordWindow size;
 		mWindow->getSize(&size);
 		mWindowRectRaw.set(0, size.mY, size.mX, 0);
-		mWindowRectScaled.set(0, llmath::llround((F32)size.mY / mDisplayScale.mV[VY]), llmath::llround((F32)size.mX / mDisplayScale.mV[VX]), 0);
+		mWindowRectScaled.set(0, ll_round((F32)size.mY / mDisplayScale.mV[VY]), ll_round((F32)size.mX / mDisplayScale.mV[VX]), 0);
 	}
 	
 	LLFontManager::initClass();
@@ -2250,8 +2250,8 @@ void LLViewerWindow::reshape(S32 width, S32 height)
 		LLUI::setScaleFactor(mDisplayScale);
 
 		// update our window rectangle
-		mWindowRectScaled.mRight = mWindowRectScaled.mLeft + llmath::llround((F32)width / mDisplayScale.mV[VX]);
-		mWindowRectScaled.mTop = mWindowRectScaled.mBottom + llmath::llround((F32)height / mDisplayScale.mV[VY]);
+		mWindowRectScaled.mRight = mWindowRectScaled.mLeft + ll_round((F32)width / mDisplayScale.mV[VX]);
+		mWindowRectScaled.mTop = mWindowRectScaled.mBottom + ll_round((F32)height / mDisplayScale.mV[VY]);
 
 		setup2DViewport();
 
@@ -2447,8 +2447,8 @@ void LLViewerWindow::draw()
 		microsecondsToTimecodeString(gFrameTime,text);
 		const LLFontGL* font = LLFontGL::getFontSansSerif();
 		font->renderUTF8(text, 0,
-						llmath::llround((getWindowWidthScaled()/2)-100.f),
-						llmath::llround((getWindowHeightScaled()-60.f)),
+						ll_round((getWindowWidthScaled()/2)-100.f),
+						ll_round((getWindowHeightScaled()-60.f)),
 			LLColor4( 1.f, 1.f, 1.f, 1.f ),
 			LLFontGL::LEFT, LLFontGL::TOP);
 	}
@@ -2525,7 +2525,7 @@ void LLViewerWindow::draw()
 			const S32 DIST_FROM_TOP = 20;
 			LLFontGL::getFontSansSerifBig()->renderUTF8(
 				mOverlayTitle, 0,
-				llmath::llround( getWindowWidthScaled() * 0.5f),
+				ll_round( getWindowWidthScaled() * 0.5f),
 				getWindowHeightScaled() - DIST_FROM_TOP,
 				LLColor4(1, 1, 1, 0.4f),
 				LLFontGL::HCENTER, LLFontGL::TOP);
@@ -3381,7 +3381,7 @@ void LLViewerWindow::updateMouseDelta()
 		fdx = fdx + ((F32) dx - fdx) * llmin(gFrameIntervalSeconds.value()*amount,1.f);
 		fdy = fdy + ((F32) dy - fdy) * llmin(gFrameIntervalSeconds.value()*amount,1.f);
 
-		mCurrentMouseDelta.set(llmath::llround(fdx), llmath::llround(fdy));
+		mCurrentMouseDelta.set(ll_round(fdx), ll_round(fdy));
 		mouse_vel.setVec(fdx,fdy);
 	}
 	else
@@ -3496,10 +3496,10 @@ void LLViewerWindow::updateWorldViewRect(bool use_full_window)
 		new_world_rect.mTop = llmax(new_world_rect.mTop, new_world_rect.mBottom + 1);
 		new_world_rect.mRight = llmax(new_world_rect.mRight, new_world_rect.mLeft + 1);
 
-		new_world_rect.mLeft = llmath::llround((F32)new_world_rect.mLeft * mDisplayScale.mV[VX]);
-		new_world_rect.mRight = llmath::llround((F32)new_world_rect.mRight * mDisplayScale.mV[VX]);
-		new_world_rect.mBottom = llmath::llround((F32)new_world_rect.mBottom * mDisplayScale.mV[VY]);
-		new_world_rect.mTop = llmath::llround((F32)new_world_rect.mTop * mDisplayScale.mV[VY]);
+		new_world_rect.mLeft = ll_round((F32)new_world_rect.mLeft * mDisplayScale.mV[VX]);
+		new_world_rect.mRight = ll_round((F32)new_world_rect.mRight * mDisplayScale.mV[VX]);
+		new_world_rect.mBottom = ll_round((F32)new_world_rect.mBottom * mDisplayScale.mV[VY]);
+		new_world_rect.mTop = ll_round((F32)new_world_rect.mTop * mDisplayScale.mV[VY]);
 	}
 
 	if (mWorldViewRectRaw != new_world_rect)
@@ -5182,10 +5182,10 @@ void LLViewerWindow::calcDisplayScale()
 LLRect 	LLViewerWindow::calcScaledRect(const LLRect & rect, const LLVector2& display_scale)
 {
 	LLRect res = rect;
-	res.mLeft = llmath::llround((F32)res.mLeft / display_scale.mV[VX]);
-	res.mRight = llmath::llround((F32)res.mRight / display_scale.mV[VX]);
-	res.mBottom = llmath::llround((F32)res.mBottom / display_scale.mV[VY]);
-	res.mTop = llmath::llround((F32)res.mTop / display_scale.mV[VY]);
+	res.mLeft = ll_round((F32)res.mLeft / display_scale.mV[VX]);
+	res.mRight = ll_round((F32)res.mRight / display_scale.mV[VX]);
+	res.mBottom = ll_round((F32)res.mBottom / display_scale.mV[VY]);
+	res.mTop = ll_round((F32)res.mTop / display_scale.mV[VY]);
 
 	return res;
 }
@@ -5448,8 +5448,8 @@ void LLPickInfo::updateXYCoords()
 		LLPointer<LLViewerTexture> imagep = LLViewerTextureManager::getFetchedTexture(tep->getID());
 		if(mUVCoords.mV[VX] >= 0.f && mUVCoords.mV[VY] >= 0.f && imagep.notNull())
 		{
-			mXYCoords.mX = llmath::llround(mUVCoords.mV[VX] * (F32)imagep->getWidth());
-			mXYCoords.mY = llmath::llround((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight());
+			mXYCoords.mX = ll_round(mUVCoords.mV[VX] * (F32)imagep->getWidth());
+			mXYCoords.mY = ll_round((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight());
 		}
 	}
 }
@@ -5478,7 +5478,7 @@ void LLPickInfo::getSurfaceInfo()
 
 	if (objectp)
 	{
-		if (gViewerWindow->cursorIntersect(llmath::llround((F32)mMousePt.mX), llmath::llround((F32)mMousePt.mY), 1024.f,
+		if (gViewerWindow->cursorIntersect(ll_round((F32)mMousePt.mX), ll_round((F32)mMousePt.mY), 1024.f,
 										   objectp, -1, mPickTransparent,
 										   &mObjectFace,
 										   &intersection,
@@ -5536,8 +5536,8 @@ LLVector2 LLPickInfo::pickUV()
 		objectp->mDrawable.notNull() && objectp->getPCode() == LL_PCODE_VOLUME &&
 		mObjectFace < objectp->mDrawable->getNumFaces())
 	{
-		S32 scaled_x = llmath::llround((F32)mPickPt.mX * gViewerWindow->getDisplayScale().mV[VX]);
-		S32 scaled_y = llmath::llround((F32)mPickPt.mY * gViewerWindow->getDisplayScale().mV[VY]);
+		S32 scaled_x = ll_round((F32)mPickPt.mX * gViewerWindow->getDisplayScale().mV[VX]);
+		S32 scaled_y = ll_round((F32)mPickPt.mY * gViewerWindow->getDisplayScale().mV[VY]);
 		const S32 UV_PICK_WIDTH = 5;
 		const S32 UV_PICK_HALF_WIDTH = (UV_PICK_WIDTH - 1) / 2;
 		U8 uv_pick_buffer[UV_PICK_WIDTH * UV_PICK_WIDTH * 4];
diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp
index 4685c68126..c4430f4308 100755
--- a/indra/newview/llvlcomposition.cpp
+++ b/indra/newview/llvlcomposition.cpp
@@ -123,10 +123,10 @@ BOOL LLVLComposition::generateHeights(const F32 x, const F32 y,
 
 	S32 x_begin, y_begin, x_end, y_end;
 
-	x_begin = llmath::llround( x * mScaleInv );
-	y_begin = llmath::llround( y * mScaleInv );
-	x_end = llmath::llround( (x + width) * mScaleInv );
-	y_end = llmath::llround( (y + width) * mScaleInv );
+	x_begin = ll_round( x * mScaleInv );
+	y_begin = ll_round( y * mScaleInv );
+	x_end = ll_round( (x + width) * mScaleInv );
+	y_end = ll_round( (y + width) * mScaleInv );
 
 	if (x_end > mWidth)
 	{
@@ -318,8 +318,8 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y,
 	S32 x_begin, y_begin, x_end, y_end;
 	x_begin = (S32)(x * mScaleInv);
 	y_begin = (S32)(y * mScaleInv);
-	x_end = llmath::llround( (x + width) * mScaleInv );
-	y_end = llmath::llround( (y + width) * mScaleInv );
+	x_end = ll_round( (x + width) * mScaleInv );
+	y_end = ll_round( (y + width) * mScaleInv );
 
 	if (x_end > mWidth)
 	{
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 31d0189768..27db49bb6b 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -7296,7 +7296,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe
 		if (it != contents.mParams.end())
 		{
 			S32 index = it - contents.mParams.begin();
-			contents.mParamAppearanceVersion = llmath::llround(contents.mParamWeights[index]);
+			contents.mParamAppearanceVersion = ll_round(contents.mParamWeights[index]);
 			LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mParamAppearanceVersion << LL_ENDL;
 		}
 	}
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index e178546675..0091c09f4b 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -2501,7 +2501,7 @@ void LLVivoxVoiceClient::sendPositionalUpdate(void)
 				if(!p->mIsSelf)
 				{
 					// scale from the range 0.0-1.0 to vivox volume in the range 0-100
-					S32 volume = llmath::llround(p->mVolume / VOLUME_SCALE_VIVOX);
+					S32 volume = ll_round(p->mVolume / VOLUME_SCALE_VIVOX);
 					bool mute = p->mOnMuteList;
 					
 					if(mute)
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index 67ee033e83..c2531348f7 100755
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -683,7 +683,7 @@ void LLVOPartGroup::getGeometry(S32 idx,
 		}
 		else 
 		{
-			pglow = LLColor4U(0, 0, 0, (U8) llmath::llround(255.f*part.mStartGlow));
+			pglow = LLColor4U(0, 0, 0, (U8) ll_round(255.f*part.mStartGlow));
 			pcolor = LLColor4U(part.mStartColor);
 		}
 	}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 5a6b6ff02b..6f534229d9 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1223,7 +1223,7 @@ S32	LLVOVolume::computeLODDetail(F32 distance, F32 radius)
 	{
 		// We've got LOD in the profile, and in the twist.  Use radius.
 		F32 tan_angle = (LLVOVolume::sLODFactor*radius)/distance;
-		cur_detail = LLVolumeLODGroup::getDetailFromTan(llmath::llround(tan_angle, 0.01f));
+		cur_detail = LLVolumeLODGroup::getDetailFromTan(ll_round(tan_angle, 0.01f));
 	}
 	else
 	{
@@ -1281,8 +1281,8 @@ BOOL LLVOVolume::calcLOD()
 	// DON'T Compensate for field of view changing on FOV zoom.
 	distance *= F_PI/3.f;
 
-	cur_detail = computeLODDetail(llmath::llround(distance, 0.01f), 
-									llmath::llround(radius, 0.01f));
+	cur_detail = computeLODDetail(ll_round(distance, 0.01f), 
+									ll_round(radius, 0.01f));
 
 
 	if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) &&
@@ -1295,7 +1295,7 @@ BOOL LLVOVolume::calcLOD()
 
 	if (cur_detail != mLOD)
 	{
-		mAppAngle = llmath::llround((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
+		mAppAngle = ll_round((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
 		mLOD = cur_detail;		
 		return TRUE;
 	}
diff --git a/indra/newview/llwlanimator.cpp b/indra/newview/llwlanimator.cpp
index 63f141b225..beca1114d6 100755
--- a/indra/newview/llwlanimator.cpp
+++ b/indra/newview/llwlanimator.cpp
@@ -242,7 +242,7 @@ std::string LLWLAnimator::timeToString(F32 curTime)
 	// get hours and minutes
 	hours = (S32) (24.0 * curTime);
 	curTime -= ((F32) hours / 24.0f);
-	min = llmath::llround(24.0f * 60.0f * curTime);
+	min = ll_round(24.0f * 60.0f * curTime);
 
 	// handle case where it's 60
 	if(min == 60) 
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 777d4c4c92..e334abd5dd 100755
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -978,8 +978,8 @@ void LLWorld::updateWaterObjects()
 		}
 
 		// Resize and reshape the water objects
-		const S32 water_center_x = center_x + llmath::llround((wx + dim[0]) * 0.5f * gDirAxes[dir][0]);
-		const S32 water_center_y = center_y + llmath::llround((wy + dim[1]) * 0.5f * gDirAxes[dir][1]);
+		const S32 water_center_x = center_x + ll_round((wx + dim[0]) * 0.5f * gDirAxes[dir][0]);
+		const S32 water_center_y = center_y + ll_round((wy + dim[1]) * 0.5f * gDirAxes[dir][1]);
 		
 		LLVOWater* waterp = mEdgeWaterObjects[dir];
 		if (!waterp || waterp->isDead())
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index a7c324ce10..8ed59855a6 100755
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -420,8 +420,8 @@ void LLWorldMapView::draw()
 			if (overlayimage)
 			{
 				// Inform the fetch mechanism of the size we need
-				S32 draw_size = llmath::llround(sMapScale);
-				overlayimage->setKnownDrawSize(llmath::llround(draw_size * LLUI::getScaleFactor().mV[VX]), llmath::llround(draw_size * LLUI::getScaleFactor().mV[VY]));
+				S32 draw_size = ll_round(sMapScale);
+				overlayimage->setKnownDrawSize(ll_round(draw_size * LLUI::getScaleFactor().mV[VX]), ll_round(draw_size * LLUI::getScaleFactor().mV[VY]));
 				// Draw something whenever we have enough info
 				if (overlayimage->hasGLTexture())
 				{
@@ -519,7 +519,7 @@ void LLWorldMapView::draw()
 	drawImage(pos_global, sAvatarYouImage);
 
 	LLVector3 pos_map = globalPosToView(pos_global);
-	if (!pointInView(llmath::llround(pos_map.mV[VX]), llmath::llround(pos_map.mV[VY])))
+	if (!pointInView(ll_round(pos_map.mV[VX]), ll_round(pos_map.mV[VY])))
 	{
 		drawTracking(pos_global,
 					 lerp(LLColor4::yellow, LLColor4::orange, 0.4f),
@@ -784,8 +784,8 @@ void LLWorldMapView::drawGenericItem(const LLItemInfo& item, LLUIImagePtr image)
 void LLWorldMapView::drawImage(const LLVector3d& global_pos, LLUIImagePtr image, const LLColor4& color)
 {
 	LLVector3 pos_map = globalPosToView( global_pos );
-	image->draw(llmath::llround(pos_map.mV[VX] - image->getWidth() /2.f),
-				llmath::llround(pos_map.mV[VY] - image->getHeight()/2.f),
+	image->draw(ll_round(pos_map.mV[VX] - image->getWidth() /2.f),
+				ll_round(pos_map.mV[VY] - image->getHeight()/2.f),
 				color);
 }
 
@@ -794,8 +794,8 @@ void LLWorldMapView::drawImageStack(const LLVector3d& global_pos, LLUIImagePtr i
 	LLVector3 pos_map = globalPosToView( global_pos );
 	for(U32 i=0; i<count; i++)
 	{
-		image->draw(llmath::llround(pos_map.mV[VX] - image->getWidth() /2.f),
-					llmath::llround(pos_map.mV[VY] - image->getHeight()/2.f + i*offset),
+		image->draw(ll_round(pos_map.mV[VX] - image->getWidth() /2.f),
+					ll_round(pos_map.mV[VY] - image->getHeight()/2.f + i*offset),
 					color);
 	}
 }
@@ -969,8 +969,8 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4&
 								  const std::string& label, const std::string& tooltip, S32 vert_offset )
 {
 	LLVector3 pos_local = globalPosToView( pos_global );
-	S32 x = llmath::llround( pos_local.mV[VX] );
-	S32 y = llmath::llround( pos_local.mV[VY] );
+	S32 x = ll_round( pos_local.mV[VX] );
+	S32 y = ll_round( pos_local.mV[VY] );
 	LLFontGL* font = LLFontGL::getFontSansSerifSmall();
 	S32 text_x = x;
 	S32 text_y = (S32)(y - sTrackCircleImage->getHeight()/2 - font->getLineHeight());
@@ -1121,8 +1121,8 @@ static void drawDot(F32 x_pixels, F32 y_pixels,
 
 	if(-HEIGHT_THRESHOLD <= relative_z && relative_z <= HEIGHT_THRESHOLD)
 	{
-		dot_image->draw(llmath::llround(x_pixels) - dot_image->getWidth()/2,
-						llmath::llround(y_pixels) - dot_image->getHeight()/2, 
+		dot_image->draw(ll_round(x_pixels) - dot_image->getWidth()/2,
+						ll_round(y_pixels) - dot_image->getHeight()/2, 
 						color);
 	}
 	else
@@ -1177,9 +1177,9 @@ void LLWorldMapView::drawAvatar(F32 x_pixels,
 			dot_image = sAvatarAboveImage;
 		}
 	}
-	S32 dot_width = llmath::llround(dot_radius * 2.f);
-	dot_image->draw(llmath::llround(x_pixels - dot_radius),
-					llmath::llround(y_pixels - dot_radius),
+	S32 dot_width = ll_round(dot_radius * 2.f);
+	dot_image->draw(ll_round(x_pixels - dot_radius),
+					ll_round(y_pixels - dot_radius),
 					dot_width,
 					dot_width,
 					color);
@@ -1206,8 +1206,8 @@ void LLWorldMapView::drawIconName(F32 x_pixels,
 								  const std::string& second_line)
 {
 	const S32 VERT_PAD = 8;
-	S32 text_x = llmath::llround(x_pixels);
-	S32 text_y = llmath::llround(y_pixels
+	S32 text_x = ll_round(x_pixels);
+	S32 text_y = ll_round(y_pixels
 						 - BIG_DOT_RADIUS
 						 - VERT_PAD);
 
@@ -1395,8 +1395,8 @@ void LLWorldMapView::setDirectionPos( LLTextBox* text_box, F32 rotation )
 	F32 radius = llmin( map_half_height - text_half_height, map_half_width - text_half_width );
 
 	text_box->setOrigin( 
-		llmath::llround(map_half_width - text_half_width + radius * cos( rotation )),
-		llmath::llround(map_half_height - text_half_height + radius * sin( rotation )) );
+		ll_round(map_half_width - text_half_width + radius * cos( rotation )),
+		ll_round(map_half_height - text_half_height + radius * sin( rotation )) );
 }
 
 
@@ -1444,8 +1444,8 @@ void LLWorldMapView::reshape( S32 width, S32 height, BOOL called_from_parent )
 bool LLWorldMapView::checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track)
 {
 	LLVector3 pos_view = globalPosToView(item.getGlobalPosition());
-	S32 item_x = llmath::llround(pos_view.mV[VX]);
-	S32 item_y = llmath::llround(pos_view.mV[VY]);
+	S32 item_x = ll_round(pos_view.mV[VX]);
+	S32 item_y = ll_round(pos_view.mV[VY]);
 
 	if (x < item_x - BIG_DOT_RADIUS) return false;
 	if (x > item_x + BIG_DOT_RADIUS) return false;
@@ -1609,8 +1609,8 @@ BOOL LLWorldMapView::handleMouseDown( S32 x, S32 y, MASK mask )
 {
 	gFocusMgr.setMouseCapture( this );
 
-	mMouseDownPanX = llmath::llround(sPanX);
-	mMouseDownPanY = llmath::llround(sPanY);
+	mMouseDownPanX = ll_round(sPanX);
+	mMouseDownPanY = ll_round(sPanY);
 	mMouseDownX = x;
 	mMouseDownY = y;
 	sHandledLastClick = TRUE;
-- 
GitLab