From: vegorov@chromium.org Date: Thu, 30 Jun 2011 11:53:54 +0000 (+0000) Subject: Fix SConstruct to pass correct defines to samples/preparser when building with librar... X-Git-Tag: upstream/4.7.83~19022 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb32b10b4c50511ead89c8dbdfb7066f698bde5c;p=platform%2Fupstream%2Fv8.git Fix SConstruct to pass correct defines to samples/preparser when building with library=shared. Fix shell sample build with library=library. R=ager@chromium.org Review URL: http://codereview.chromium.org/7283039 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8485 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/SConstruct b/SConstruct index 95dfd9e..e678bd4 100644 --- a/SConstruct +++ b/SConstruct @@ -400,6 +400,9 @@ DTOA_EXTRA_FLAGS = { CCTEST_EXTRA_FLAGS = { 'all': { 'CPPPATH': [join(root_dir, 'src')], + 'library:shared': { + 'CPPDEFINES': ['USING_V8_SHARED'] + }, }, 'gcc': { 'all': { @@ -436,9 +439,6 @@ CCTEST_EXTRA_FLAGS = { 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], 'LIBS': ['winmm', 'ws2_32'] }, - 'library:shared': { - 'CPPDEFINES': ['USING_V8_SHARED'] - }, 'arch:ia32': { 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'] }, @@ -453,6 +453,9 @@ CCTEST_EXTRA_FLAGS = { SAMPLE_FLAGS = { 'all': { 'CPPPATH': [join(abspath('.'), 'include')], + 'library:shared': { + 'CPPDEFINES': ['USING_V8_SHARED'] + }, }, 'gcc': { 'all': { @@ -572,9 +575,6 @@ SAMPLE_FLAGS = { 'verbose:on': { 'LINKFLAGS': ['/VERBOSE'] }, - 'library:shared': { - 'CPPDEFINES': ['USING_V8_SHARED'] - }, 'prof:on': { 'LINKFLAGS': ['/MAP'] }, @@ -625,7 +625,10 @@ SAMPLE_FLAGS = { PREPARSER_FLAGS = { 'all': { - 'CPPPATH': [join(abspath('.'), 'include'), join(abspath('.'), 'src')] + 'CPPPATH': [join(abspath('.'), 'include'), join(abspath('.'), 'src')], + 'library:shared': { + 'CPPDEFINES': ['USING_V8_SHARED'] + }, }, 'gcc': { 'all': { @@ -727,9 +730,6 @@ PREPARSER_FLAGS = { 'verbose:on': { 'LINKFLAGS': ['/VERBOSE'] }, - 'library:shared': { - 'CPPDEFINES': ['USING_V8_SHARED'] - }, 'prof:on': { 'LINKFLAGS': ['/MAP'] }, diff --git a/samples/shell.cc b/samples/shell.cc index 15c1a5a..7c30bec 100644 --- a/samples/shell.cc +++ b/samples/shell.cc @@ -498,12 +498,15 @@ void ExternalArrayWeakCallback(v8::Persistent object, void* data) { v8::Handle CreateExternalArray(const v8::Arguments& args, v8::ExternalArrayType type, size_t element_size) { - ASSERT(element_size == 1 || element_size == 2 || element_size == 4 || + assert(element_size == 1 || + element_size == 2 || + element_size == 4 || element_size == 8); if (args.Length() != 1) { return v8::ThrowException( v8::String::New("Array constructor needs one parameter.")); } + static const int kMaxLength = 0x3fffffff; size_t length = 0; if (args[0]->IsUint32()) { length = args[0]->Uint32Value(); @@ -513,7 +516,7 @@ v8::Handle CreateExternalArray(const v8::Arguments& args, return v8::ThrowException( v8::String::New("Array length must not be negative.")); } - if (raw_length > v8::internal::ExternalArray::kMaxLength) { + if (raw_length > kMaxLength) { return v8::ThrowException( v8::String::New("Array length exceeds maximum length.")); } @@ -522,7 +525,7 @@ v8::Handle CreateExternalArray(const v8::Arguments& args, return v8::ThrowException( v8::String::New("Array length must be a number.")); } - if (length > static_cast(v8::internal::ExternalArray::kMaxLength)) { + if (length > static_cast(kMaxLength)) { return v8::ThrowException( v8::String::New("Array length exceeds maximum length.")); }