Limit copied uniform and vertex attribute names to the implicit size of the
buffers passed in. Increase the size of the buffer the client will allocate
for mapped names to be equal to the maximum token length.

BUG=http://code.google.com/p/angleproject/issues/detail?id=234
TEST=WebGL conformance test to be checked in soon
Review URL: http://codereview.appspot.com/5306063

git-svn-id: https://angleproject.googlecode.com/svn/trunk@804 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/preprocessor/length_limits.h b/src/compiler/preprocessor/length_limits.h
new file mode 100644
index 0000000..4f1f713
--- /dev/null
+++ b/src/compiler/preprocessor/length_limits.h
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2011 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+//
+// length_limits.h
+//
+
+#if !defined(__LENGTH_LIMITS_H)
+#define __LENGTH_LIMITS_H 1
+
+// These constants are factored out from the rest of the headers to
+// make it easier to reference them from the compiler sources.
+
+// These lengths do not include the NULL terminator.
+#define MAX_SYMBOL_NAME_LEN 256
+#define MAX_STRING_LEN 511
+
+#endif // !(defined(__LENGTH_LIMITS_H)
diff --git a/src/compiler/preprocessor/scanner.h b/src/compiler/preprocessor/scanner.h
index 33306e5..233d1dc 100644
--- a/src/compiler/preprocessor/scanner.h
+++ b/src/compiler/preprocessor/scanner.h
@@ -48,10 +48,7 @@
 #if !defined(__SCANNER_H)
 #define __SCANNER_H 1
 
-// These lengths do not include the NULL terminator.
-#define MAX_SYMBOL_NAME_LEN 256
-#define MAX_STRING_LEN 511
-
+#include "compiler/preprocessor/length_limits.h"
 #include "compiler/preprocessor/parser.h"
 
 // Not really atom table stuff but needed first...