⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 94044 in webkit


Ignore:
Timestamp:
Aug 29, 2011, 10:01:47 PM (15 years ago)
Author:
dbates@webkit.org
Message:

Add HAVE(VASPRINTF) macro to test for vasprintf() support
https://bugs.webkit.org/show_bug.cgi?id=67156

Reviewed by Darin Adler.

Source/JavaScriptCore:

Encapsulate testing of vasprintf() support in a HAVE macro
instead of hardcoding the list of supported/unsupported
compilers at the call site.

  • wtf/Platform.h:

Source/WebCore:

  • xml/parser/XMLDocumentParserLibxml2.cpp:

(WebCore::XMLDocumentParser::error): Modified to use HAVE(VASPRINTF).

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r94035 r94044  
     12011-08-29  Daniel Bates  <dbates@webkit.org>
     2
     3        Add HAVE(VASPRINTF) macro to test for vasprintf() support
     4        https://bugs.webkit.org/show_bug.cgi?id=67156
     5
     6        Reviewed by Darin Adler.
     7
     8        Encapsulate testing of vasprintf() support in a HAVE macro
     9        instead of hardcoding the list of supported/unsupported
     10        compilers at the call site.
     11
     12        * wtf/Platform.h:
     13
    1142011-08-29  Mark Hahnenberg  <mhahnenberg@apple.com>
    215
  • trunk/Source/JavaScriptCore/wtf/Platform.h

    r93950 r94044  
    682682#endif
    683683
     684#if !defined(HAVE_VASPRINTF)
     685#if !COMPILER(MSVC) && !COMPILER(RVCT) && !COMPILER(MINGW)
     686#define HAVE_VASPRINTF 1
     687#endif
     688#endif
     689
    684690#if !defined(HAVE_STRNSTR)
    685691#if OS(DARWIN) || OS(FREEBSD)
  • trunk/Source/WebCore/ChangeLog

    r94041 r94044  
     12011-08-29  Daniel Bates  <dbates@webkit.org>
     2
     3        Add HAVE(VASPRINTF) macro to test for vasprintf() support
     4        https://bugs.webkit.org/show_bug.cgi?id=67156
     5
     6        Reviewed by Darin Adler.
     7
     8        * xml/parser/XMLDocumentParserLibxml2.cpp:
     9        (WebCore::XMLDocumentParser::error): Modified to use HAVE(VASPRINTF).
     10
    1112011-08-29  Yuta Kitamura  <yutak@chromium.org>
    212
  • trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp

    r93638 r94044  
    939939        return;
    940940
    941 #if COMPILER(MSVC) || COMPILER(RVCT) || COMPILER(MINGW)
     941#if HAVE(VASPRINTF)
     942    char* m;
     943    if (vasprintf(&m, message, args) == -1)
     944        return;
     945#else
    942946    char m[1024];
    943947    vsnprintf(m, sizeof(m) - 1, message, args);
    944 #else
    945     char* m;
    946     if (vasprintf(&m, message, args) == -1)
    947         return;
    948948#endif
    949949
     
    953953        handleError(type, m, lineNumber(), columnNumber());
    954954
    955 #if !COMPILER(MSVC) && !COMPILER(RVCT) && !COMPILER(MINGW)
     955#if HAVE(VASPRINTF)
    956956    free(m);
    957957#endif
Note: See TracChangeset for help on using the changeset viewer.