Changeset 41823 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Mar 18, 2009, 9:42:21 PM (16 years ago)
Author:
[email protected]
Message:

Rolling out r41818 since it broke the windows build.
Error: ..\..\runtime\DatePrototype.cpp(30) : fatal error C1083: Cannot open include file: 'langinfo.h': No such file or directory

  • runtime/DatePrototype.cpp: (JSC::formatLocaleDate):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/DatePrototype.cpp

    r41818 r41823  
    2828#include "DateInstance.h"
    2929#include <float.h>
    30 #include <langinfo.h>
    3130#include <limits.h>
    3231#include <locale.h>
     
    183182static JSCell* formatLocaleDate(ExecState* exec, const GregorianDateTime& gdt, LocaleDateTimeFormat format)
    184183{
    185     static const nl_item formats[] = { D_T_FMT, D_FMT, T_FMT };
     184    static const char* const formatStrings[] = { "%#c", "%#x", "%X" };
    186185 
    187186    // Offset year if needed
     
    192191        localTM.tm_year = equivalentYearForDST(year) - 1900;
    193192 
    194     // We do not allow strftime to generate dates with 2-digits years,
    195     // both to avoid ambiguity, and a crash in strncpy, for years that
    196     // need offset.
    197     char* formatString = strdup(nl_langinfo(formats[format]));
    198     char* yPos = strchr(formatString, 'y');
    199     if (yPos)
    200         *yPos = 'Y';
    201 
    202193    // Do the formatting
    203194    const int bufsize = 128;
    204195    char timebuffer[bufsize];
    205     size_t ret = strftime(timebuffer, bufsize, formatString, &localTM);
    206 
    207     free(formatString);
     196    size_t ret = strftime(timebuffer, bufsize, formatStrings[format], &localTM);
    208197 
    209198    if (ret == 0)
Note: See TracChangeset for help on using the changeset viewer.