Changeset 28517 in webkit


Ignore:
Timestamp:
Dec 7, 2007 9:18:38 AM (16 years ago)
Author:
kevino@webkit.org
Message:

MSVC7 build fix due to a compiler bug with placement new and/or templates and casting.

Reviewed by Darin Adler.

Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r28491 r28517  
     12007-12-06  Kevin Ollivier  <kevino@theolliviers.com>
     2
     3        MSVC7 build fix due to a compiler bug with placement new and/or
     4        templates and casting.
     5
     6        Reviewed by Darin Adler.
     7
     8        * wtf/Vector.h:
     9        (WTF::::append):
     10
    1112007-12-06  Darin Adler  <darin@apple.com>
    212
  • trunk/JavaScriptCore/wtf/Vector.h

    r28076 r28517  
    669669        if (size() == capacity())
    670670            ptr = expandCapacity(size() + 1, ptr);
     671           
     672        // FIXME: MSVC7 generates compilation errors when trying to assign
     673        // a pointer to a Vector of its base class (i.e. can't downcast). So far
     674        // I've been unable to determine any logical reason for this, so I can
     675        // only assume it is a bug with the compiler. Casting is very bad
     676        // however because it subverts implicit conversions, so a better
     677        // solution is direly needed.
     678#if COMPILER(MSVC7)
     679        new (end()) T(static_cast<T>(*ptr));
     680#else
    671681        new (end()) T(*ptr);
     682#endif
    672683        ++m_size;
    673684    }
Note: See TracChangeset for help on using the changeset viewer.